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

> Deactivate a webhook endpoint and stop all future deliveries

<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/webhooks/15 \
    -H "x-api-key: xq_YOUR_KEY_HERE" \
    | jq --arg webhook_id "15" '{
      webhook_id: $webhook_id,
      success,
      inventory_endpoint: "/api/v1/webhooks",
      deliveries_endpoint: ("/api/v1/webhooks/" + $webhook_id + "/deliveries")
    }'
  ```

  ```javascript Node.js theme={null}
  const webhookId = "15";
  const response = await fetch(`https://xquik.com/api/v1/webhooks/${webhookId}`, {
    method: "DELETE",
    headers: { "x-api-key": "xq_YOUR_KEY_HERE" },
  });
  const result = await response.json();
  const deactivationHandoff = {
    webhook_id: webhookId,
    success: result.success === true,
    inventory_endpoint: "/api/v1/webhooks",
    deliveries_endpoint: `/api/v1/webhooks/${webhookId}/deliveries`,
  };
  ```

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

  webhook_id = "15"
  response = requests.delete(
      f"https://xquik.com/api/v1/webhooks/{webhook_id}",
      headers={"x-api-key": "xq_YOUR_KEY_HERE"},
  )
  result = response.json()
  deactivation_handoff = {
      "webhook_id": webhook_id,
      "success": result["success"] is True,
      "inventory_endpoint": "/api/v1/webhooks",
      "deliveries_endpoint": f"/api/v1/webhooks/{webhook_id}/deliveries",
  }
  ```

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

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

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

  type DeactivationHandoff struct {
    DeliveriesEndpoint string `json:"deliveries_endpoint"`
    InventoryEndpoint  string `json:"inventory_endpoint"`
    Success            bool   `json:"success"`
    WebhookID          string `json:"webhook_id"`
  }

  func main() {
    webhookID := "15"
    req, err := http.NewRequest("DELETE", "https://xquik.com/api/v1/webhooks/"+webhookID, 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)
    }
    handoff := DeactivationHandoff{
      DeliveriesEndpoint: "/api/v1/webhooks/" + webhookID + "/deliveries",
      InventoryEndpoint:  "/api/v1/webhooks",
      Success:            result.Success,
      WebhookID:          webhookID,
    }
    _ = handoff
  }
  ```
</CodeGroup>

These snippets shape a deactivation receipt. Store the webhook ID with its
inventory and delivery-log endpoints instead of printing the raw delete
response.

## What delete does

`DELETE /webhooks/{id}` soft-deactivates the endpoint by setting `isActive` to
`false`. The webhook record stays available in
[List Webhooks](/api-reference/webhooks/list), and previous delivery rows stay
available in [List Deliveries](/api-reference/webhooks/deliveries).

The response is only `{ "success": true }`; it does not return the URL, event
types, or signing secret. To receive events again, call
[Update Webhook](/api-reference/webhooks/update) with `isActive: true`, then run
[Test Webhook](/api-reference/webhooks/test) before routing production monitor
events to the receiver.

## Path parameters

<ParamField path="id" type="string" required>
  The webhook ID to deactivate.
</ParamField>

## Headers

<ParamField header="x-api-key" type="string" required>
  Your API key. This endpoint also accepts session cookie authentication.
</ParamField>

## Response

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

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

    The webhook is deactivated immediately. Pending deliveries that are already in-flight may still be attempted, but no new deliveries will be queued.
  </Tab>

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

    Missing or invalid API key / session cookie.
  </Tab>

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

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

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

    No webhook 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>

## Deactivation handoff

Use this endpoint when a receiver should stop getting future monitor events but
you still need the webhook record and delivery history for audit or rollback.

<CardGroup cols={2}>
  <Card title="Soft Deactivate" icon="toggle-left">
    The endpoint sets `isActive` to `false` and returns `{ "success": true }`.
    It does not return the webhook configuration.
  </Card>

  <Card title="Future Deliveries" icon="ban">
    Inactive webhooks do not receive new monitor deliveries or scheduled retries.
    In-flight delivery attempts may still finish.
  </Card>

  <Card title="Audit Trail" icon="list-checks">
    Use [List Webhooks](/api-reference/webhooks/list) to confirm
    `webhooks[].isActive: false`, then use
    [List Deliveries](/api-reference/webhooks/deliveries) for prior delivery
    status, attempts, errors, and timestamps.
  </Card>

  <Card title="Delivery Audit" icon="activity">
    Delivery rows for inactive endpoints can show `pending`, `failed`, or
    `exhausted` attempts. Store `streamEventId`, `status`, `attempts`,
    `lastStatusCode`, `lastError`, `createdAt`, and `deliveredAt`.
  </Card>

  <Card title="Event Join" icon="link">
    Use delivery `streamEventId` as the `{id}` for
    [Get Event](/api-reference/events/get). Store `monitorId`, `monitorType`,
    `type`, `occurredAt`, and `data` with the deactivation record.
  </Card>

  <Card title="Receiver Cleanup" icon="route-off">
    Remove queue, CRM, alerting, or warehouse routing only after the endpoint is
    inactive and no more production events are expected.
  </Card>

  <Card title="Reactivate" icon="rotate-ccw">
    To reuse the same webhook, call
    [Update Webhook](/api-reference/webhooks/update) with `isActive: true`, then
    run [Test Webhook](/api-reference/webhooks/test).
  </Card>

  <Card title="Signing Secret" icon="shield-check">
    Delete returns no `secret`. Keep the original Create Webhook secret for
    audit records or future reactivation.
  </Card>
</CardGroup>

<Note>
  This endpoint supports **dual authentication**: API key (`x-api-key` header) or session cookie from the dashboard.

  **Related:** [List Webhooks](/api-reference/webhooks/list) · [Update Webhook](/api-reference/webhooks/update) · [Test Webhook](/api-reference/webhooks/test) · [List Deliveries](/api-reference/webhooks/deliveries) · [Get Event](/api-reference/events/get) · [Create Webhook](/api-reference/webhooks/create)
</Note>
