CEEJAYDocs

List channels

List your server's channels and categories, to find the channelId Send a message needs.

GET /v1/channels · requires messages:send

It takes no parameters.

Returns

data is a list of channels and categories, in Discord's order. The whole list is returned in one response, so page.nextCursor is always null and page.limit is the number of entries.

Prop

Type

Example

Request
curl "https://ceejay.communitystudios.xyz/api/v1/channels" \
  -H "Authorization: Bearer $CEEJAY_API_KEY"

The TypeScript tab calls ceejay.channels.list from the TypeScript SDK. It returns the whole response below, with the list in data.

200 OK
{
  "success": true,
  "data": [
    {
      "channelId": "718230049827100300",
      "name": "Community",
      "type": "category",
      "parentId": null,
      "position": 0,
      "private": false,
      "sendable": false
    },
    {
      "channelId": "718230049827100384",
      "name": "announcements",
      "type": "announcement",
      "parentId": "718230049827100300",
      "position": 0,
      "private": false,
      "sendable": true
    },
    {
      "channelId": "718230049827100391",
      "name": "game-log",
      "type": "text",
      "parentId": "718230049827100300",
      "position": 1,
      "private": true,
      "sendable": true
    }
  ],
  "page": {
    "nextCursor": null,
    "limit": 3
  }
}

What is listed

Text channels, announcement channels, forum channels and categories. Voice channels, stage channels and threads are left out.

  • sendable is true for a text or an announcement channel: the kinds Send a message can post to. It does not say that the bot has permission in that channel: the bot needs View Channel and Send Messages there, and posting to a channel where it has neither returns 404 or 403.
  • private is true for a channel whose own permission settings hide it from @everyone. A private channel is listed by name and marked, because the channel a game logs to is usually private.

CEEJAY reads the list from Discord and caches it for up to a minute. A failed read is an error, never an empty list.

The list never returns topics, permission settings, last message IDs, the age-restricted flag, slow-mode settings or members.

Errors

StatuscodeerrorWhen
429discord_rate_limitedDiscord API rate limited, try again laterDiscord is rate limiting the bot. retryAfter and the Retry-After header carry Discord's wait, in whole seconds, when Discord gave one. Do not retry in a tight loop
500discord_not_configuredThis instance cannot reach Discord yetThis instance has no connection to Discord yet
503channels_unavailableCould not read this server's channels from DiscordThe server's channels could not be read from Discord, so nothing is listed. Retry with a pause between attempts

Every error body also carries requestId, and a 400 with the code bad_request names the invalid field in field. Match on code, not on the message text, which can change.

The errors every request shares (401, 403, 405, 429, 500) are on the Errors page.

On this page

Community StudiosPrivacyTerms