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

> Delete an account monitor, stop tracking the X account, and remove its stored events

<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** - does not consume credits
</Callout>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://xquik.com/api/v1/monitors/7 \
    -H "x-api-key: xq_YOUR_KEY_HERE" |
    jq -c '{
      monitor_id: "7",
      success: .success == true,
      verify_endpoint: "/api/v1/monitors/7",
      list_endpoint: "/api/v1/monitors",
      events_endpoint: "/api/v1/events?monitorId=7",
      event_detail_endpoint_pattern: "/api/v1/events/{event_id}",
      webhooks_endpoint: "/api/v1/webhooks",
      deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries"
    }'
  ```

  ```javascript Node.js theme={null}
  const monitorId = "7";
  const response = await fetch(`https://xquik.com/api/v1/monitors/${monitorId}`, {
    method: "DELETE",
    headers: {
      "x-api-key": "xq_YOUR_KEY_HERE",
    },
  });
  const result = await response.json();
  const deletionReceipt = {
    monitor_id: monitorId,
    success: result.success === true,
    verify_endpoint: `/api/v1/monitors/${monitorId}`,
    list_endpoint: "/api/v1/monitors",
    events_endpoint: `/api/v1/events?monitorId=${monitorId}`,
    event_detail_endpoint_pattern: "/api/v1/events/{event_id}",
    webhooks_endpoint: "/api/v1/webhooks",
    deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries",
  };
  process.stdout.write(`${JSON.stringify(deletionReceipt)}\n`);
  ```

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

  monitor_id = "7"
  response = requests.delete(
      f"https://xquik.com/api/v1/monitors/{monitor_id}",
      headers={"x-api-key": "xq_YOUR_KEY_HERE"},
  )
  result = response.json()
  deletion_receipt = {
      "monitor_id": monitor_id,
      "success": result["success"] is True,
      "verify_endpoint": f"/api/v1/monitors/{monitor_id}",
      "list_endpoint": "/api/v1/monitors",
      "events_endpoint": f"/api/v1/events?monitorId={monitor_id}",
      "event_detail_endpoint_pattern": "/api/v1/events/{event_id}",
      "webhooks_endpoint": "/api/v1/webhooks",
      "deliveries_endpoint_pattern": "/api/v1/webhooks/{webhook_id}/deliveries",
  }
  print(json.dumps(deletion_receipt))
  ```

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

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

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

  type AccountMonitorDeletion struct {
      MonitorID                 string `json:"monitor_id"`
      Success                   bool   `json:"success"`
      VerifyEndpoint            string `json:"verify_endpoint"`
      ListEndpoint              string `json:"list_endpoint"`
      EventsEndpoint            string `json:"events_endpoint"`
      EventDetailEndpointPattern string `json:"event_detail_endpoint_pattern"`
      WebhooksEndpoint          string `json:"webhooks_endpoint"`
      DeliveriesEndpointPattern string `json:"deliveries_endpoint_pattern"`
  }

  func main() {
      monitorID := "7"
      req, err := http.NewRequest(
          "DELETE",
          "https://xquik.com/api/v1/monitors/"+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 := AccountMonitorDeletion{
          MonitorID:                 monitorID,
          Success:                   result.Success,
          VerifyEndpoint:            "/api/v1/monitors/" + monitorID,
          ListEndpoint:              "/api/v1/monitors",
          EventsEndpoint:            "/api/v1/events?monitorId=" + monitorID,
          EventDetailEndpointPattern: "/api/v1/events/{event_id}",
          WebhooksEndpoint:          "/api/v1/webhooks",
          DeliveriesEndpointPattern: "/api/v1/webhooks/{webhook_id}/deliveries",
      }
      if err := json.NewEncoder(os.Stdout).Encode(receipt); err != nil {
          log.Fatal(err)
      }
  }
  ```
</CodeGroup>

The cURL, Node.js, Python, and Go examples convert the delete response into one
receipt row. Store `monitor_id`, `success`, `verify_endpoint`, `list_endpoint`,
`events_endpoint`, `event_detail_endpoint_pattern`, `webhooks_endpoint`, and
`deliveries_endpoint_pattern`, then verify that the deleted ID no longer appears
in the list and that the verify endpoint returns `404`.

## Path parameters

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

<Tabs>
  <Tab title="200 OK">
    <ResponseField name="success" type="boolean">Always `true` on successful deletion.</ResponseField>

    ```json theme={null}
    { "success": true }
    ```
  </Tab>

  <Tab title="400 Invalid ID">
    ```json theme={null}
    { "error": "invalid_id", "message": "Invalid ID format." }
    ```

    The provided monitor ID is not a valid format.
  </Tab>

  <Tab title="401 Unauthenticated">
    ```json theme={null}
    { "error": "unauthenticated", "message": "Missing or invalid API key" }
    ```

    Missing or invalid API key.
  </Tab>

  <Tab title="404 Not Found">
    ```json theme={null}
    { "error": "not_found", "message": "Monitor not found" }
    ```

    No monitor exists with this ID, or it belongs to a different account.
  </Tab>

  <Tab title="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.
  </Tab>
</Tabs>

## Deletion handoff

Use this endpoint when a tracked account should stop permanently. Use
[Update Monitor](/api-reference/monitors/update) 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 removes the account monitor. Store returned `success` before treating
    the deleted ID as permanently removed. The deleted ID cannot be fetched,
    updated, resumed, or billed again.
  </Card>

  <Card title="Stored History" icon="database">
    Stored events and webhook delivery records tied to this account monitor are
    removed with it. Export or reconcile records before deletion when support or
    audit workflows need history.
  </Card>

  <Card title="Event Audit" icon="list-tree">
    Use [List Events](/api-reference/events/list) before deletion to capture
    monitor events. Use [Get Event](/api-reference/events/get) when you need one
    event's full payload before removing the monitor.
  </Card>

  <Card title="Delivery Audit" icon="activity">
    Use [List Deliveries](/api-reference/webhooks/deliveries) before deletion
    when webhook delivery evidence must be retained. Join delivery
    `streamEventId` to event IDs. Do not use `x_event_id` as the delivery join
    key.
  </Card>

  <Card title="Pause Instead" icon="circle-pause">
    Use `PATCH /monitors/{id}` with `isActive: false` to stop future checks,
    alerts, and hourly billing while preserving the monitor record.
  </Card>

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

  <Card title="Track New Account" icon="user-plus">
    Create a new account monitor when the tracked account changes. Store the new
    `id`, `username`, `xUserId`, `eventTypes`, `isActive`, and `nextBillingAt`.
  </Card>

  <Card title="Webhook Reuse" icon="webhook">
    Existing webhook endpoints remain configured. Check
    [List Webhooks](/api-reference/webhooks/list), keep their `eventTypes`
    aligned, then run [Test Webhook](/api-reference/webhooks/test) before
    relying on new account monitor alerts.
  </Card>
</CardGroup>

<Info>
  The monitor is deleted and its stored events are removed with it. Pause with
  `isActive: false` if you want to stop new checks without deleting the monitor.
</Info>

<Note>
  **Related:** [List Monitors](/api-reference/monitors/list) to verify the monitor was removed, [Get Monitor](/api-reference/monitors/get) to confirm `404`, [List Events](/api-reference/events/list) and [Get Event](/api-reference/events/get) to preserve event evidence, [List Webhooks](/api-reference/webhooks/list) and [List Deliveries](/api-reference/webhooks/deliveries) to retain delivery evidence, or [Create Monitor](/api-reference/monitors/create) to set up a new one.
</Note>
