Initialize Conversation Keys
Initializes encryption keys for a Chat conversation. This is the first step before sending messages in a new 1:1 conversation.
For 1:1 conversations, provide the recipient’s user ID as the conversation_id. The server constructs the canonical conversation ID from the authenticated user and recipient.
The request body must contain the conversation key version and participant keys (the conversation key encrypted for each participant using their public key).
Workflow (1:1 conversation):
- Generate a conversation key using the SDK
- Encrypt the key for both participants using their public keys
- Call this endpoint to register the keys
- Send messages using
POST /chat/conversations/{id}/messages
Authentication:
- Requires OAuth 1.0a User Context or OAuth 2.0 User Context
- Required scopes:
tweet.read,users.read,dm.write
Documentation Index
Fetch the complete documentation index at: https://x-preview-mintlify-06c380b9.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
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.
^([0-9]{1,19}|[0-9]{1,19}-[0-9]{1,19}|g[0-9]{1,19})$"1215441834412953600"
Body
Version of the conversation encryption key (typically a timestamp in milliseconds).
The conversation key encrypted for each participant using their public key.
Cryptographic signatures for the key initialization action.
Base64-encoded key rotation payload for ratchet tree key management.
Response
The request has succeeded.
1An HTTP Problem Details object, as defined in IETF RFC 7807 (https://tools.ietf.org/html/rfc7807).
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
- Option 17
- Option 18