X accounts
Connect X account API & profile login workflow
Connect an X account with username, password, and its saved Authenticator App TOTP secret for durable tweet, reply, DM, and profile actions. See costs.
- 201
- 202
- 400
- 401
- 409
- 422
- 429
- 502
- 503
POST
Connect X account API & profile login workflow
Free - does not consume credits
Authenticator App 2FA and
totp_secret are required for a durable Xquik connection.
Missing the key? Restart Authentication App 2FA in X to reveal a new secret.
Copy it, add it to your authenticator app, and finish X’s 6-digit confirmation.
Then send the saved long key as totp_secret.Custom, dedicated, and user-supplied proxies are not supported. Xquik does
not guarantee one fixed public IP per connected account.
A connection can finish immediately, continue as a tracked attempt, or ask
for an email code. If it continues, follow the returned
Location. Do not
send the credentials again while the attempt is pending.Headers
string
required
Your API key. Session cookie authentication is also supported. Generate a key from the dashboard.
string
required
Must be
application/json.Body
string
required
X username to connect. The
@ prefix is automatically stripped if included.string
required
Email address associated with the X account.
string
required
Password for the X account. Encrypted at rest immediately upon receipt.
string
required
Authenticator App TOTP secret required for a durable connection. This is the
base32-encoded secret, not the 6-digit code.
2FA secret key setup
Xquik needs the authenticator app secret key, not a live 6-digit code. The key is the long base32 string X shows while you set up Authentication App 2FA, for exampleJBSWY3DPEHPK3PXP.
Use the secret key
Paste the long base32 key into
totp_secret. Xquik uses it to generate fresh 2FA codes during login challenges.Do not use backup codes
Do not paste the 6-digit authenticator code, the 12-character backup code, a passkey, or a security key prompt.
totp_secret. If you did not save it, create a fresh authenticator app secret on X:
You saved the key
Paste that saved base32 secret into
totp_secret. Do not paste the current 6-digit authenticator code.2FA is on, key is missing
X shows the text secret only during Authentication App setup. Turn Authentication App off, turn it on again, copy the new key, then finish setup on X.
2FA is not enabled
Start Authentication App setup on X, reveal the text secret, copy it, add it to your authenticator app, confirm the 6-digit code on X, then connect.
- Open X Settings and Privacy > Security and Account Access > Security.
- Open Two-Step Verification > Authentication App.
- Turn Authentication App off.
- Turn Authentication App on again.
- When the QR code appears, choose Can’t scan the QR code? to reveal the text secret.
- Copy the long secret key and store it safely before leaving the setup screen.
- Add that key to your authenticator app if you are setting it up fresh.
- Finish enabling 2FA on X by entering the current 6-digit code from your authenticator app.
- Send the saved long key in
totp_secretwhen you call Xquik.
Passkeys and security keys cannot satisfy this flow. Use Authenticator App 2FA.
Response
201 Created
string
Unique account ID.
string
Connected X username.
string
X user ID.
string
Account connection status (e.g.
"active").string
Derived login/cookie health. One of
healthy, locked, needsReauth, recovering, suspended, temporaryIssue. See Account health for meanings.string
ISO 8601 timestamp of when the account was connected.
202 Connecting
string
Always
x_account_connection_attempt.string
Connection attempt ID.
string
Always
pending.integer
Milliseconds to wait before checking the status URL.
Location: /api/v1/x/account-connection-attempts/{id}Retry-After: 3Cache-Control: no-store
Retry-After, then call Get X Account Connection Status. Keep checking while status is pending. Do not create another attempt.
202 Email code required
string
Always
x_account_connection_challenge.string
Challenge ID to submit with the email verification code.
string
Always
requires_email_code.string
ISO 8601 expiration time for the challenge.
string
Human-readable next step.
string
X username being connected.
400 Invalid input
username, email, password, or totp_secret, or invalid field format.
401 Unauthenticated
409 Duplicate
429 Rate limit exceeded
Retry-After: 900 header indicating how many seconds to wait before retrying. See the rate limits guide for details.
429 Login cooldown
retryAfterMs before retrying. The response includes a Retry-After header in seconds.
422 Login failed
retryAfterMs is present, wait for that exact duration. The response also includes Retry-After in seconds.
totp_secret.
502 X user lookup failed
503 Service unavailable
Related. Get X Account Connection Status for a pending attempt, List X Accounts to see connected accounts, or Re-authenticate if a connection expires later.
- 201
- 202
- 400
- 401
- 409
- 422
- 429
- 502
- 503
Connect X account API & profile login workflow