curl --request DELETE \
--url https://app.thinnest.ai/api/v1/agents/{id}/channels/telegram \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.thinnest.ai/api/v1/agents/{id}/channels/telegram', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/agents/{id}/channels/telegram"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text){
"agent": "ag_5c4a5f93-2b1e-4d7a-9f60-8e2d1c3b4a71",
"web": {
"id": "ch_0e6b2f71-3c9d-4a58-b1e7-5d2a8f4c9b30",
"connected": true,
"publicKey": "pk_9fQ2xLm7Rt4vWb8KcN3hYd6sJ1pZ",
"previousKeyExpiresAt": null
},
"whatsapp": {
"id": null,
"connected": false,
"phoneNumber": null,
"flagged": false,
"messagingLimit": null,
"blockingNotices": 0
},
"telegram": {
"id": "ch_5b2e9c18-4f7a-4d3e-a6b0-8c1d7e2f9a54",
"connected": false,
"username": null,
"webhookFailed": false
},
"voice": {
"id": "ch_c3f80b2e-6d14-47a9-8e5b-1f9a2c7d4e06",
"answersCalls": true,
"phoneNumber": null,
"surfaces": [
"web",
"whatsapp"
]
}
}Disconnect Telegram Bot
Disconnects the agent’s Telegram bot (a 404 when none is connected) and tells Telegram to stop delivering to us. Its conversations stay in your inbox, and the bot itself still exists in Telegram — delete it in @BotFather if you want it gone. A build key may do this.
curl --request DELETE \
--url https://app.thinnest.ai/api/v1/agents/{id}/channels/telegram \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.thinnest.ai/api/v1/agents/{id}/channels/telegram', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/agents/{id}/channels/telegram"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text){
"agent": "ag_5c4a5f93-2b1e-4d7a-9f60-8e2d1c3b4a71",
"web": {
"id": "ch_0e6b2f71-3c9d-4a58-b1e7-5d2a8f4c9b30",
"connected": true,
"publicKey": "pk_9fQ2xLm7Rt4vWb8KcN3hYd6sJ1pZ",
"previousKeyExpiresAt": null
},
"whatsapp": {
"id": null,
"connected": false,
"phoneNumber": null,
"flagged": false,
"messagingLimit": null,
"blockingNotices": 0
},
"telegram": {
"id": "ch_5b2e9c18-4f7a-4d3e-a6b0-8c1d7e2f9a54",
"connected": false,
"username": null,
"webhookFailed": false
},
"voice": {
"id": "ch_c3f80b2e-6d14-47a9-8e5b-1f9a2c7d4e06",
"answersCalls": true,
"phoneNumber": null,
"surfaces": [
"web",
"whatsapp"
]
}
}Authorizations
Your API key (ta_live_…) from Settings → API keys, sent as Authorization: Bearer <key>. Keep it on a server: it can message every customer you have. A key is full, build or read-only; a request its level does not allow is refused with 403.
Headers
Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace.
"org_3fKq9TzQ1mN8vB2xR7cLpA"
Path Parameters
The agent's id (ag_…).
Response
Disconnected. The agent's channels after the change.
Where an agent answers. A channel never set up has id: null.
The agent's id.
"ag_5c4a5f93-2b1e-4d7a-9f60-8e2d1c3b4a71"
The website chat widget.
Show child attributes
Show child attributes
The WhatsApp Business number. Connected in the console.
Show child attributes
Show child attributes
The Telegram bot.
Show child attributes
Show child attributes
Calls.
Show child attributes
Show child attributes