> ## 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.

# Get X account

> Use X account health before writes: healthy writes, recovering retries, temporaryIssue waits, needsReauth fixes TOTP or credentials

<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>

Use this endpoint before a workflow acts with one connected account. Read `health` first: write with `healthy`, let `recovering` retry on next use, wait or bulk retry `temporaryIssue`, re-authenticate `needsReauth`, and fix `locked` or `suspended` on X before retrying writes.

## Read the account state

<CardGroup cols={1}>
  <Card title="Ready for actions" icon="circle-check">
    `health: "healthy"` means the stored session is usable. `cookiesObtainedAt` shows when the session was last obtained and is omitted if the account has not authenticated yet.
  </Card>

  <Card title="Needs credentials" icon="key-round">
    `health: "needsReauth"` means credentials, TOTP, email verification, passkey, or another security challenge blocked login. Use [Re-authenticate](/api-reference/x-accounts/reauth) with current credentials and a valid TOTP secret before retrying writes.
  </Card>

  <Card title="Temporary recovery" icon="refresh-cw">
    `health: "temporaryIssue"` means a transient or automated cooldown is still active. Wait for recovery, or use [Bulk retry](/api-reference/x-accounts/bulk-retry) for temporary failures. `health: "recovering"` means Xquik will retry automatically on the next account use.
  </Card>

  <Card title="X restriction" icon="shield-alert">
    `health: "locked"` or `health: "suspended"` means writes stay blocked until the account is fixed on X. Re-authenticate or reconnect only after the account is usable again.
  </Card>
</CardGroup>

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

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

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

  account_id = "3"
  response = requests.get(
      f"https://xquik.com/api/v1/x/accounts/{account_id}",
      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() {
      accountID := "3"
      req, err := http.NewRequest("GET", "https://xquik.com/api/v1/x/accounts/"+accountID, 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>

## Path parameters

<ParamField path="id" type="string" required>
  The unique account ID. Returned when you [connect an account](/api-reference/x-accounts/connect) or [list accounts](/api-reference/x-accounts/list).
</ParamField>

## 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="id" type="string">Unique account ID.</ResponseField>
    <ResponseField name="xUsername" type="string">X username.</ResponseField>
    <ResponseField name="xUserId" type="string">X user ID.</ResponseField>
    <ResponseField name="status" type="string">Account connection status (e.g. `"active"`).</ResponseField>
    <ResponseField name="health" type="string">Derived login/cookie health. One of `healthy`, `locked`, `needsReauth`, `recovering`, `suspended`, `temporaryIssue`. See [Account health](/api-reference/x-accounts/list#account-health) for meanings.</ResponseField>
    <ResponseField name="cookiesObtainedAt" type="string">ISO 8601 timestamp of when session cookies were last obtained. Omitted if not yet authenticated.</ResponseField>
    <ResponseField name="createdAt" type="string">ISO 8601 timestamp of when the account was connected.</ResponseField>
    <ResponseField name="updatedAt" type="string">ISO 8601 timestamp of the last update.</ResponseField>

    ```json theme={null}
    {
      "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"
    }
    ```
  </Tab>

  <Tab title="400 Invalid ID">
    ```json theme={null}
    { "error": "invalid_id", "message": "Invalid account ID format" }
    ```

    The provided account ID is not a valid format.
  </Tab>

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

    Missing or invalid API key.
  </Tab>

  <Tab title="404 Not Found">
    ```json theme={null}
    { "error": "not_found", "message": "Resource not found." }
    ```

    No account exists with this ID, or it belongs to a different Xquik account.
  </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 fetching this account again.
  </Tab>
</Tabs>

<Note>
  **Related:** [List X Accounts](/api-reference/x-accounts/list) to see all accounts, [Disconnect](/api-reference/x-accounts/disconnect) to remove this account, or [Re-authenticate](/api-reference/x-accounts/reauth) if the session has expired.
</Note>
