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

# X account connection API for profile status

> Check a connected X account before tweets, replies, DMs, likes, follows, or profile updates. Read healthy, recovering, temporaryIssue, or needsReauth.

<Panel>
  <Tabs defaultTabIndex={0} sync={false}>
    <Tab title="200" id="response-x-accounts-get-200">
      ```json theme={null}
      {
        "id": "42",
        "xUserId": "9876543210",
        "xUsername": "elonmusk",
        "status": "active",
        "health": "healthy",
        "createdAt": "2025-01-15T12:00:00Z"
      }
      ```
    </Tab>

    <Tab title="400" id="response-x-accounts-get-400">
      ```json theme={null}
      {
        "error": "invalid_input",
        "message": "Invalid input. Check the request body."
      }
      ```
    </Tab>

    <Tab title="401" id="response-x-accounts-get-401">
      ```json theme={null}
      {
        "error": "unauthenticated",
        "message": "Authentication required. Provide a valid API key or bearer token."
      }
      ```
    </Tab>

    <Tab title="404" id="response-x-accounts-get-404">
      ```json theme={null}
      {
        "error": "not_found",
        "message": "Resource not found."
      }
      ```
    </Tab>

    <Tab title="429" id="response-x-accounts-get-429">
      ```json theme={null}
      {
        "error": "rate_limit_exceeded",
        "message": "Too many requests. Try again later.",
        "retryAfter": 60
      }
      ```
    </Tab>
  </Tabs>
</Panel>

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

## When to check one account

Call this route before one connected-account write. Read health, recovery, and credential state before selecting the next action. Use list to see every connected account.

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

Use this endpoint before a workflow acts with one connected account. Read `health` first. Write with `healthy`. Use `recovering` on the next action. Wait or bulk retry `temporaryIssue`. Re-authenticate `needsReauth`. 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. `connectedAt` shows when the account last connected or reconnected. The API omits it 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 the account can reconnect on its next use.
  </Card>

  <Card title="X restriction" icon="shield-alert">
    `health: "locked"` or `health: "suspended"` means writes stay blocked until you fix the account 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

### 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 (for example `"active"`).
</ResponseField>

<ResponseField name="health" type="string">
  Derived login and 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="connectedAt" type="string">
  ISO 8601 timestamp of when the account last connected or reconnected. Omitted if not yet
  authenticated.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp of when you connected the account.
</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",
  "connectedAt": "2026-02-20T08:15:00.000Z",
  "createdAt": "2026-02-20T08:15:00.000Z",
  "updatedAt": "2026-02-20T08:15:00.000Z"
}
```

### 400 Invalid ID

```json theme={null}
{ "error": "invalid_id", "message": "Invalid account ID format" }
```

The provided account ID is not a valid format.

### 401 Unauthenticated

```json theme={null}
{ "error": "unauthenticated", "message": "Missing or invalid API key" }
```

Missing or invalid API key.

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

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

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.