List integration channels
List the chat channels in the community that owns your API key, with each channel's ID, name and type.
- Method
- GET
- Path
https://api.returning.ai / v1/ channels - Permission
- None
- Retries
- Read-only; exact retries are safe
When to use this
- You need a channel ID before you read, send or reply to messages.
- You want to show your team which channels exist, in the order the community shows them.
- An admin added a channel and you want its ID.
Authentication#
- Header
Authorization: Bearer <API_KEY>- Permission
- NoneAny Community API key for this community works
Send a Community API key as Authorization: Bearer <API_KEY>, and keep it on your server. No specific permission is needed. The key decides the community, so you only see that community's channels and never send a community ID.
Request#
Headers#
RuleBearer <API_KEY>
curl --request GET \
--url https://api.returning.ai/v1/channels \
--header 'Authorization: Bearer <API_KEY>'
Response#
A 200 returns every channel in data, in the order the community lists them. There is no paging. Each channel has only _id, topic and channelType; member lists and channel settings aren't included.
Rulesuccess
Eg"Get channels list successfully"
Eg[ ... ]
channel_id to Get Messages and as channelId to Send Message.Eg"66f000000000000000000a11"
Eg"general"
open.Eg"open"
{
"status": "success",
"message": "Get channels list successfully",
"data": [
{
"_id": "66f000000000000000000a11",
"topic": "general",
"channelType": "open"
},
{
"_id": "66f000000000000000000a12",
"topic": "trading-ideas",
"channelType": "open"
}
]
}
Errors#
Errors on this endpoint have no machine-readable code. Branch on the HTTP status, and read message for the reason.
Fix the request01
message says which: Invalid token (no Authorization header), Invalid API key (unknown key) or API key expired. Send Authorization: Bearer <API_KEY> with a current key.Retry with backoff01
Authentication failed). Retry the same request with exponential backoff.{
"status": "error",
"message": "Invalid API key"
}