> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xquik.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List X accounts

> Use health before writes: healthy writes, recovering retries, temporaryIssue waits, needsReauth fixes TOTP or credentials, locked/suspended need X recovery

<blockquote className="agent-llms-directive">
  For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
</blockquote>

<Callout icon="circle-check" color="#16a34a">
  **Free** - does not consume credits
</Callout>

<Info>
  Check `accounts[].health` before scheduling writes. `healthy` can write now. `recovering` can retry automatically on the next account use. `temporaryIssue` is still paused by a transient cooldown. `needsReauth` requires fresh credentials, TOTP setup, or a resolved security challenge through [Re-authenticate X Account](/api-reference/x-accounts/reauth). `locked` and `suspended` stay blocked until the account is fixed on X.
</Info>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET https://xquik.com/api/v1/x/accounts \
    -H "x-api-key: xq_YOUR_KEY_HERE" | jq
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://xquik.com/api/v1/x/accounts", {
    method: "GET",
    headers: {
      "x-api-key": "xq_YOUR_KEY_HERE",
    },
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://xquik.com/api/v1/x/accounts",
      headers={"x-api-key": "xq_YOUR_KEY_HERE"},
  )
  data = response.json()
  ```

  ```go Go theme={null}
  package main

  import (
      "encoding/json"
      "fmt"
      "net/http"
  )

  func main() {
      req, err := http.NewRequest("GET", "https://xquik.com/api/v1/x/accounts", nil)
      if err != nil {
          panic(err)
      }
      req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE")

      resp, err := http.DefaultClient.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      var data map[string]interface{}
      if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
          panic(err)
      }
      fmt.Println(data)
  }
  ```
</CodeGroup>

## Headers

<ParamField header="x-api-key" type="string" required>
  Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://xquik.com/dashboard).
</ParamField>

## Response

<Tabs>
  <Tab title="200 OK">
    <ResponseField name="accounts" type="object[]">Array of connected X account objects.</ResponseField>
    <ResponseField name="accounts[].id" type="string">Unique account ID.</ResponseField>
    <ResponseField name="accounts[].xUsername" type="string">X username.</ResponseField>
    <ResponseField name="accounts[].xUserId" type="string">X user ID.</ResponseField>
    <ResponseField name="accounts[].status" type="string">Account connection status (e.g. `"active"`).</ResponseField>
    <ResponseField name="accounts[].health" type="string">Derived login/cookie health. One of `healthy`, `locked`, `needsReauth`, `recovering`, `suspended`, `temporaryIssue`. See [Account health](#account-health) below.</ResponseField>
    <ResponseField name="accounts[].cookiesObtainedAt" type="string">ISO 8601 timestamp of when session cookies were last obtained. Omitted if not yet authenticated.</ResponseField>
    <ResponseField name="accounts[].createdAt" type="string">ISO 8601 timestamp of when the account was connected.</ResponseField>
    <ResponseField name="accounts[].updatedAt" type="string">ISO 8601 timestamp of the last update.</ResponseField>

    ```json theme={null}
    {
      "accounts": [
        {
          "id": "3",
          "xUsername": "elonmusk",
          "xUserId": "44196397",
          "status": "active",
          "health": "healthy",
          "cookiesObtainedAt": "2026-02-20T08:15:00.000Z",
          "createdAt": "2026-02-20T08:15:00.000Z",
          "updatedAt": "2026-02-20T08:15:00.000Z"
        },
        {
          "id": "5",
          "xUsername": "xquik_",
          "xUserId": "1234567890",
          "status": "active",
          "health": "healthy",
          "cookiesObtainedAt": "2026-02-22T12:00:00.000Z",
          "createdAt": "2026-02-22T12:00:00.000Z",
          "updatedAt": "2026-02-22T12:00:00.000Z"
        }
      ]
    }
    ```
  </Tab>

  <Tab title="401 Unauthenticated">
    ```json theme={null}
    { "error": "unauthenticated", "message": "Missing or invalid API key" }
    ```

    Missing or invalid API key.
  </Tab>

  <Tab title="429 Rate Limited">
    ```json theme={null}
    { "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }
    ```

    Wait for the `Retry-After` value before listing accounts again.
  </Tab>
</Tabs>

<Note>
  **Related:** [Connect X Account](/api-reference/x-accounts/connect) to add a new account, or [Get X Account](/api-reference/x-accounts/get) to fetch details for a specific account.
</Note>

## Account health

The `health` field is derived from recent login and cookie state. Use it before writes so your workflow proceeds, waits, retries automatically, or asks the operator to fix the account first.

<CardGroup cols={2}>
  <Card title="healthy" icon="circle-check">
    Cookies are valid. Writes can proceed.
  </Card>

  <Card title="needsReauth" icon="refresh-cw">
    Credentials, TOTP, email verification, passkey, or another security
    challenge blocked login. Use [reauth](/api-reference/x-accounts/reauth)
    with current credentials and a valid TOTP secret before retrying writes.
  </Card>

  <Card title="locked" icon="lock">
    X locked the account or requires account-side verification. Complete the X
    check, then reauth or reconnect after the account works again.
  </Card>

  <Card title="suspended" icon="circle-x">
    X suspended the account. Appeal on X; writes and automatic retries stay
    paused until the account is restored.
  </Card>

  <Card title="recovering" icon="activity">
    Past a transient cooldown. Xquik will retry automatically on the next
    account use.
  </Card>

  <Card title="temporaryIssue" icon="triangle-alert">
    Transient or automated cooldown is still active. Wait for recovery, or use
    [bulk retry](/api-reference/x-accounts/bulk-retry) for temporary failures.
  </Card>
</CardGroup>
