X

X Chat API

Endpoints related to Chat encrypted messaging — 16 operation(s) in the X-published contract.

Operations 16

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /2/chat/conversations List my Chat inbox conversations · Get Chat Conversations #
Ask an LLM
“Which encrypted Chat conversations are in my inbox?”
“Can I page through all of my X Chat conversations?”
Tell an agent
List the conversations in my Chat inbox.
Show my {max_results} most recent Chat conversations.
POST /2/chat/conversations/group Create an encrypted Chat group · Create Chat Group Conversation #
Ask an LLM
“How do I finish creating an encrypted Chat group after initializing it?”
“Can I set a group name, description and admins when creating a Chat group?”
Tell an agent
Create Chat group {conversation_id} with members {group_members}, key version {conversation_key_version} and participant keys {conversation_participant_keys}.
Set up group {conversation_id} named {group_name} for {group_members} using keys {conversation_participant_keys} v{conversation_key_version}.
POST /2/chat/conversations/group/initialize Reserve an ID for a new Chat group · Initialize Chat Group #
Ask an LLM
“What's the first step to create a new Chat group conversation?”
“How do I get a conversation ID before configuring a group chat?”
Tell an agent
Initialize a new Chat group and give me its conversation ID.
Reserve a fresh group conversation ID for XChat.
GET /2/chat/conversations/{id} Get a Chat conversation's details · Get Chat Conversation #
Ask an LLM
“How can I see whether a Chat conversation is muted and who its admins are?”
“What metadata does a single Chat conversation expose?”
Tell an agent
Show the details of Chat conversation {id}.
Get Chat conversation {id} with its members expanded via {expansions}.
GET /2/chat/conversations/{id}/events Read messages in a Chat conversation · Get Chat Conversation Events #
Ask an LLM
“Where can I get the message history of a Chat conversation?”
“Can I see key change events alongside messages in an XChat thread?”
Tell an agent
Get the messages and key events in Chat conversation {id}.
Load the last {max_results} events from my Chat with {id}.
POST /2/chat/conversations/{id}/keys Initialize or rotate a Chat conversation key · Add Conversation Keys #
Ask an LLM
“What do I need to call before sending the first message in a new 1:1 encrypted chat?”
“How do I rotate the encryption key on an existing Chat conversation?”
Tell an agent
Set up encryption keys for Chat {id} at version {conversation_key_version} with {conversation_participant_keys}.
Rotate conversation {id}'s key to version {conversation_key_version} using participant keys {conversation_participant_keys}.
POST /2/chat/conversations/{id}/members Add members to a Chat group · Add members to a Chat group conversation #
Ask an LLM
“Can I invite more people into an existing encrypted group chat?”
“Does adding members to a Chat group rotate the conversation key?”
Tell an agent
Add users {user_ids} to Chat group {id}.
Bring {user_ids} into group conversation {id} with new key version {conversation_key_version}.
POST /2/chat/conversations/{id}/messages Send an encrypted Chat message · Send Chat Message #
Ask an LLM
“How do I send an encrypted message into an XChat conversation?”
“Can I send a 1:1 Chat message using just the recipient's user ID?”
Tell an agent
Send encrypted message {message_id} with payload {encoded_message_create_event} to Chat {id}.
Deliver the encoded Chat message {encoded_message_create_event} as {message_id} to recipient {id}.
POST /2/chat/conversations/{id}/messages/delete Delete messages from a Chat conversation · Delete Chat messages #
Ask an LLM
“How do I unsend Chat messages for everyone in the conversation?”
“Can I delete chat messages only from my own view?”
Tell an agent destructive · confirm first
Delete messages {sequence_ids} in Chat {id} using {delete_message_action} signed with {action_signatures}.
Remove Chat messages {sequence_ids} from conversation {id} for everyone ({delete_message_action}, signatures {action_signatures}).
POST /2/chat/conversations/{id}/read Mark a Chat conversation as read · Mark Conversation as Read #
Ask an LLM
“Is it possible to mark an XChat conversation read up to a certain message?”
“Can I clear the unread state on a Chat thread through the API?”
Tell an agent
Mark Chat {id} as read up to sequence {seen_until_sequence_id}.
Set conversation {id} read through message {seen_until_sequence_id}.
POST /2/chat/conversations/{id}/typing Show a typing indicator in Chat · Send Typing Indicator #
Ask an LLM
“Can I show the other person that I'm typing in a Chat conversation?”
“Can a bot send a typing indicator in XChat?”
Tell an agent
Send a typing indicator to Chat {id}.
Show that I'm typing in conversation {id}.
POST /2/chat/media/upload/initialize Start a Chat media upload · Initialize Chat Media Upload #
Ask an LLM
“How do I begin uploading an attachment to an XChat conversation?”
“What size information do I need to start a Chat media upload?”
Tell an agent
Start a Chat media upload of {total_bytes} bytes for conversation {conversation_id}.
Open an XChat upload session in {conversation_id} for a {total_bytes}-byte file.
POST /2/chat/media/upload/{id}/append Append a chunk to a Chat media upload · Append Chat Media Upload #
Ask an LLM
“What call sends the next chunk of an XChat attachment upload?”
“Which segment index should each Chat media chunk carry?”
Tell an agent
Append segment {segment_index} of {media} to Chat upload {id} in {conversation_id} with hash key {media_hash_key}.
Upload chunk {segment_index} ({media}) to XChat session {id}, conversation {conversation_id}, key {media_hash_key}.
POST /2/chat/media/upload/{id}/finalize Finish a Chat media upload · Finalize Chat Media Upload #
Ask an LLM
“How do I complete an XChat attachment upload after sending all chunks?”
“Can I set an expiry on Chat media when finalizing the upload?”
Tell an agent
Finalize Chat upload {id} in {conversation_id} with {num_parts} parts and hash key {media_hash_key}.
Close XChat upload {id} ({num_parts} parts, key {media_hash_key}) in {conversation_id} with TTL {ttl_msec}.
GET /2/chat/media/{id}/{media_hash_key} Download encrypted Chat media · Download Chat Media #
Ask an LLM
“How do I download an attachment someone sent me in XChat?”
“Does Chat media come back as raw encrypted bytes?”
Tell an agent
Download Chat media {media_hash_key} from conversation {id}.
Fetch the encrypted attachment bytes for {media_hash_key} in Chat {id}.
POST /2/users/{id}/public_keys Register a public key for Chat encryption · Add public key #
Ask an LLM
“How do I register my public key so others can send me encrypted Chat messages?”
“Can I publish a new version of my Chat encryption key?”
Tell an agent
Register public key {public_key} version {version} for user {id}.
Add Chat encryption key {public_key} as version {version} on {id}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/x:x-chat-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

x-chat-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: X API v2 core endpoints
  version: '2.168'
  title: X API v2 Chat API
  termsOfService: https://developer.x.com/en/developer-terms/agreement-and-policy.html
  contact:
    name: X Developers
    url: https://developer.x.com/
  license:
    name: X Developer Agreement and Policy
    url: https://developer.x.com/en/developer-terms/agreement-and-policy.html
servers:
- description: X API
  url: https://api.x.com
tags:


# --- truncated at 32 KB (104 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/x/refs/heads/main/openapi/x-chat-api-openapi.yml