Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ keywords: ["changelog", "API updates", "release notes", "what's new", "API chang

To subscribe to updates, please [**“Turn on notifications”**](https://help.x.com/en/managing-your-account/notifications-on-mobile-devices#:~:text=In%20the%20top%20menu,%20you,you%20would%20like%20to%20receive) for [**@API**](https://x.com/api). You can also follow this changelog in your feed reader via the [**RSS feed**](https://docs.x.com/changelog/rss.xml).

<Update label="Dec 4, 2026" description="SDKs">
### Send-side CTA buttons (`ctas`) in Chat XDK (`v0.7.13`)

All **Chat XDK** bindings (Rust, Python, JavaScript/WASM, Go, .NET, JVM, Ruby, and the C ABI) now support sending web-URL call-to-action buttons (`ctas`) on regular encrypted messages and replies via `encrypt_message` and `encrypt_reply`:

- **Typed `CallToAction` buttons:** Pass `ctas` as a list of `{ label, url }` objects matching decrypted `content.ctas` (and typing `TextContent.CTAs` in Go and `MessageContent.ctas` in TypeScript), so received CTAs can be round-tripped unchanged.
- **Input validation:** Entries with missing, empty, or whitespace-only `label` or `url` fail with `InvalidInput`; omitting `ctas` or passing an empty list omits the field on the wire.

See [Chat XDK](/xchat/xchat-xdk#encrypt-and-send-helpers) and [Migrate from Legacy DMs](/xchat/migrate-from-legacy-dms).
</Update>

<Update label="Dec 4, 2026" description="X API v2">
### Strict `x-api-minor-version` validation and supported-version hints

Expand Down
3 changes: 1 addition & 2 deletions xchat/migrate-from-legacy-dms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Every `/2/chat/*` and `/2/users/*/public_keys` route requires **user-context aut
|:---------------------|:-------------------|
| `GET /1.1/direct_messages/events/list.json` | `GET /2/chat/conversations` + `GET /2/chat/conversations/{id}/events` |
| `GET /1.1/direct_messages/events/show.json` | *No equivalent* — page conversation events |
| `POST /1.1/direct_messages/events/new.json` | `POST /2/chat/conversations/{id}/keys` (first contact) + `POST /2/chat/conversations/{id}/messages` (Chat XDK supports `quick_reply` in encrypted message content; no send-side CTA API) |
| `POST /1.1/direct_messages/events/new.json` | `POST /2/chat/conversations/{id}/keys` (first contact) + `POST /2/chat/conversations/{id}/messages` (Chat XDK supports `quick_reply` and `ctas` in encrypted message content; see [Chat XDK](/xchat/xchat-xdk#encrypt-and-send-helpers)) |
| `DELETE /1.1/direct_messages/events/destroy.json` | `POST /2/chat/conversations/{id}/messages/delete` |
| `POST /1.1/direct_messages/indicate_typing.json` | `POST /2/chat/conversations/{id}/typing` (empty body) |
| `POST /1.1/direct_messages/mark_read.json` | `POST /2/chat/conversations/{id}/read` (empty body marks up to newest; pass `action_signatures` to target a specific event — fields like `seen_until_sequence_id` are ignored) |
Expand Down Expand Up @@ -206,7 +206,6 @@ Every `/2/chat/*` and `/2/users/*/public_keys` route requires **user-context aut
| **Single-event lookup by ID** (`GET /2/dm_events/{id}`, v1.1 `events/show.json`) | Persist events keyed by sequence `id` / `message_id` and `conversation_id` as they arrive, or page the conversation. |
| **Custom profiles** (`custom_profiles/*`) | No equivalent. |
| **Server-side plaintext processing without keys** | Keyword search, moderation, analytics, archiving, and LLM processing only work where private keys are legitimately held (see [Key custody and B2B key storage](#4-key-custody-and-b2b-key-storage)). |
| **Send-side CTAs** | No documented send-side CTA API (`quick_reply` is supported in the Chat XDK content model). |
| **Messaging accounts without X Chat keys** | Recipients without X Chat keys cannot receive encrypted messages (and nothing falls back to unencrypted). |
</Tab>
</Tabs>
Expand Down
8 changes: 4 additions & 4 deletions xchat/xchat-xdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,9 @@ Verification is mandatory by default: omitting signing keys never skips it. With

## Encrypt and send helpers

**`encrypt_message(conversation_id, text)`** builds the signed ciphertext for a text message; optional `entities`, `attachments` (via `media_hash_key`), `quick_reply`, `should_notify`, and `ttl_msec`. Encrypted message payloads are capped at **20 KB** (~11,000 UTF-8 plaintext bytes). The sender identity resolves from the session (`set_identity`) and the conversation key from the opt-in key cache (`set_cache_keys`), or pass `sender_id` / `signing_key_version` and `conversation_key` + `conversation_key_version` explicitly. The SDK generates the **`message_id`** (a UUID embedded in the signed event) and returns it on the payload. Never mint your own; reuse the same payload on retries so an id is never minted twice. Map the payload into the send-message body: `message_id` → **`message_id`**, `encrypted_content` → **`encoded_message_create_event`**, `encoded_event_signature` → **`encoded_message_event_signature`**.
**`encrypt_message(conversation_id, text)`** builds the signed ciphertext for a text message; optional `entities`, `attachments` (via `media_hash_key`), `quick_reply`, `ctas`, `should_notify`, and `ttl_msec`. Encrypted message payloads are capped at **20 KB** (~11,000 UTF-8 plaintext bytes). The sender identity resolves from the session (`set_identity`) and the conversation key from the opt-in key cache (`set_cache_keys`), or pass `sender_id` / `signing_key_version` and `conversation_key` + `conversation_key_version` explicitly. The SDK generates the **`message_id`** (a UUID embedded in the signed event) and returns it on the payload. Never mint your own; reuse the same payload on retries so an id is never minted twice. Map the payload into the send-message body: `message_id` → **`message_id`**, `encrypted_content` → **`encoded_message_create_event`**, `encoded_event_signature` → **`encoded_message_event_signature`**.

**Quick replies and clickable URLs.** Pass `quick_reply` on `encrypt_message` or `encrypt_reply` (supported across all bindings since v0.5.1) with either a `request` (`options: { id, options: [{ id, label, metadata, description }] }`) to present selectable choices, or a `response` (`options: { request_id, metadata, selected_option_id }`) when answering one; user selections arrive in decrypted `content.quick_reply` (`quickReply` in JS). The SDK does **not** auto-extract URLs or mentions from `text`: to make links clickable in X Chat clients, pass explicit `entities` (`"url"`, `"mention"`, etc.) with **UTF-8 byte offsets** (`start` inclusive, `end` exclusive — `EntityDescriptor` in Rust/.NET/JVM/Ruby, `[start, end, type]` tuples in Python/JS/Go).
**Quick replies, CTA buttons, and clickable URLs.** Pass `quick_reply` on `encrypt_message` or `encrypt_reply` (supported across all bindings since v0.5.1) with either a `request` (`options: { id, options: [{ id, label, metadata, description }] }`) to present selectable choices, or a `response` (`options: { request_id, metadata, selected_option_id }`) when answering one; user selections arrive in decrypted `content.quick_reply` (`quickReply` in JS). Pass `ctas` on `encrypt_message` or `encrypt_reply` (supported across all bindings since v0.7.13) to attach web-URL call-to-action buttons (`CallToAction` entries with non-empty `label` and `url`); decrypted messages return the same shape in `content.ctas`, and entries with missing, empty, or whitespace-only `label` or `url` fail with `InvalidInput`. The SDK does **not** auto-extract URLs or mentions from `text`: to make links clickable in X Chat clients, pass explicit `entities` (`"url"`, `"mention"`, etc.) with **UTF-8 byte offsets** (`start` inclusive, `end` exclusive — `EntityDescriptor` in Rust/.NET/JVM/Ruby, `[start, end, type]` tuples in Python/JS/Go).

**Replies are event-based.** `encrypt_reply(conversation_id, text, reply_to_event)` takes the base64 raw event being replied to. The SDK derives the quoted preview (sequence id, sender, text, entities, attachments) from it and embeds the signed original in the outgoing message so recipients can validate the quote. Pass `reply_to_ckces` (the raw key-change events) when the original was encrypted under an older key version than the reply. When the original was **edited**, pass the raw edit event as `reply_to_edit_event`: the preview then quotes what the message says now (its text and entities come from the edit), and the edit travels alongside the original for the receiver to check. The explicit `reply_to_*` fields remain as overrides for callers that no longer hold the raw event.

Expand All @@ -678,7 +678,7 @@ The conversation id passed to `encrypt_message` / `encrypt_reply` can be any for
```python
payload = chat.encrypt_message(
conversation_id, "Hello",
# Optional keyword args: entities, attachments, quick_reply, should_notify, ttl_msec
# Optional keyword args: entities, attachments, quick_reply, ctas, should_notify, ttl_msec
)
body = {
"message_id": payload.message_id,
Expand All @@ -704,7 +704,7 @@ The conversation id passed to `encrypt_message` / `encrypt_reply` can be any for
const payload = chat.encryptMessage({
conversationId,
text: 'Hello',
// Optional: entities, attachments, quickReply, shouldNotify, ttlMsec
// Optional: entities, attachments, quickReply, ctas, shouldNotify, ttlMsec
});
const body = {
message_id: payload.messageId,
Expand Down
Loading