---
updatedAt: 2025-12-25T13:41:27.000Z
agentTools:
  projectIndex: https://developers.kommo.com/llms.txt
---

# Disconnect chat channel

After disconnecting the channel, you will stop receiving webhooks for outgoing messages.  The “initiate conversation” option will also be disabled in the lead card (upon the expiration of the UI/UX cache).

If you disconnect a chat channel, you will see an error message **Lead source disabled**.

<Image align="center" border={true} width="600px" src="https://files.readme.io/9a42b35b9fff3247f0061dcabb6f1a852fdc3e2be919ee789a81eb43b5b55469-image_17.jpg" className="border" />

# Headers & Authorization type

| Parameter    | Data type | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| :----------- | :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Date         | string    | Date and time when the request was generated. The signature will be valid for 15 minutes from this Date. The date should be in the format “Thu, 01 Jan 2023 12:00:00 +0000” (RFC2822)                                                                                                                                                                                                                                                                                                                                                                                                    |
| Content-type | string    | Request data type. Currently, only `application/json` is supported.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Content-MD5  | string    | For the request body, it is necessary to calculate the MD5 hash and indicate it in the header in lowercase. At the same time, it is important to keep in mind that the request body is calculated as a stream of bytes without considering the end of JSON markup, and if there are `\n` or spaces at the end, they will also be taken into account. For GET requests, MD5 must also be calculated. Even if nothing is passed in the request body, MD5 will be obtained from an empty string.                                                                                            |
| X-Signature  | string    | Signature of the request as a string. It is formed from the name of the method (GET/POST) in uppercase, with the values of the headers concatenated by `\n`. Header values ​​come in a specific order. If there is no header, an empty string is specified instead. Next, add the requested path from the URL without the protocol and domain (without GET parameters) to the line. The resulting string is calculated using HMAC-SHA1, and as a secret, we use the channel secret obtained during registration. The resulting hash in lowercase is indicated in the X-Signature header. |

<Recipe slug="calculate-headers-for-chats-api-requests" title="Calculate headers for Chats API requests" />

**Data type header when the request is successful/in case of an error**\
Content-Type: application/json

<Callout icon="🚧" theme="warn">
  You should write the body in your request exactly the same as written when calculating the headers.
</Callout>

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "chats-api",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://amojo.kommo.com/v2/origin/custom/"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/{channel_id}/disconnect": {
      "delete": {
        "summary": "Disconnect chat channel",
        "description": "After disconnecting the channel, you will stop receiving webhooks for outgoing messages.  The “initiate conversation” option will also be disabled in the lead card (upon the expiration of the UI/UX cache).",
        "operationId": "disconnect-channel",
        "parameters": [
          {
            "name": "Date",
            "in": "header",
            "description": "Date and time when the request was generated. The signature will be valid for 15 minutes from this Date. The date should be in the format “Thu, 01 Jan 2023 12:00:00 +0000” (RFC2822)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Content-type",
            "in": "header",
            "description": "Request data type. Currently, only application/json is supported.",
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          },
          {
            "name": "Content-MD5",
            "in": "header",
            "description": "For the request body, it is necessary to calculate the MD5 hash and indicate it in the header in lowercase. At the same time, it is important to keep in mind that the request body is calculated as a stream of bytes without considering the end of JSON markup, and if there are “\\n” or spaces at the end, they will also be taken into account. For GET requests, MD5 must also be calculated. Even if nothing is passed in the request body, MD5 will be obtained from an empty string.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Signature",
            "in": "header",
            "description": "Signature of the request as a string. It is formed from the name of the method (GET/POST) in uppercase, with the values of the headers concatenated by “\\n”. Header values ​​come in a specific order. If there is no header, an empty string is specified instead. Next, add the requested path from the URL without the protocol and domain (without GET parameters) to the line. The resulting string is calculated using HMAC-SHA1, and as a secret, we use the channel secret obtained during registration. The resulting hash in lowercase is indicated in the X-Signature header.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel_id",
            "in": "path",
            "description": "Channel ID",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "description": "`amojo_id` of the account (https://developers.kommo.com/reference/chat-api-accountid)"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "description": "amojo_id of the account"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "description": "amojo_id of the account"
                  }
                }
              }
            },
            "application/hal+json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "description": "amojo_id of the account"
                  }
                }
              },
              "examples": {
                "Request Example": {
                  "value": {
                    "account_id": "XXXXXX-d2eb-4bd8-b862-a67934927b38"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Channel disconnected successfully": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Invalid data given. Details are available in the response.": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "text/plain": {
                "examples": {
                  "Incorrect request signature": {
                    "value": ""
                  }
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "text/plain": {
                "examples": {
                  "Channel does not exist": {
                    "value": ""
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```