> ## Documentation Index
> Fetch the complete documentation index at: https://trigger.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel a webhook waiter

> **Private beta:** [request access](https://trigger.dev/webhooks-beta) to use webhooks.
Cancel a waiter. It stops matching deliveries, frees its slot toward the endpoint's limit, and fails the run's wait. If a delivery already claimed the waiter, the cancel is too late: the response has `cancelled: false` with `reason: "too_late"`, and the run resumes with that delivery's event.



## OpenAPI

````yaml v3-openapi POST /api/v1/webhooks/waiters/{waiterId}/cancel
openapi: 3.1.0
info:
  title: Trigger.dev v3 REST API
  description: >-
    The REST API lets you trigger and manage runs on Trigger.dev. You can
    trigger a run, get the status of a run, and get the results of a run. 
  version: 2024-04
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.trigger.dev
    description: Trigger.dev API
security: []
paths:
  /api/v1/webhooks/waiters/{waiterId}/cancel:
    parameters:
      - in: path
        name: waiterId
        required: true
        schema:
          type: string
        description: The waiter's id, which is also its waitpoint id.
        example: waitpoint_abc123
    post:
      tags:
        - webhooks
      summary: Cancel a webhook waiter
      description: >-
        **Private beta:** [request access](https://trigger.dev/webhooks-beta) to
        use webhooks.

        Cancel a waiter. It stops matching deliveries, frees its slot toward the
        endpoint's limit, and fails the run's wait. If a delivery already
        claimed the waiter, the cancel is too late: the response has `cancelled:
        false` with `reason: "too_late"`, and the run resumes with that
        delivery's event.
      operationId: cancel_webhook_waiter_v1
      responses:
        '200':
          description: Successful request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelWebhookWaiterResponse'
        '401':
          description: Unauthorized request
        '404':
          description: Waiter not found
      security:
        - secretKey: []
      x-codeSamples:
        - lang: typescript
          source: |-
            import { webhooks } from "@trigger.dev/sdk";

            const result = await webhooks.waiter.cancel(waiterId);
            if (!result.cancelled) {
              console.log("Already resumed by", result.deliveryId);
            }
        - lang: curl
          label: Cancel a webhook waiter
          source: >-
            curl -X POST
            "https://api.trigger.dev/api/v1/webhooks/waiters/waitpoint_abc123/cancel"
            \
              -H "Authorization: Bearer $TRIGGER_SECRET_KEY"
components:
  schemas:
    CancelWebhookWaiterResponse:
      type: object
      required:
        - cancelled
      properties:
        cancelled:
          type: boolean
        reason:
          type: string
          enum:
            - too_late
          description: >-
            Present when `cancelled` is `false`. A delivery already claimed the
            waiter.
        deliveryId:
          type: string
          description: With `too_late`, the delivery that resumed the run.
          example: whd_1234
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: >
        Use a named environment API key. It starts with `tr_dev_sk_`,
        `tr_prod_sk_`, `tr_stg_sk_`, etc.


        Create a named API key in the API Keys section of your Trigger.dev
        project dashboard. Choose the narrowest access preset that supports your
        integration.


        Our TypeScript SDK will default to using the value of the
        `TRIGGER_SECRET_KEY` environment variable if it is set. If you are using
        the SDK in a different environment, you can set the key using the
        `configure` function.


        ```typescript

        import { configure } from "@trigger.dev/sdk";


        configure({ accessToken: "tr_dev_sk_1234" });

        ```

````

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