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
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.
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.
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}.
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}).
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}.
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}.
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}.
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}.
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}.
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}.