Skip to main content
POST
Connect X account API & profile login workflow
Free - does not consume credits
Xquik encrypts credentials at rest. It only uses them to maintain the connection. Xquik never stores plaintext passwords.
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 example JBSWY3DPEHPK3PXP.

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.
If you already saved the secret key, send it as 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.
  1. Open X Settings and Privacy > Security and Account Access > Security.
  2. Open Two-Step Verification > Authentication App.
  3. Turn Authentication App off.
  4. Turn Authentication App on again.
  5. When the QR code appears, choose Can’t scan the QR code? to reveal the text secret.
  6. Copy the long secret key and store it safely before leaving the setup screen.
  7. Add that key to your authenticator app if you are setting it up fresh.
  8. Finish enabling 2FA on X by entering the current 6-digit code from your authenticator app.
  9. Send the saved long key in totp_secret when you call Xquik.
Do not stop after copying the secret key. Complete the X-side 2FA confirmation before starting the Xquik connection, or the key will not work.
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.
The response includes:
  • Location: /api/v1/x/account-connection-attempts/{id}
  • Retry-After: 3
  • Cache-Control: no-store
Wait for 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.
Submit the code to Submit X Account Email Code.

400 Invalid input

Missing username, email, password, or totp_secret, or invalid field format.

401 Unauthenticated

Missing or invalid API key.

409 Duplicate

The specified X account is already connected to your Xquik account.

429 Rate limit exceeded

The connection safety limit was reached. The response includes a Retry-After: 900 header indicating how many seconds to wait before retrying. See the rate limits guide for details.

429 Login cooldown

A prior login attempt triggered a cooldown (for example, X flagged the session). Wait for retryAfterMs before retrying. The response includes a Retry-After header in seconds.

422 Login failed

X rejected the submitted username, email, password, or TOTP secret. Retry with the current password and the saved Authenticator App secret key, not a 6-digit code. When retryAfterMs is present, wait for that exact duration. The response also includes Retry-After in seconds.
X asked for passkey verification. Switch the account to Authenticator App 2FA, save the long TOTP secret key, finish setup on X, then connect with totp_secret.

502 X user lookup failed

The X username could not be resolved. Verify the handle is correct and that the account exists.

503 Service unavailable

The X connection service is temporarily unavailable. Retry after a short delay.
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.