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

# Retrieve a webhook delivery

> **Private beta:** [request access](https://trigger.dev/webhooks-beta) to use webhooks.
Retrieve one delivery: its status and error, the event body and headers it carried, and a `targets` entry per subscriber with the run or session it started or why its filter skipped the event. When the delivery resumed waiting runs, one more entry summarizes them.



## OpenAPI

````yaml v3-openapi GET /api/v1/webhooks/deliveries/{deliveryId}
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/deliveries/{deliveryId}:
    parameters:
      - $ref: '#/components/parameters/webhookDeliveryId'
    get:
      tags:
        - webhooks
      summary: Retrieve a webhook delivery
      description: >-
        **Private beta:** [request access](https://trigger.dev/webhooks-beta) to
        use webhooks.

        Retrieve one delivery: its status and error, the event body and headers
        it carried, and a `targets` entry per subscriber with the run or session
        it started or why its filter skipped the event. When the delivery
        resumed waiting runs, one more entry summarizes them.
      operationId: retrieve_webhook_delivery_v1
      responses:
        '200':
          description: Successful request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookDeliveryObject'
        '401':
          description: Unauthorized request
        '404':
          description: Delivery not found
      security:
        - secretKey: []
      x-codeSamples:
        - lang: curl
          label: Retrieve a webhook delivery
          source: |-
            curl "https://api.trigger.dev/api/v1/webhooks/deliveries/whd_1234" \
              -H "Authorization: Bearer $TRIGGER_SECRET_KEY"
components:
  parameters:
    webhookDeliveryId:
      in: path
      name: deliveryId
      required: true
      schema:
        type: string
      description: The delivery's id, starts with `whd_`.
      example: whd_1234
  schemas:
    WebhookDeliveryObject:
      allOf:
        - $ref: '#/components/schemas/WebhookDeliveryListItem'
        - type: object
          required:
            - idempotencyKey
            - event
            - headers
            - rawBodyHash
            - error
            - filterReason
            - targets
            - updatedAt
          properties:
            idempotencyKey:
              type: string
              description: The key the delivery was deduplicated on.
            event:
              description: The verified event body, capped in size.
            headers:
              type:
                - object
                - 'null'
              additionalProperties:
                type: string
              description: >-
                The request headers, with credentials such as signatures
                removed.
            rawBodyHash:
              type:
                - string
                - 'null'
              description: A hash of the raw request body.
            error:
              type:
                - string
                - 'null'
              description: >-
                For a `failed` delivery, the error and the subscriber it came
                from.
            filterReason:
              type:
                - string
                - 'null'
              description: For a `filtered` delivery, why no subscriber took it.
            targets:
              type: array
              description: >-
                One entry per subscriber, plus a `waiter` entry when the
                delivery matched waiting runs.
              items:
                $ref: '#/components/schemas/WebhookDeliveryTarget'
            updatedAt:
              type: string
              format: date-time
    WebhookDeliveryListItem:
      type: object
      required:
        - id
        - endpoint
        - status
        - externalDeliveryId
        - isTest
        - createdAt
        - processedAt
      properties:
        id:
          type: string
          description: The delivery's id.
          example: whd_1234
        endpoint:
          type:
            - object
            - 'null'
          description: >-
            The endpoint the delivery arrived on, or `null` if it has since been
            removed.
          required:
            - id
            - declaredId
          properties:
            id:
              type: string
              example: wh_cm1a2b3c4d5e6f
            declaredId:
              type: string
              example: stripe
        status:
          $ref: '#/components/schemas/WebhookDeliveryStatus'
        externalDeliveryId:
          type: string
          description: >-
            The provider's id for the delivery, such as a Stripe event id or
            GitHub's `X-GitHub-Delivery` header.
          example: evt_1PqR2s3T4u5V6w
        isTest:
          type: boolean
          description: >-
            Whether the request carried an `x-trigger-test` header, as test
            sends from the dashboard do.
        createdAt:
          type: string
          format: date-time
        processedAt:
          type:
            - string
            - 'null'
          format: date-time
    WebhookDeliveryTarget:
      type: object
      required:
        - id
        - type
        - status
        - reason
        - error
        - runId
        - sessionId
        - waiters
      properties:
        id:
          type: string
          description: The subscriber id, or `waiters` for the waiting-runs summary.
          example: process-checkout
        type:
          type: string
          enum:
            - task
            - session
            - waiter
        status:
          type: string
          enum:
            - pending
            - succeeded
            - failed
            - filtered
        reason:
          type:
            - string
            - 'null'
          description: >-
            For a `filtered` target, the filter clause that failed and the value
            it saw.
        error:
          type:
            - string
            - 'null'
        runId:
          type:
            - string
            - 'null'
          description: The run the subscriber started.
          example: run_cm1a2b3c4d5e6f
        sessionId:
          type:
            - string
            - 'null'
          description: The session the event was routed into, for a `session` subscriber.
        waiters:
          type:
            - object
            - 'null'
          description: >-
            For the `waiter` summary, how many waiting runs matched, were
            resumed, and failed to resume.
          required:
            - matched
            - resumed
            - failed
          properties:
            matched:
              type: integer
            resumed:
              type: integer
            failed:
              type: integer
    WebhookDeliveryStatus:
      type: string
      enum:
        - pending
        - processing
        - succeeded
        - failed
        - filtered
        - unmatched
      description: >-
        `pending` is waiting to be routed (including after a retryable error),
        `processing` is being routed, `succeeded` reached at least one
        subscriber or waiting run with nothing failed, `failed` means a
        subscriber failed after its retries, `filtered` means no subscriber's
        filter took it, and `unmatched` means runs were waiting on the endpoint
        but none matched and no subscriber took it.
  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.