Accounts
Connect an account
Connect an X account with its login or session cookies. This uses one account slot on your plan.
POST/v1/accounts/connect1,000 credits with cookies · 3,000 credits with a login
Request body
| Field | Type | Required | Description |
|---|---|---|---|
method | string | Optional | login (default) or cookies. |
username | string | Optional | X username. Required for login. |
password | string | Optional | X password. Required for login. Stored encrypted for automatic re-login. |
email | string | Optional | Email on the X account. Recommended for login. |
totp_secret | string | Optional | Base32 2FA secret, if the account has authenticator 2FA. |
cookiesRaw | string | Optional | Cookie-Editor JSON export, or auth_token=…; ct0=…. Required for cookies. |
Request
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":"auth_token=...; ct0=..."}'Response
Response
{
"data": {
"account": { "account_id": "acc_...", "handle": "yourbrand", "status": "active",
"needs_reconnect": false, "connect_method": "login", "created_at": "2026-10-27T10:00:00Z" }
},
"meta": { "credits_charged": 500, "credits_remaining": 49500, "request_id": "req_..." }
}Errors use one shape for every endpoint. See errors and rate limits.