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

# Delete Twitter keyword monitor & stop webhooks

> Stop a Twitter keyword monitor and future query checks. Xquik removes stored events in batches. Poll the status URL until deletion finishes with a 404 status.

<Panel>
  <Tabs defaultTabIndex={0} sync={false}>
    <Tab title="202" id="response-monitors-delete-keyword-202">
      ```json theme={null}
      {
        "deletionStatus": "deleting",
        "statusUrl": "/api/v1/monitors/42",
        "success": true
      }
      ```
    </Tab>

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

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

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

    <Tab title="429" id="response-monitors-delete-keyword-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>

Delete a keyword monitor only when its tweet query should stop permanently.
Pause it instead when future monitoring might resume.

<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/monitors/keywords/21 \
    -H "x-api-key: xq_YOUR_KEY_HERE" | jq
  ```

  ```javascript Node.js theme={null}
  const monitorId = "21";
  const response = await fetch(`https://xquik.com/api/v1/monitors/keywords/${monitorId}`, {
    method: "DELETE",
    headers: { "x-api-key": "xq_YOUR_KEY_HERE" },
  });
  const result = await response.json();
  const deletionReceipt = {
    keyword_monitor_id: monitorId,
    success: result.success === true,
    verify_endpoint: result.statusUrl,
    list_endpoint: "/api/v1/monitors/keywords",
  };
  process.stdout.write(`${JSON.stringify(deletionReceipt)}\n`);
  ```

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

  monitor_id = "21"
  response = requests.delete(
      f"https://xquik.com/api/v1/monitors/keywords/{monitor_id}",
      headers={"x-api-key": "xq_YOUR_KEY_HERE"},
  )
  result = response.json()
  deletion_receipt = {
      "keyword_monitor_id": monitor_id,
      "success": result["success"] is True,
      "verify_endpoint": result["statusUrl"],
      "list_endpoint": "/api/v1/monitors/keywords",
  }
  print(json.dumps(deletion_receipt))
  ```

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

  import (
      "encoding/json"
      "log"
      "net/http"
      "os"
  )

  type DeleteResult struct {
      StatusURL string `json:"statusUrl"`
      Success   bool   `json:"success"`
  }

  type KeywordMonitorDeletion struct {
      KeywordMonitorID string `json:"keyword_monitor_id"`
      Success          bool   `json:"success"`
      VerifyEndpoint   string `json:"verify_endpoint"`
      ListEndpoint     string `json:"list_endpoint"`
  }

  func main() {
      monitorID := "21"
      req, err := http.NewRequest(
          "DELETE",
          "https://xquik.com/api/v1/monitors/keywords/"+monitorID,
          nil,
      )
      if err != nil {
          log.Fatal(err)
      }
      req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE")

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

      var result DeleteResult
      if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
          log.Fatal(err)
      }
      receipt := KeywordMonitorDeletion{
          KeywordMonitorID: monitorID,
          Success:          result.Success,
          VerifyEndpoint:   result.StatusURL,
          ListEndpoint:     "/api/v1/monitors/keywords",
      }
      if err := json.NewEncoder(os.Stdout).Encode(receipt); err != nil {
          log.Fatal(err)
      }
  }
  ```
</CodeGroup>

The examples store a deletion receipt. Poll `verify_endpoint` while it returns
`200`. Deletion finishes when it returns `404`. Respect `Retry-After` between
requests.

## Remove one term from a monitored query

A keyword monitor stores one query. The API has no route that deletes a single
term. This route deletes the whole monitor.

To drop a term, create a new monitor with the revised query. Export the old
monitor's stored events. Then pause or delete the old monitor.

## Path parameters

<ParamField path="id" type="string" required>
  The unique keyword monitor 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

### 202 Accepted

<ResponseField name="deletionStatus" type="string">
  Returns `deleting` while cleanup runs.
</ResponseField>

<ResponseField name="statusUrl" type="string">
  Poll this URL until it returns `404`.
</ResponseField>

<ResponseField name="success" type="boolean">
  Always `true` when deletion starts.
</ResponseField>

```json theme={null}
{
  "deletionStatus": "deleting",
  "statusUrl": "/api/v1/monitors/keywords/21",
  "success": true
}
```

The response includes `Location` and `Retry-After` headers. Poll `Location`
after the stated interval.

### 400 Invalid ID

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

The provided monitor 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": "Monitor not found" }
```

No keyword monitor exists with this ID, or it belongs to a different account.

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

## Deletion handoff

Use this endpoint when a keyword query should stop permanently. Use
[Update Keyword Monitor](/api-reference/monitors/update-keyword) with
`isActive: false` when you only need to pause alerts and keep the monitor
available.

<CardGroup cols={2}>
  <Card title="Permanent remove" icon="trash-2">
    Delete stops the monitor immediately. Poll `statusUrl` until it returns
    `404`. You cannot update or resume the deleted ID.
  </Card>

  <Card title="Stored history" icon="database">
    Xquik removes stored events and webhook delivery records for this monitor
    in batches. Export required records before deletion.
  </Card>

  <Card title="Pause instead" icon="circle-pause">
    Use `PATCH /monitors/keywords/{id}` with `isActive: false` to stop future
    polling, alerts, and hourly billing. The monitor record stays.
  </Card>

  <Card title="Verify removal" icon="list-checks">
    Call [List Keyword Monitors](/api-reference/monitors/list-keywords) after
    deletion. [Get Keyword Monitor](/api-reference/monitors/get-keyword) should
    return `404` for the deleted ID.
  </Card>

  <Card title="Track new query" icon="search">
    Create a new keyword monitor when the X search query changes. Store the new
    `id`, `query`, `eventTypes`, `isActive`, and `nextBillingAt`.
  </Card>

  <Card title="Webhook reuse" icon="webhook">
    Existing webhook endpoints remain configured. Keep their `eventTypes`
    aligned, then run [Test Webhook](/api-reference/webhooks/test) before
    relying on new keyword monitor alerts.
  </Card>
</CardGroup>

<Info>
  Xquik deletes the keyword monitor and its stored events. Pause with `isActive: false` if you want to stop new checks without deleting the monitor.
</Info>

<Note>
  **Related.** [List Keyword Monitors](/api-reference/monitors/list-keywords) to verify removal, or [Create Keyword Monitor](/api-reference/monitors/create-keyword) to track a new query.
</Note>


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