Messages
Send, edit, and delete messages
Write permission: server admin, moderator, or message creator (non-readonly channel)
Queries
channelMessages
GET
/api/v1/channels/:channelId/messages
Fetch messages in a channel. Supports cursor-based pagination, filtering, and limit control.
curl "https://start.chat/api/v1/channels/{channelId}/messages" \
-H "Authorization: Bearer sk_live_xxx"
messageById
GET
/api/v1/messages/:messageId
Get a single message by ID.
curl "https://start.chat/api/v1/messages/{messageId}" \
-H "Authorization: Bearer sk_live_xxx"
pinnedMessagesPage
GET
/api/v1/channels/:channelId/pins
Get pinned messages in a channel with pagination.
curl "https://start.chat/api/v1/channels/{channelId}/pins" \
-H "Authorization: Bearer sk_live_xxx"
Save
PATCH
/api/v1/messages/:id
Edit a message. Updates the content and marks it as edited.
Parameters
Example
curl -X PATCH "https://start.chat/api/v1/messages/{id}" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"id": "abc123",
"content": "Hello, world!"
}'
import { setup, mutate } from '@start-chat/sdk'
await setup({ apiKey: 'sk_live_xxx' })
const result = await mutate.message.save({
id: 'abc123',
content: 'Hello, world!',
})
Response
{
"ok": true,
"data": {
"id": "abc123",
"serverId": "srv_abc123",
"type": "person",
"channelId": "ch_abc123",
"isThreadReply": false,
"creatorId": "usr_abc123",
"content": "Hello, world!",
"createdAt": 1709251200000,
"updatedAt": 1709251200000,
"deleted": false
}
}
Delete
DELETE
/api/v1/messages/:id
Permanently delete a message by ID.
Parameters
Example
curl -X DELETE "https://start.chat/api/v1/messages/{id}" \
-H "Authorization: Bearer sk_live_xxx"
import { setup, mutate } from '@start-chat/sdk'
await setup({ apiKey: 'sk_live_xxx' })
const result = await mutate.message.delete({
id: 'abc123',
})
Response
{
"ok": true,
"data": {
"id": "abc123",
"serverId": "srv_abc123",
"type": "person",
"channelId": "ch_abc123",
"isThreadReply": false,
"creatorId": "usr_abc123",
"content": "Hello, world!",
"createdAt": 1709251200000,
"updatedAt": 1709251200000,
"deleted": false
}
}
Send
Send a message to a channel. Optionally target a thread or reply to another message.
Parameters
Example
curl -X POST "https://start.chat/api/v1/messages" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"channelId": "ch_abc123",
"content": "Hello, world!",
"serverId": "srv_abc123"
}'
import { setup, mutate } from '@start-chat/sdk'
await setup({ apiKey: 'sk_live_xxx' })
const result = await mutate.message.send({
channelId: 'ch_abc123',
content: 'Hello, world!',
serverId: 'srv_abc123',
})
Response
{
"ok": true,
"data": {
"id": "abc123",
"serverId": "srv_abc123",
"type": "person",
"channelId": "ch_abc123",
"isThreadReply": false,
"creatorId": "usr_abc123",
"content": "Hello, world!",
"createdAt": 1709251200000,
"updatedAt": 1709251200000,
"deleted": false
}
}