> ## 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 to disconnect a profile

> Delete the stored Xquik connection for one X account. The X account stays unchanged. The old ID then returns 404, and reconnecting creates a new account ID.

<Panel>
  <Tabs defaultTabIndex={0} sync={false}>
    <Tab title="200" id="response-x-accounts-disconnect-200">
      ```json theme={null}
      {
        "success": true
      }
      ```
    </Tab>

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

    <Tab title="401" id="response-x-accounts-disconnect-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-disconnect-404">
      ```json theme={null}
      {
        "error": "not_found",
        "message": "Resource not found."
      }
      ```
    </Tab>

    <Tab title="429" id="response-x-accounts-disconnect-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>

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

Use this endpoint when a connected account should no longer be available for write actions, DMs, media upload, or profile updates. It deletes only the stored Xquik connection for that account ID. It does not change the X account itself. After success, the old Xquik account ID returns `404`. Reconnect the account to get a new ID.

## What disconnect does

<CardGroup cols={1}>
  <Card title="Removes this connection" icon="trash-2">
    Xquik removes the stored connection row from your account. Future `GET /x/accounts/{id}` calls for the same ID return `404`.
  </Card>

  <Card title="Stops writes immediately" icon="send">
    The dashboard Disconnect button uses the same endpoint. It warns that write actions stop immediately. After success, new write, DM, media upload, and profile actions must choose another connected account or reconnect this X account.
  </Card>

  <Card title="Keeps monitors separate" icon="radio">
    Account and keyword monitors are independent. Disconnecting credentials for `@username` does not remove monitors that track that username. Delete those monitors separately when tracking should stop.
  </Card>

  <Card title="Reconnect with a new ID" icon="refresh-cw">
    To use the same X account again, call [Connect X Account](/api-reference/x-accounts/connect). Store the new account `id` from the connect response. Do not reuse the deleted ID.
  </Card>
</CardGroup>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE 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: "DELETE",
    headers: {
      "x-api-key": "xq_YOUR_KEY_HERE",
    },
  });
  const data = await response.json();
  ```

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

  account_id = "3"
  response = requests.delete(
      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("DELETE", "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.
</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="success" type="boolean">
  Always `true` on successful disconnection.
</ResponseField>

```json theme={null}
{ "success": true }
```

### 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": 60
}
```

Wait for the `Retry-After` value before disconnecting another account.

<Info>
  Xquik disconnects the account and permanently deletes stored credentials. This does not affect your X account itself.
</Info>

<Note>
  **Related.** [List X Accounts](/api-reference/x-accounts/list) to verify the removal, or [Connect X Account](/api-reference/x-accounts/connect) to add a new one.
</Note>


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