Skip to content

Post a message

POST
/channels/{channel}/messages
curl --request POST \
--url https://desk.example.com/api/v1/channels/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "body": "Deploy finished ✅", "client_uuid": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "reply_to_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "thread_root_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "sent_to_channel": false }'

Required scope: messages:write

Posts a message to the channel as the token’s subject. Supply client_uuid to make the call idempotent: resending the same uuid resolves to the message already created rather than a duplicate.

channel
required
string format: uuid

The channel’s id.

Media typeapplication/json
object
body
required

The message text. Surrounding whitespace is trimmed.

string
<= 8000 characters
client_uuid

An idempotency key you generate. One is generated for you when omitted.

string | null format: uuid
reply_to_id

The id of a live standard message in this channel to reply to inline.

string | null format: uuid
thread_root_id

The id of a live standard message in this channel to reply to in a thread. The target must not itself be a thread reply — threads are one level deep.

string | null format: uuid
sent_to_channel

Whether a thread reply is also echoed into the channel.

boolean

The message was posted.

Media typeapplication/json
object
data
required
object
id
required
string format: uuid
channel_id
required
string format: uuid
body
required
string
type
required

standard is an authored message; member_joined and member_left are system notices the app writes itself.

string
Allowed values: standard member_joined member_left poll
author
required

A workspace member, human or bot.

object
id
required
string format: uuid
name
required
string
type
required
string
Allowed values: human bot
reply_to_id
required
string | null format: uuid
thread_root_id
required
string | null format: uuid
reactions
required
Array<object>

One emoji and how many members reacted with it.

object
emoji
required
string
count
required
integer
>= 1
created_at
required
string | null format: date-time
edited_at
required

Null until the message is edited.

string | null format: date-time
Example
{
"data": {
"type": "standard",
"author": {
"type": "human"
}
}
}

The token is missing, malformed, or revoked.

Media typeapplication/json

The shape every error response carries.

object
message
required
string
Examplegenerated
{
"message": "example"
}

The token lacks the scope this operation requires, or its subject may see the resource but not perform this action on it.

Media typeapplication/json

The shape every error response carries.

object
message
required
string
Examplegenerated
{
"message": "example"
}

The resource does not exist, is outside the token’s workspace, or the integrations platform is disabled. A channel the subject cannot see is reported here rather than as a 403, so the API never leaks its existence.

Media typeapplication/json

The shape every error response carries.

object
message
required
string
Examplegenerated
{
"message": "example"
}

The request body failed validation.

Media typeapplication/json
object
message
required
string
errors
required

The failing fields, each mapped to its messages.

object
key
additional properties
Array<string>
Examplegenerated
{
"message": "example",
"errors": {
"additionalProperty": [
"example"
]
}
}

The per-token rate limit (INTEGRATIONS_API_RATE_LIMIT requests per minute) was exceeded. Retry after the Retry-After header.

Media typeapplication/json

The shape every error response carries.

object
message
required
string
Examplegenerated
{
"message": "example"
}
Retry-After
integer

Seconds to wait before retrying.