Threads

Create thread

POST /api/channels/:channelId/threads
FieldTypeRequiredDescription
namestringYesThread name
parentMessageIdstringYesThe message to create a thread from
const thread = await client.createThread('channel-id', 'Discussion', 'parent-msg-id')
thread = client.create_thread("channel-id", "Discussion", "parent-msg-id")

List threads

GET /api/channels/:channelId/threads
const threads = await client.listThreads('channel-id')
threads = client.list_threads("channel-id")

Get thread

GET /api/threads/:id
const thread = await client.getThread('thread-id')
thread = client.get_thread("thread-id")

Update thread

PATCH /api/threads/:id
FieldTypeDescription
namestringUpdated thread name
const updated = await client.updateThread('thread-id', { name: 'New Name' })
updated = client.update_thread("thread-id", name="New Name")

Delete thread

DELETE /api/threads/:id
await client.deleteThread('thread-id')
client.delete_thread("thread-id")

Get thread messages

GET /api/threads/:id/messages
ParamTypeDefaultDescription
limitnumber50Max messages
cursorstringPagination cursor
const messages = await client.getThreadMessages('thread-id', 50)
messages = client.get_thread_messages("thread-id", limit=50)

Send to thread

POST /api/threads/:id/messages
FieldTypeDescription
contentstringMessage content
const msg = await client.sendToThread('thread-id', 'Thread reply!')
msg = client.send_to_thread("thread-id", "Thread reply!")