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
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. Refused with 404 (Workspace not found.) when the id is unknown, is not one of your customers, or is not an org_… id; 410 when that customer was deleted (restore it with POST /customers/{id}/restore until it is erased); 403 when the key belongs to one customer workspace (it cannot act as another); 400 when your workspace is not a developer workspace. /customers/* and GET /customers/usage are your own workspace's and refuse the header with 400: call them without it.
"org_3fKq9TzQ1mN8vB2xR7cLpA"
Response
Disconnected. The agent's channels after the change.
Where an agent answers. A channel never set up has id: null.