X accounts
X account reauthentication API & login recovery
Restore a connected X account by reusing its saved Authenticator App TOTP secret or sending a replacement for the login challenge. See request fields.
- 200
- 400
- 401
- 404
- 422
- 429
- 503
POST
X account reauthentication API & login recovery
Free - does not consume credits
Use this when an account session expires or X requires re-verification.
Omit
totp_secret to reuse the saved key. Send a replacement only if X
changed or rejected the saved key.Re-authentication does not guarantee the same public IP. Custom or fixed
per-account proxy assignment is not supported.
Replace the saved TOTP secret
Replace the saved TOTP secret
Send
totp_secret only when the saved key no longer works.cURL
Path parameters
string
required
The unique account ID.
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
Current password for the X account.
string
Replacement Authenticator App TOTP secret. Omit it to reuse the saved key.
Send the base32 secret, not the 6-digit code.
string
Email for the X account. Updates the stored email during re-authentication.
2FA re-authentication
Xquik reuses the saved TOTP secret by default. Sendtotp_secret only when
replacing that key. Never send a 6-digit code, backup code, passkey, or security
key prompt.
If you never saved the secret key, or X rejects the current one, reset the authenticator app setup before re-authenticating:
Saved key still works
Omit
totp_secret. Xquik reuses the encrypted key saved during connection.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.
Key was rejected
Treat the old TOTP secret as stale. Reset Authentication App setup on X, save the new long key, finish 2FA confirmation, then re-authenticate.
- Open X Settings and Privacy > Security and Account Access > Security.
- Open Two-Step Verification > Authentication App.
- Turn Authentication App off, then turn it 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 new long key in
totp_secretwhen you call Xquik.
See 2FA secret key setup for the full connection checklist.
Response
200 OK
string
Account ID.
string
X username.
string
X user ID.
string
Account 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 creation timestamp.
400 Invalid input
password field or invalid format.
401 Unauthenticated
404 Not found
429 Login cooldown
retryAfterMs before retrying. The response includes a Retry-After header in seconds.
429 Rate limited
Retry-After value before starting another re-authentication request.
422 Login failed
totp_secret.
503 Service unavailable
Related. Get X Account to check account status, or Connect X Account if you need to add a new account instead.
- 200
- 400
- 401
- 404
- 422
- 429
- 503
X account reauthentication API & login recovery