Channels

Create and manage channels

Write permission: server creator, admin, or canEditChannel/canEditServer role

Queries

channelsByServer

GET
/api/v1/servers/:serverId/channels

List all channels in a server.

Terminal

curl "https://start.chat/api/v1/servers/{serverId}/channels" \
-H "Authorization: Bearer sk_live_xxx"

channelById

GET
/api/v1/channels/:channelId

Get channel details by ID.

Terminal

curl "https://start.chat/api/v1/channels/{channelId}" \
-H "Authorization: Bearer sk_live_xxx"

Update

PATCH
/api/v1/channels/:id

Update channel properties (name, description, etc.).

Parameters

FieldTypeRequiredDescription
idstringYes
namestringNo
descriptionstringNo

Example

Terminal

curl -X PATCH "https://start.chat/api/v1/channels/{id}" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"id": "abc123"
}'
import { setup, mutate } from '@start-chat/sdk'
await setup({ apiKey: 'sk_live_xxx' })
const result = await mutate.channel.update({
id: 'abc123',
})

Response

{
"ok": true,
"data": {
"id": "abc123",
"serverId": "srv_abc123",
"name": "general",
"description": "A description",
"creatorId": "usr_abc123",
"private": false,
"readonly": false,
"deleted": false,
"isPrivateChat": false,
"updatedAt": 1709251200000,
"createdAt": 1709251200000
}
}

Delete

DELETE
/api/v1/channels/:id

Delete a channel and all its contents.

Parameters

FieldTypeRequiredDescription
idstringYes

Example

Terminal

curl -X DELETE "https://start.chat/api/v1/channels/{id}" \
-H "Authorization: Bearer sk_live_xxx"
import { setup, mutate } from '@start-chat/sdk'
await setup({ apiKey: 'sk_live_xxx' })
const result = await mutate.channel.delete({
id: 'abc123',
})

Response

{
"ok": true,
"data": {
"id": "abc123",
"serverId": "srv_abc123",
"name": "general",
"description": "A description",
"creatorId": "usr_abc123",
"private": false,
"readonly": false,
"deleted": false,
"isPrivateChat": false,
"updatedAt": 1709251200000,
"createdAt": 1709251200000
}
}

Insert

POST
/api/v1/channels

Create a new channel in a server.

Parameters

FieldTypeRequiredDescription
namestringYes
serverIdstringYes
descriptionstringYes

Example

Terminal

curl -X POST "https://start.chat/api/v1/channels" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"name": "general",
"serverId": "srv_abc123",
"description": "A description"
}'
import { setup, mutate } from '@start-chat/sdk'
await setup({ apiKey: 'sk_live_xxx' })
const result = await mutate.channel.insert({
name: 'general',
serverId: 'srv_abc123',
description: 'A description',
})

Response

{
"ok": true,
"data": {
"id": "abc123",
"serverId": "srv_abc123",
"name": "general",
"description": "A description",
"creatorId": "usr_abc123",
"private": false,
"readonly": false,
"deleted": false,
"isPrivateChat": false,
"updatedAt": 1709251200000,
"createdAt": 1709251200000
}
}