Connect an X account
DMs and engagement actions run from your own X account. Connect it once — we store the session encrypted and keep it alive — then reference it by account_id.
403 seat_limit.Connect (username & password)
We log in on your behalf via the upstream layer and store the resulting session. Credentials are used once and encrypted at rest.
curl -X POST https://api.xautodm.com/v1/accounts/connect \
-H "Authorization: Bearer $XAUTODM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"method":"login","username":"yourhandle","password":"your-password","email":"you@email.com","totp_secret":"JBSWY3DPEHPK3PXP"}'| Field | Type | Required | Description |
|---|---|---|---|
method | string | Required | Either login or cookies. |
username | string | Required | Your X handle. |
password | string | Required | Your X password. Used once, encrypted at rest, never logged. |
email | string | Optional | Include it in case X asks for email verification during login. |
totp_secret | string | Optional | The base32 2FA secret (not the 6-digit code), required only if your account has an authenticator app enabled. |
Response:
{
"data": { "account": { "account_id": "acc_1a2b3c", "handle": "yourhandle", "status": "active" } },
"meta": { "credits_charged": 50, "credits_remaining": 4950, "request_id": "req_..." }
}Connect (paste cookies)
If you already have a session, pass your X cookies (a Cookie-Editor JSON export). This performs no login and is never rate-limited, but can't auto-relogin when it expires.
curl -X POST https://api.xautodm.com/v1/accounts/connect \
-H "Authorization: Bearer $XAUTODM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"method":"cookies","cookiesRaw":"[{\"name\":\"auth_token\",\"value\":\"...\"}]"}'Managed sessions & auto re-login
X sessions expire. When a call hits an expired session, we automatically re-login using your stored credentials (login method only) and retry — you don't have to do anything. If a session can't be recovered, the account is flagged and calls return 409 account_needs_reconnect.
Reconnect a dead session
curl -X POST https://api.xautodm.com/v1/accounts/acc_1a2b3c/reconnect \
-H "Authorization: Bearer $XAUTODM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"method":"login","username":"yourhandle","password":"your-password"}'Manage accounts
List your connected accounts.
curl https://api.xautodm.com/v1/accounts \ -H "Authorization: Bearer $XAUTODM_API_KEY"
Disconnect an account and purge its stored credentials.
curl -X DELETE https://api.xautodm.com/v1/accounts/acc_1a2b3c \ -H "Authorization: Bearer $XAUTODM_API_KEY"