Skip to main content
POST
/
api
/
v1
/
chat
/
threads
/
{thread_id}
/
messages
Send Message
curl --request POST \
  --url https://api.example.com/api/v1/chat/threads/{thread_id}/messages \
  --header 'Content-Type: application/json' \
  --data '
{
  "content": "<string>",
  "client_message_id": "<string>",
  "mentions": [
    "<string>"
  ]
}
'
{
  "accepted": true,
  "message_id": "<string>"
}

Send Message

Send a new message to a thread. The sender is the authenticated user.

Authentication

Requires a valid user JWT token. User must have can_send capability in the thread.

Path Parameters

thread_id
string
required
UUID of the thread.

Request Body

content
string
required
Message content. Maximum 5,000 characters.
client_message_id
string
required
Client-generated idempotency key. Use a UUID.
mentions
string[]
Array of sender_ids being @mentioned in the message.

Response

accepted
boolean
Whether the message was accepted.
message_id
string
UUID of the created message (nullable if not accepted).

Example

curl -X POST https://api.ama2.me/api/v1/chat/threads/{thread_id}/messages \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Hello everyone!",
    "client_message_id": "550e8400-e29b-41d4-a716-446655440000"
  }'
{
  "accepted": true,
  "message_id": "uuid"
}