Pins

Pinned messages

Write permission: canEditChannel role or server admin

Delete

DELETE
/api/v1/pins/:id

Unpin a message.

Parameters

FieldTypeRequiredDescription
idstringYes

Example

Terminal

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

Response

{
"ok": true,
"data": {
"id": "abc123",
"serverId": "srv_abc123",
"channelId": "ch_abc123",
"messageId": "msg_abc123",
"creatorId": "usr_abc123",
"createdAt": 1709251200000
}
}

Insert

POST
/api/v1/pins

Pin a message in a channel.

Parameters

FieldTypeRequiredDescription
messageIdstringYes
channelIdstringYes
serverIdstringNo

Example

Terminal

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

Response

{
"ok": true,
"data": {
"id": "abc123",
"serverId": "srv_abc123",
"channelId": "ch_abc123",
"messageId": "msg_abc123",
"creatorId": "usr_abc123",
"createdAt": 1709251200000
}
}