---
title: "Connect X account"
method: POST
path: "/api/v1/x/accounts"
tags: ["X Accounts"]
---

# Connect X account

`POST /api/v1/x/accounts`

Starts a secure X account connection flow.

## Request body

- object
  - `username` string, required — X username
  - `email` string, required — Account email
  - `password` string, required — Account password
  - `totp_secret` string, required — Authenticator App TOTP secret required for durable login

## Response `201`

X account connected after verification

- SanitizedXAccount — Sanitized X account summary returned by connect and reauth.
  - `id` string, required
  - `xUserId` string, required
  - `xUsername` string, required
  - `status` 'active', required
  - `health` 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue', required
  - `createdAt` string, date-time, required

## Other responses

- `202` — Connection continues or needs an email code
- `400` — Invalid input
- `401` — Unauthenticated
- `409` — The specified X account is already connected to this Xquik account. Returns error code `account_already_connected`.
- `422` — Login requires new credentials or account verification. Cooldowns include `retryAfterMs` and `Retry-After`. Codes are `login_failed` or `passkey_required`.
- `429` — Too many requests. `rate_limit_exceeded` includes `retryAfter` and `Retry-After`. `login_cooldown` also includes `reason` and `retryAfterMs`.
- `502` — The X username could not be resolved. Verify the handle is correct and the account exists. Default v1 returns 502. The best-practice response contract returns 424. Error code: `x_user_lookup_failed`.
- `503` — The X connection service is temporarily unavailable. Retry after a short delay. Returns error code `service_unavailable`.
- `default` — Unexpected error.

## Changes

- **2026-08-21** `18302a60cfee` — 7 info
  - removed `#/components/schemas/SanitizedXAccount` from the response body `allOf` list for the response status `201`
  - added the required property `createdAt` to the response with the `201` status
  - added the required property `health` to the response with the `201` status
  - added the required property `id` to the response with the `201` status
  - …3 more
- **2026-08-12** `5d4938bb7de3` — 144 warning
  - added the new `closed` enum value to the `error/oneOf[subschema #1: LegacyErrorCode]/` response property for the response status `400`
  - added the new `closed` enum value to the `error/oneOf[subschema #1: LegacyErrorCode]/` response property for the response status `401`
  - added the new `closed` enum value to the `error/oneOf[subschema #1: LegacyErrorCode]/` response property for the response status `409`
  - added the new `closed` enum value to the `error/oneOf[subschema #1: LegacyErrorCode]/` response property for the response status `422`
  - …140 more
- …earlier changes not shown

[Full history](https://skmtc.dev/xquik-dev/apis/xquik-api-2/changes/api/v1/x/accounts/post.md)

---

[API](https://skmtc.dev/xquik-dev/apis/xquik-api-2.md) · [All operations](https://skmtc.dev/xquik-dev/apis/xquik-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/xquik-dev/xquik-api-2/revisions/73f46a2af801/schema)
