> For the complete documentation index, see [llms.txt](https://docs.epic-ai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.epic-ai.com/api-dokumentation/channel-management.md).

# 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)."},"microsoftExchangeConfig":{"description":"Microsoft Exchange configuration (only present for microsoft-exchange channels).","allOf":[{"$ref":"#/components/schemas/MicrosoftExchangeConfigDto"}]}},"required":["id","name","status","token","type","created","updated","tokenValidUntil","chatbotId","environment","domains","providerId"]},"MicrosoftExchangeConfigDto":{"type":"object","properties":{"tenantId":{"type":"string","description":"The Azure AD tenant ID that granted admin consent."},"expiredAt":{"type":"string","description":"The expiry timestamp of the access token (ISO format)."},"token":{"type":"string","description":"The access token for the Microsoft Exchange mailbox."},"mailboxAddress":{"type":"string","description":"The mailbox address being monitored."},"subscriptionId":{"type":"string","description":"The Microsoft Graph subscription ID for change notifications."},"subscriptionExpiredAt":{"type":"string","description":"The expiry timestamp of the Graph subscription (ISO format)."},"clientState":{"type":"string","description":"The client state secret used to validate incoming Graph notifications."}}}}}}
```

## 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."}}}}}}
```
