Skip to main content
POST
/
2
/
chat
/
conversations
/
{id}
/
messages
Send Chat Message
curl --request POST \
  --url https://api.x.com/2/chat/conversations/{id}/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "encoded_message_create_event": "<string>",
  "message_id": "<string>",
  "conversation_token": "<string>",
  "encoded_message_event_signature": "<string>"
}
'
{
  "data": {
    "encoded_message_event": "<string>"
  },
  "errors": [
    {
      "title": "<string>",
      "type": "<string>",
      "detail": "<string>",
      "status": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

id
string
required

The recipient's user ID for a 1:1 conversation, or a group conversation ID (prefixed with 'g'). Identifies the conversation target. Accepts three formats: (1) a recipient user ID for 1:1 conversations (e.g., '1215441834412953600'), (2) a legacy 1:1 conversation ID with two user IDs separated by a dash (e.g., '1215441834412953600-1603419180975409153'), or (3) a group conversation ID prefixed with 'g' (e.g., 'g1234567890123456789'). The server constructs the canonical conversation ID from the authenticated user and recipient when a single user ID is provided.

Pattern: ^([0-9]{1,19}|[0-9]{1,19}-[0-9]{1,19}|g[0-9]{1,19})$
Example:

"1215441834412953600"

Body

application/json
encoded_message_create_event
string
required

Base64-encoded Thrift MessageCreateEvent containing encrypted message contents.

message_id
string
required

Unique identifier for this message.

conversation_token
string

Optional conversation token.

encoded_message_event_signature
string

Base64-encoded Thrift MessageEventSignature for message verification.

Response

The request has succeeded.

data
object
errors
object[]
Minimum array length: 1

An HTTP Problem Details object, as defined in IETF RFC 7807 (https://tools.ietf.org/html/rfc7807).