Overview
The Channels API allows you to create, update, and delete channels in your organization. Channels can be public, private, direct messages (DMs), group messages, or threads. All channel operations require authentication and appropriate permissions.Channel Types
- public - Visible to all organization members
- private - Only visible to invited members
- direct - Group direct message with multiple participants
- single - One-on-one direct message between two users
- thread - Conversation thread attached to a message
Methods
channel.create
Creates a new channel in an organization. The current user is automatically added as a member of the channel.Channel name
Channel type:
public, private, thread, direct, or singleUUID of the organization
Channel icon/emoji
Parent channel ID (for threads)
Section ID to organize the channel
Optional client-provided ID for optimistic updates
If true, automatically adds all organization members to the channel
Transaction ID for optimistic updates
UnauthorizedError- User lacks permission to create channelsInternalServerError- Unexpected server error
channel.update
Updates an existing channel. Only users with appropriate permissions can update a channel.Channel ID to update
New channel name
New channel icon/emoji
Move channel to a different section
Updated channel object (see channel.create for structure)
Transaction ID for optimistic updates
ChannelNotFoundError- Channel doesn’t existUnauthorizedError- User lacks permission to update channelInternalServerError- Unexpected server error
channel.delete
Deletes a channel (soft delete). Only users with appropriate permissions can delete a channel.Channel ID to delete
Transaction ID for optimistic updates
ChannelNotFoundError- Channel doesn’t existUnauthorizedError- User lacks permission to delete channelInternalServerError- Unexpected server error
channel.createDm
Creates a direct message or group channel with specified participants. For single DMs, automatically checks if a DM already exists between users. All participants are automatically added as channel members.Array of user IDs to include in the DM (excluding yourself)
single- One-on-one DM (must have exactly 1 participant)direct- Group DM (can have multiple participants)
UUID of the organization
Optional custom name for the DM channel (auto-generated for single DMs)
Created DM channel object
Transaction ID for optimistic updates
DmChannelAlreadyExistsError- DM already exists (for single type)UnauthorizedError- User lacks permissionInternalServerError- Unexpected server error or invalid participant count
channel.createThread
Ensures a thread channel exists for a message and returns it. If a thread already exists, it is returned. Otherwise this atomically creates the thread channel, adds the creator as a member, and links the original message to the thread.ID of the message to create a thread for
Optional organization ID (must match message’s parent channel organization)
Optional client-provided channel ID for optimistic updates
Thread channel object
Transaction ID for optimistic updates
MessageNotFoundError- Message doesn’t existNestedThreadError- Cannot create thread from a message that’s already in a threadUnauthorizedError- User lacks permissionInternalServerError- Unexpected server error
channel.generateName
Generates an AI-powered name for a thread channel. Uses the ThreadNamingWorkflow to analyze the thread conversation and generate a descriptive 3-6 word name.Thread channel ID to generate a name for
Whether the name generation was initiated successfully
ChannelNotFoundError- Channel doesn’t exist or is not a threadMessageNotFoundError- Original message not foundUnauthorizedError- User lacks permissionWorkflowServiceUnavailableError- Cannot connect to workflow serviceThreadChannelNotFoundError- Thread channel not found in workflowOriginalMessageNotFoundError- Original message not found in workflowThreadContextQueryError- Database query failed in workflowAIProviderUnavailableError- AI service is unreachableAIRateLimitError- AI service rate limit exceededAIResponseParseError- AI response cannot be parsedThreadNameUpdateError- Database update failed in workflowInternalServerError- Unexpected server error