# Channel management

## Lists all channels for a chatbot

> \
> \
> \*\*Required Permission:\*\* \`chatbots.channels.list\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Channel management","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/channels":{"get":{"operationId":"ChannelController_listChannels[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}}],"responses":{"200":{"description":"List of all channels.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListChannelsResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Lists all channels for a chatbot","tags":["Channel management"],"description":"\n\n**Required Permission:** `chatbots.channels.list`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"ListChannelsResponseDto":{"type":"object","properties":{"error":{"type":"string","description":"Optional error message."},"channels":{"description":"A list of retrieved channels.","type":"array","items":{"$ref":"#/components/schemas/ChannelDto"}}},"required":["channels"]},"ChannelDto":{"type":"object","properties":{"id":{"type":"string","description":"The Id of the channel."},"name":{"type":"string","description":"The name of the channel."},"number":{"type":"string","description":"The phone number of the channel (In case of voice channel)."},"status":{"type":"string","description":"The status of the channel."},"token":{"type":"string","description":"The token of the channel."},"type":{"type":"string","description":"The type of the channel.","enum":["facebook","voice","audiocodes","web","meta-whatsapp","telegram","brevo","email","debug"]},"created":{"type":"string","description":"Creation timestamp (ISO format)."},"updated":{"type":"string","description":"Last updated timestamp (ISO format)."},"tokenValidUntil":{"type":"string","description":"The date until the token is valid (ISO format)."},"chatbotId":{"type":"string","description":"The Id of the chatbot the channel exists in."},"environment":{"type":"string","description":"The environment the channel is in.","enum":["dev","test","prod"]},"mpId":{"type":"string","description":"The Id for the MP channel."},"whatsappId":{"type":"string","description":"The Id for the WhatsApp provider."},"facebookId":{"type":"string","description":"The Id for the Facebook Messenger provider."},"telegramId":{"type":"string","description":"The Id for the Telegram provider."},"instagramId":{"type":"string","description":"The Id for the Instagram provider."},"audiocodesId":{"type":"string","description":"The Id for the AudioCodes voice gateway."},"language":{"type":"string","description":"The language code for the channel."},"domains":{"description":"A list of domains on which the channel is used (In case of web-widget channel).","type":"array","items":{"type":"string"}},"providerId":{"type":"string","description":"The Id of the provider."},"pin":{"type":"string","description":"The pin for the channel."},"metadata":{"type":"object","description":"Additional custom metadata as key-value pairs.","additionalProperties":{"type":"string"}},"async":{"type":"boolean","description":"Indicates whether the channel is async or not."},"description":{"type":"string","description":"The description for the channel."},"email":{"type":"string","description":"The email of the channel (In case of email channel)."}},"required":["id","name","status","token","type","created","updated","tokenValidUntil","chatbotId","environment","domains","providerId"]}}}}
```

## GET /v1/chatbots/{chatbotId}/channels/generate-token

> Generates a channel token for Web or Audiocodes

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Channel management","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{}],"paths":{"/v1/chatbots/{chatbotId}/channels/generate-token":{"get":{"operationId":"ChannelController_generateChannelToken[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"channelType","required":true,"in":"query","description":"The type of the channel.\n\n- `0`: WEB\n- `6`: AUDIOCODES","schema":{"$ref":"#/components/schemas/ChannelType"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateChannelTokenResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Generates a channel token for Web or Audiocodes","tags":["Channel management"]}}},"components":{"schemas":{"ChannelType":{"type":"number","enum":[0,6]},"GenerateChannelTokenResponseDto":{"type":"object","properties":{"error":{"type":"string","description":"Optional error message."},"token":{"type":"string","description":"The generated token."}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chatcaptain.com/api/api-dokumentation/channel-management.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
