---
title: "Create X account connect link"
method: POST
path: "/api/v1/x/account-connection-links"
tags: ["X Accounts"]
---

# Create X account connect link

`POST /api/v1/x/account-connection-links`

## Request

- Base URL: `https://xquik.com`
- URL: `https://xquik.com/api/v1/x/account-connection-links`
- Auth: one of:
  - API key in header `x-api-key`
  - API key in cookie `__Host-xquik_session`

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.

## Request body

- object
  - `reference` string: Your own ID for this person. It comes back when you read the link.
  - `returnUrl` string, uri: A public https URL the page offers as a button once the account connects. Xquik never redirects by itself, & never adds the token.
  - `accountId` string: The ID of 1 of your X accounts. The link then reconnects that account.

## Response `201`

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

- object: A link where a person connects an X account on Xquik's page.
  - `object` 'x_account_connection_link', required
  - `id` string, 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.
  - `reference` string, nullable, required
  - `returnUrl` string, uri, nullable, required
  - `apiKeyId` string, nullable, required: The ID of the API key that made the link, or null when a dashboard session made it.
  - `accountId` string, nullable, required
  - `xUserId` string, nullable, required
  - `xUsername` string, nullable, required
  - `health` string, nullable, required
  - `failure` string, nullable, required: Why the last login didn't finish.
  - `createdAt` string, date-time, required
  - `expiresAt` string, date-time, required
  - `completedAt` string, date-time, nullable, required
  - `url` string, uri, required: The page to open. Its fragment holds the token, so treat it as a secret & keep it out of logs.

## Other responses

- `400`: Invalid input. A value past its maxLength gets this answer, & the message names the field & its limit. Bad input costs nothing, since it's refused before any read.
- `401`: Unauthenticated
- `403`: An API key needs Full access & `connectsXAccounts` for connect links. Turn the permission on in a dashboard session at dashboard.xquik.com/api-keys. An OAuth token or MCP tool gets `session_required`, & a paused API key gets `api_key_paused`.
- `404`: No X account with this ID belongs to the authenticated user. Returns error code `account_not_found`.
- `429`: Too many requests right now. Each user gets 500 reads a second, 6,000 changes to Xquik resources a minute & 120 X actions a minute. X actions post, like, follow, message or edit through a connected X account. `x_api_rate_limited` means X limits this read for now. Neither answer costs anything. Wait for the seconds in `Retry-After`, then retry.
- `500`: Unexpected error.
- `default`: Unexpected error.

## Changes

- **2026-11-18** `fe9dc4f8a127`: 1 info
  - endpoint added
- **2026-11-18** `2284c0998114`: 1 breaking
  - api path removed without deprecation
- **2026-11-18** `a291f0b82030`: 1 info
  - endpoint added
- **2026-11-17** `e1e106c83615`: 1 breaking
  - api path removed without deprecation
- **2026-11-17** `d40150ef20b1`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/xquik-dev/apis/xquik-api/changes/api/v1/x/account-connection-links/post.md)

---

[API](https://skmtc.dev/xquik-dev/apis/xquik-api.md) - [All operations](https://skmtc.dev/xquik-dev/apis/xquik-api/llms.txt) - [OpenAPI document](https://skmtc.dev/xquik-dev/apis/xquik-api/revisions/fe9dc4f8a127?raw)
