Start with a connect link. Choose the direct API only if your product must own the form.
Use a connect link
Create a link from your backend.url in a pop-up or a new tab. The page can’t load in a frame.
The person enters their X username, email, password & Authenticator App 2FA secret there.
The page names your Xquik account, and asks for any code X emails them.
Then read the link with its id.
Once status reads connected, you get accountId, xUserId, xUsername, health & your reference.What a link protects
- A link works for 30 minutes and connects 1 account. Only its hash is stored.
- 5 refused logins end a link, so it can’t be used to guess passwords.
- The page takes the token out of the address bar, and sends no cookies.
- It offers your
returnUrlas a button. It never redirects by itself. - Send
accountIdto make a reconnect link. It refuses a sign-in for any other X account.
url like a password until it’s used. Keep it out of logs & analytics. Revoke it if you send it to the wrong person.Use the direct API
Turn on the permission
Open dashboard.xquik.com/api-keys and edit a key. Turn on Connect X accounts. It starts off on every key. Full access doesn’t include it, and only a signed-in dashboard session can change it. A key without it gets403 x_account_connect_permission_required.
OAuth tokens and MCP tools always get 403 session_required. X passwords never reach a model.Connect an account
Generate aconnection_attempt_id first. You can then read the result even if the response never arrives.totp_secret is the long Authenticator App key, not a 6-digit code.
Connect X account explains how a user finds it.Handle each answer
A successful attempt read gives
accountId too.Reconnect, retry & disconnect
When a password changes orhealth reads needsReauth, call reconnect with the new password.
It answers like a connect. It refuses a sign-in that belongs to another X account.
Bulk retry clears passing failures, so you never send a password for those.
Disconnect removes an account and its stored session.
Account activity records each connect, reconnect & disconnect with the key’s ID.Your duties
Your product collects X passwords, so these become your job.- Tell users you collect their password and send it to Xquik.
- Send it only over HTTPS, and only from your backend.
- Keep request bodies out of your logs, traces, error reports & analytics.
- Never store the password or 2FA secret once Xquik answers.
- Keep this key in a secret store, and set its allowed IPs.
- Use a separate key for connecting, and pause it when you don’t need it.
Act as each account
Sendaccount on each write and DM call to pick which connected account acts.
List X accounts gives each account’s status and health.Limits
These hold on both paths. Failed logins slow a caller down. Each account you connect lifts that limit, so onboarding many users isn’t capped. A caller with no connected accounts gets 10 failed logins per 15 minutes. One X account gets 5 refused logins per 15 minutes, across all callers. A429 always says how long to wait.