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

# Revoke Xquik API key & stop request access

> Permanently revoke an API key used for tweet, follower, profile, monitor, webhook, export, or account-action requests. Revocation is immediate and free.

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

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

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

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

    <Tab title="429" id="response-api-keys-revoke-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>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://xquik.com/api/v1/api-keys/42 \
    -H "Cookie: session_token=YOUR_SESSION_TOKEN" | jq
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://xquik.com/api/v1/api-keys/42", {
    method: "DELETE",
    headers: { Cookie: "session_token=YOUR_SESSION_TOKEN" },
  });
  const result = await response.json();
  console.log(result);
  ```

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

  response = requests.delete(
      "https://xquik.com/api/v1/api-keys/42",
      cookies={"session_token": "YOUR_SESSION_TOKEN"},
  )
  result = response.json()
  print(result)
  ```

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

  import (
  	"fmt"
  	"io"
  	"log"
  	"net/http"
  )

  func main() {
  	req, err := http.NewRequest("DELETE", "https://xquik.com/api/v1/api-keys/42", nil)
  	if err != nil {
  		log.Fatal(err)
  	}
  	req.AddCookie(&http.Cookie{Name: "session_token", Value: "YOUR_SESSION_TOKEN"})

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

  	body, err := io.ReadAll(resp.Body)
  	if err != nil {
  		log.Fatal(err)
  	}
  	fmt.Println(string(body))
  }
  ```
</CodeGroup>

## Path parameters

<ParamField path="id" type="string" required>
  The unique identifier of the API key to revoke.
</ParamField>

## Headers

<ParamField header="Cookie" type="string">
  Dashboard session cookie. Format: `session_token=YOUR_SESSION_TOKEN`.
</ParamField>

## Response

### 200 OK

<ResponseField name="success" type="boolean">
  Always `true` when Xquik revokes the key.
</ResponseField>

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

### 400 Invalid ID

```json theme={null}
{ "error": "invalid_id" }
```

The path parameter is not a valid ID. IDs are numeric strings.

### 401 Unauthenticated

```json theme={null}
{ "error": "unauthenticated" }
```

Missing, expired, or invalid dashboard session cookie.

### 404 Not found

```json theme={null}
{ "error": "not_found" }
```

No API key with this ID exists on your account, or you already revoked it.

### 429 Rate limited

```json theme={null}
{
  "error": "rate_limit_exceeded",
  "message": "Too many requests. Try again later.",
  "retryAfter": 60
}
```

Too many requests. Wait for the `Retry-After` header before retrying.

<Warning>
  Revocation is **immediate and permanent**. Every request with the revoked key returns `401 Unauthenticated`. You cannot undo it. Create a new key if you need one.
</Warning>

<Note>
  API key revocation requires a same-origin dashboard session. API keys and
  OAuth bearer tokens cannot revoke account keys.

  **Related.** [Create API Key](/api-reference/api-keys/create) · [List API Keys](/api-reference/api-keys/list)
</Note>


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