X Accounts

Create X account connect link

Changed on

Creates a link to a page Xquik hosts, where a person connects an X account with no Xquik signup. Your backend never receives their password or 2FA secret, and the account belongs to you. Send accountId to reconnect 1 of your accounts instead. Connecting is free. Takes a Full access API key holding connectsXAccounts, or a dashboard session. The link works for 30 minutes, & the response is the only place its token appears. A link a key made stops while that key is paused or loses connectsXAccounts, & for good once it's revoked, rotated, expired or deleted.

post/api/v1/x/account-connection-links

Request

  • Base URL
    https://xquik.com
  • Auth
    • API key in header x-api-key
    • or API key in cookie __Host-xquik_session

Request body

referencestring

Your own ID for this person. It comes back when you read the link.

returnUrlstring uri

A public https URL the page offers as a button once the account connects. Xquik never redirects by itself, & never adds the token.

accountIdstring

The ID of 1 of your X accounts. The link then reconnects that account.

Example request

{
  "reference": "crm-user-7",
  "returnUrl": "https://app.example.com/connected",
  "accountId": "42"
}

Response

Link created. Open url in a pop-up or a new tab, since the page can't load in a frame.

object'x_account_connection_link' required
idstring required
purpose'connect' | 'reconnect' required
status'pending' | 'connecting' | 'requires_email_code' | 'connected' | 'failed' | 'expired' | 'revoked' required

failed means 5 logins were refused, so make a new link. revoked means you revoked it, or the key that made it is paused, revoked, expired, no longer Full access or without connectsXAccounts. A link whose key resumes within its 30 minutes reads pending again.

referencestring nullable required
returnUrlstring uri nullable required
apiKeyIdstring nullable required

The ID of the API key that made the link, or null when a dashboard session made it.

accountIdstring nullable required
xUserIdstring nullable required
xUsernamestring nullable required
healthstring nullable required
failurestring nullable required

Why the last login didn't finish.

createdAtstring date-time required
expiresAtstring date-time required
completedAtstring date-time nullable required
urlstring uri required

The page to open. Its fragment holds the token, so treat it as a secret & keep it out of logs.

Example response

{
  "object": "x_account_connection_link",
  "id": "xlink_AAAAAAAAAAAAAAAA",
  "purpose": "connect",
  "status": "connected",
  "reference": "crm-user-7",
  "returnUrl": "https://app.example.com/connected",
  "apiKeyId": "17",
  "accountId": "42",
  "xUserId": "9876543210",
  "xUsername": "elonmusk",
  "health": "healthy",
  "failure": "login_failed",
  "createdAt": "2026-11-08T12:00:00Z",
  "expiresAt": "2026-11-08T12:30:00Z",
  "completedAt": "2026-11-08T12:02:00Z",
  "url": "https://xquik.com/connect-x#token=CONNECT_LINK_TOKEN"
}

Changes