> ## 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 Xquik API keys in 1 request

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

**200**

```json theme={null}
{
  "keys": [
    {
      "id": "43",
      "name": "Analytics notebook",
      "prefix": "xq_live_exam",
      "scope": "paid_reads",
      "isActive": true
    }
  ]
}
```

**400**

```json theme={null}
{
  "error": "invalid_input",
  "message": "Invalid input. Check the request body."
}
```

**401**

```json theme={null}
{
  "error": "unauthenticated",
  "message": "Authentication required. Provide a valid API key or bearer token."
}
```

**403**

```json theme={null}
{
  "error": "session_required",
  "message": "API keys & OAuth tokens cannot use this route. Sign in at dashboard.xquik.com/account instead."
}
```

**429**

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

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

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={null}
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={null}
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={null}
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={null}
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

**Cookie** `string` *required*

Your signed-in dashboard session cookie, `__Host-xquik_session`. API keys and OAuth tokens get
`403 session_required`.

**Origin** `string` *required*

Must be `https://dashboard.xquik.com`, sent with `Sec-Fetch-Site` set to `same-origin`. The
dashboard sends both.

**Content-Type** `string` *required*

Must be `application/json`.

## Body

**ids** `string[]` *required*

IDs of the keys to pause or resume, from 1 to 100. Get them from
[List API keys](https://docs.xquik.com/api-reference/api-keys/list.md).

**paused** `boolean` *required*

`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

**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={null}
{
  "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

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

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

### 401 Unauthenticated

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

Missing, expired, or invalid dashboard session cookie.

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

> [!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)


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