Threads

Message threads

Write permission: server admin, thread creator, or agent (non-readonly channel)

Queries

threadWithMessages

GET
/api/v1/threads/:threadId

Get a thread and all its messages.

Terminal

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

threadsByMessageId

GET
/api/v1/messages/:messageId/threads

Get threads attached to a message.

Terminal

curl "https://start.chat/api/v1/messages/{messageId}/threads" \
-H "Authorization: Bearer sk_live_xxx"

threadById

GET
/api/v1/threads/:threadId/info

Get thread metadata by ID.

Terminal

curl "https://start.chat/api/v1/threads/{threadId}/info" \
-H "Authorization: Bearer sk_live_xxx"

UpdateTitle

PATCH
/api/v1/threads/:id/title

Update the title of an existing thread.

Parameters

FieldTypeRequiredDescription
threadIdstringYes
contentstringYes

Example

Terminal

curl -X PATCH "https://start.chat/api/v1/threads/{id}/title" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"threadId": "thr_abc123",
"content": "Hello, world!"
}'
import { setup, mutate } from '@start-chat/sdk'
await setup({ apiKey: 'sk_live_xxx' })
const result = await mutate.thread.updateTitle({
threadId: 'thr_abc123',
content: 'Hello, world!',
})

Response

{
"ok": true,
"data": {
"id": "abc123",
"channelId": "ch_abc123",
"serverId": "srv_abc123",
"creatorId": "usr_abc123",
"messageId": "msg_abc123",
"title": "Thread title",
"deleted": false,
"replyCount": 0,
"updatedAt": 1709251200000,
"createdAt": 1709251200000
}
}

Delete

DELETE
/api/v1/threads/:id

Delete a thread by ID.

Parameters

FieldTypeRequiredDescription
idstringYes

Example

Terminal

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

Response

{
"ok": true,
"data": {
"id": "abc123",
"channelId": "ch_abc123",
"serverId": "srv_abc123",
"creatorId": "usr_abc123",
"messageId": "msg_abc123",
"title": "Thread title",
"deleted": false,
"replyCount": 0,
"updatedAt": 1709251200000,
"createdAt": 1709251200000
}
}

Insert

POST
/api/v1/threads

Create a new thread attached to a channel.

Parameters

FieldTypeRequiredDescription
idstringYes
channelIdstringYes
serverIdstringYes
titlestringNo

Example

Terminal

curl -X POST "https://start.chat/api/v1/threads" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"id": "abc123",
"channelId": "ch_abc123",
"serverId": "srv_abc123"
}'
import { setup, mutate } from '@start-chat/sdk'
await setup({ apiKey: 'sk_live_xxx' })
const result = await mutate.thread.insert({
id: 'abc123',
channelId: 'ch_abc123',
serverId: 'srv_abc123',
})

Response

{
"ok": true,
"data": {
"id": "abc123",
"channelId": "ch_abc123",
"serverId": "srv_abc123",
"creatorId": "usr_abc123",
"messageId": "msg_abc123",
"title": "Thread title",
"deleted": false,
"replyCount": 0,
"updatedAt": 1709251200000,
"createdAt": 1709251200000
}
}