-- **Never set up X Chat (`GET /2/users/{id}/public_keys` returns no keys):** You can create a new keypair for the account through the API and save it. Have the admin choose the account's PIN in your connect flow rather than picking one for them, so the business can still use X Chat in the X app later.
-- **Already uses X Chat, but the admin doesn't know the PIN:** Do **not** replace existing keys silently. If the customer authorizes it and understands the trade-off, you can create and register a new keypair through the API (have the admin choose a new PIN in your connect flow so they can also use X Chat in the X app), or the admin can reset their PIN in the X app. Either way, registering new keys replaces the account's previous identity and makes messages encrypted under the old keys unreadable.
+For **enterprise apps**, customers never need to know or share their PIN to connect your app. Connecting through standard OAuth with DM access is all that is required — no PIN prompt, key export, or key replacement is needed. Never generate or replace X Chat keys on a customer's account.
Older unencrypted DMs do not need keys at all.
@@ -180,7 +199,7 @@ Older unencrypted DMs do not need keys at all.
How do I check whether an account already has keys or can receive encrypted chats?
-Call `GET /2/users/{id}/public_keys` (or batch `GET /2/users/public_keys?ids=...`). If key backup details are returned, the account already uses X Chat — recover the existing keys with the PIN, or only create new keys with the customer's explicit approval (replacing keys makes messages encrypted under the old keys unreadable).
+Call `GET /2/users/{id}/public_keys` (or batch `GET /2/users/public_keys?ids=...`) to check whether an account has registered X Chat public keys and to fetch current public keys for conversation key setup or rotation.
To check whether you can start an encrypted chat with someone, request `GET /2/users/{id}?user.fields=receives_your_chat` with the sending account's token: `encrypted` means you can, `unencrypted` means the pair cannot be encrypted yet, and `none` means you cannot message them.
@@ -189,39 +208,54 @@ To check whether you can start an encrypted chat with someone, request `GET /2/u
Is there a limit on wrong PIN guesses?
-**Yes.** Secure key backup allows only a small number of wrong guesses, and that budget cannot be reset. If it runs out, the backup is deleted and older encrypted messages become unreadable. Ask the account owner to confirm their PIN in the X app first, and stop after one wrong attempt.
+**Yes**, though **enterprise apps using the app-owner key model never ask customers for a PIN**. This limit only applies if you call secure key backup `unlock(pin)` directly (for example, to recover your own app-owner account's keys from backup, or in a non-enterprise client app).
-Unlock once per account and reuse the result — do not unlock per message or per request. Unlocks have a separate rate limit (about 30 per minute per IP address), independent of X API rate limits.
+Secure key backup allows only a small number of wrong guesses, and that budget cannot be reset. If it runs out, the backup is deleted and older encrypted messages under those keys become unreadable. Stop after one wrong attempt and never auto-retry. Unlocks also have a separate rate limit (about 30 per minute per IP address), independent of X API rate limits — unlock once and reuse the result rather than unlocking per message or per request.
When a recipient changes their PIN or someone is added to a group chat, do we need to do anything?
-**No.** The conversation key updates automatically, and you do not need to redo conversation key setup.
+Changing a PIN does not change encryption keys, so no action is needed. When someone is added to a group chat or a participant's keys change, the conversation key rotates.
+
+If your enterprise app needs to rotate a conversation key in order to send (for example, after a participant's key changes), include **every participant's current key plus the owner keys of any other connected enterprise apps** (on both your customer's account and the other participant's account). Leaving another connected app's owner key out will cut that app off from new messages.
Do I need X's approval to store keys on my servers?
-**Yes.** Storing customers' keys on your servers requires approval from X. All of the following must be true:
-
-- Your customers are businesses or organizations, not individual consumers.
-- You run a business messaging or automation tool on their behalf.
-- Your customers knowingly give you their key material.
-- Each customer's keys are used only for that customer's own X Chat account.
-- You tell customers, in your product or contract, that keys are separate from sign-in access and that revoking your app's access does not revoke keys they already shared.
-- Your contract with each customer covers how you store and protect keys, who can access them, breach notice, and deleting or returning keys when the relationship ends.
+**Not for customer keys — under the enterprise app-owner key model, you do not store customers' private keys or PINs at all.** You only store the private key for **your own app-owner X account** on your servers (protect it in a KMS, HSM, or secret manager with strict access controls).
-To start the review, send your X account representative a Yes or No for each point above along with a short description of how your product uses X DMs.
+Non-enterprise apps must not collect or store end users' PINs or private keys on a server — run `chat-xdk` on-device instead.
If a customer revokes my app's access, are the keys revoked too?
-**No.** Revoking access only stops your app's API tokens; keys a customer already shared keep working. When a customer leaves, delete every copy and backup of their keys and instruct them to revoke your app's access and run **Reset Chat** in the X app. Reset Chat is the only way to invalidate previously shared keys — there is no app-level key revocation today.
+For **enterprise apps**, **yes for all future messages — automatically.** When a customer disconnects your app (revokes OAuth access), X Chat rotates the customer's conversation keys immediately and excludes your app's owner key. Your app retains access to messages from before the disconnect, but cannot read anything sent after — and the customer does **not** need to run **Reset Chat**.
+
+(For non-enterprise apps where an account's own private keys were exported or shared directly, revoking OAuth stops API tokens only and does not revoke those keys — **Reset Chat** is still required in that case.)
+
+
+
+
+
What happens if a customer connects more than one enterprise app?
+
+Multiple enterprise apps can be connected to the same customer account at the same time without conflicting over a shared PIN or overwriting the customer's keys. Each enterprise app has its own app-owner key pair, and conversation keys are wrapped to each participant's current key **plus** the owner keys of every connected enterprise app (on both sides of the conversation).
+
+When your app rotates a conversation key (for example, when replacing your owner key or sending after a participant's key changes), always include every participant's current key and the owner keys of all other connected enterprise apps so none of them lose access.
+
+
+
+
+
What happens if we lose or need to replace our app-owner key?
+
+Create a new X Chat key pair for your app-owner account, register it, and rotate your connected customers' conversations so the new conversation keys are encrypted to your new public key (keeping each participant's current key and any other connected enterprise apps' owner keys).
+
+Messages encrypted to the old app-owner key can no longer be read once that key is lost, so store your app-owner private key in a hardened KMS, HSM, or secret manager with backup and access controls.
@@ -235,21 +269,23 @@ X is reviewing this with its policy team and will update this answer.
If we pause our DM integration for a while, can we read those messages later?
-**Yes**, as long as you still have the keys needed to decrypt them and the account has not run Reset Chat or reset a forgotten PIN in the meantime. You can fetch history later while the account is still in the conversation. If you cannot stay subscribed, store the encrypted events (including the conversation key-change events on each page) and decrypt them later.
+**Yes**, as long as the customer remained connected to your app during that period and you still have your app-owner private key. You can fetch history later while the customer is still in the conversation (or store the encrypted events, including the conversation key-change events on each page, and decrypt them later). If the customer disconnected your app during that time, conversation keys were rotated to exclude your app, so messages sent while disconnected cannot be decrypted.
Can we export keys in the browser? Can the PIN stay off our servers?
-The browser edition of `chat-xdk` cannot export keys. Export works in the server and native editions: Node (`@xdevplatform/chat-xdk-server`), Python, Go, .NET, JVM, and Rust. If the PIN must not touch your servers, the business can run a small local tool that unlocks and exports the keys on its own machine and uploads only the exported keys. Without approved key storage, decryption works only in the account owner's own session, so background or scheduled processing is not possible. There is no way to export keys without the PIN.
+**Enterprise apps using the app-owner key model never ask customers for a PIN or export customer keys.** Your backend generates and persists only your own app-owner key pair using a server or native edition of `chat-xdk`: Node (`@xdevplatform/chat-xdk-server`), Python, Ruby, Go, .NET, JVM, or Rust.
+
+The browser edition (`@xdevplatform/chat-xdk` WASM) cannot export keys by design — for non-enterprise web UIs, end users unlock their own keys in the browser session so their PIN and private keys never leave their device.
Can we capture messages now and decrypt them after the customer gives us keys?
-**Yes**, as long as the account keeps the same X Chat keys. Store the encrypted events now, including the conversation key-change events on each page, and decrypt them once the customer provides key access. If the owner runs Reset Chat or resets a forgotten PIN before then, messages encrypted under the old keys cannot be decrypted. Capturing alone does not let you reply; replies must be sent encrypted.
+Under the enterprise app-owner key model, customers never give you keys or PINs. Once your app-owner key pair is set up and the customer connects your app with DM access, X Chat rotates their conversations to include your app-owner public key so you can decrypt new messages going forward. Messages that were already encrypted under an earlier conversation key that did not include your app's key cannot be decrypted with your app-owner key; older unencrypted legacy DMs do not need keys and remain readable.
@@ -294,7 +330,7 @@ Existing DM subscriptions do not carry chat events, so create new subscriptions
Our bot only replies to messages. Do we need to do anything to start conversations?
-If you only reply to messages people send you, send your replies encrypted with `chat-xdk` — nothing else is required. To start a new 1:1 conversation yourself, set up the conversation key first with `POST /2/chat/conversations/{recipient_id}/keys`, then send.
+If you only reply to messages people send you, send your replies encrypted with `chat-xdk` — nothing else is required. To start a new 1:1 conversation yourself, set up the conversation key first with `POST /2/chat/conversations/{recipient_id}/keys`, then send. For enterprise apps, include your app-owner key along with the participants' keys (and the owner keys of any other connected enterprise apps).