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

# Pause or resume many API keys, X (Twitter) API docs

> Pause or resume up to 10,000 Xquik API keys in 1 request. You get back each key it changed. It skips revoked, expired & unknown keys, so retries are safe.

> For the complete documentation index, see [llms.txt](https://docs.xquik.com/llms.txt).

`PATCH https://xquik.com/api/v1/api-keys`

Stop a runaway agent's keys in 1 request, then resume them later. Xquik pauses or resumes each
listed key that belongs to your account. It skips revoked, expired & unknown keys. It also skips
other accounts' keys, so a retry is safe.

**Free.** This endpoint does not consume credits.

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
curl -X PATCH https://dashboard.xquik.com/api/v1/api-keys \
  -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" \
  -H "Origin: https://dashboard.xquik.com" \
  -H "Sec-Fetch-Site: same-origin" \
  -H "Content-Type: application/json" \
  -d '{"ids": ["42", "43"], "paused": true}' | jq
```

```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
const response = await fetch("https://dashboard.xquik.com/api/v1/api-keys", {
  method: "PATCH",
  headers: {
    Cookie: "__Host-xquik_session=YOUR_SESSION_COOKIE",
    Origin: "https://dashboard.xquik.com",
    "Sec-Fetch-Site": "same-origin",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ ids: ["42", "43"], paused: true }),
});
const { keys } = await response.json();
console.log(keys);
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
import requests

response = requests.patch(
    "https://dashboard.xquik.com/api/v1/api-keys",
    cookies={"__Host-xquik_session": "YOUR_SESSION_COOKIE"},
    headers={"Origin": "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin"},
    json={"ids": ["42", "43"], "paused": True},
)
print(response.json()["keys"])
```

```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
package main

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

func main() {
	body := bytes.NewBufferString(`{"ids": ["42", "43"], "paused": true}`)
	req, err := http.NewRequest("PATCH", "https://dashboard.xquik.com/api/v1/api-keys", body)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Origin", "https://dashboard.xquik.com")
	req.Header.Set("Sec-Fetch-Site", "same-origin")
	req.AddCookie(&http.Cookie{Name: "__Host-xquik_session", Value: "YOUR_SESSION_COOKIE"})

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

	answer, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(string(answer))
}
```

## Headers

| Header | Type | Required | Description |
| - | - | - | - |
| `Cookie` | `string` | Yes | Your signed-in dashboard session cookie, `__Host-xquik_session`. API keys and OAuth tokens get `403 session_required`. |
| `Origin` | `string` | Yes | Must be `https://dashboard.xquik.com`, sent with `Sec-Fetch-Site` set to `same-origin`. The dashboard sends both. |
| `Content-Type` | `string` | Yes | Must be `application/json`. |

## Body

| Body parameter | Type | Required | Description |
| - | - | - | - |
| `ids` | `string[]` | Yes | IDs of the keys to pause or resume, from 1 to 10,000. Get them from [List API keys](https://docs.xquik.com/api-reference/api-keys/list.md). |
| `paused` | `boolean` | Yes | `true` pauses each key, so its calls get `403 api_key_paused`. `false` resumes it. Its next call goes through. Pausing a paused key keeps its first `pausedAt`. |

## Response

### 200 OK

| Field | Type | Description |
| - | - | - |
| `keys` | `array` | Your listed keys in their new state, newest first. Each has the fields of [List API keys](https://docs.xquik.com/api-reference/api-keys/list.md). A paused key has `pausedAt`. Unknown IDs never appear. Revoked keys, expired keys & other accounts' keys never appear either. |

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
{
  "keys": [
    {
      "id": "43",
      "name": "Staging",
      "prefix": "xq_c3d4",
      "scope": "paid_reads",
      "isActive": true,
      "createdAt": "2026-02-20T09:00:00.000Z",
      "pausedAt": "2026-02-25T08:00:00.000Z"
    },
    {
      "id": "42",
      "name": "Production",
      "prefix": "xq_a1b2",
      "scope": "full",
      "isActive": true,
      "createdAt": "2026-02-24T10:30:00.000Z",
      "pausedAt": "2026-02-25T08:00:00.000Z"
    }
  ]
}
```

### 400 Invalid input

`{ "error": "invalid_input", "message": "Send ids as a list of 1 to 10000 API key IDs. Set paused to true or false." }`




`ids` was missing, empty, or longer than 100. Or it held a value that is not a numeric ID.
`paused` was missing or not `true` or `false`. Xquik changes nothing.

### 401 Unauthenticated

Missing, expired, or invalid dashboard session cookie.

### 429 Rate limited

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

> [!NOTE]
>
> Pausing keeps each key & its settings. To stop a key for good, use
> [Revoke API keys](https://docs.xquik.com/api-reference/api-keys/bulk-revoke.md) instead.
>
> **Related.** [Update API Key](https://docs.xquik.com/api-reference/api-keys/update.md) · [List API Keys](https://docs.xquik.com/api-reference/api-keys/list.md) · [Revoke API Keys](https://docs.xquik.com/api-reference/api-keys/bulk-revoke.md)

## Response examples

* **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }`
* **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }`
* **403** `{ "error": "session_required", "message": "API keys & OAuth tokens cannot use this route. Sign in at dashboard.xquik.com/account instead." }`
* **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }`


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