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

# Get Webhook Delivery

> Inspect a webhook event, endpoint, and every delivery attempt.

The response includes the delivery summary, source `event`, endpoint metadata,
and chronological `attempts`.

Each attempt can include its HTTP status, duration, next retry time, a safe set
of response headers, and up to 16 KiB of response body. Response headers and
bodies are removed after 30 days.

<Warning>
  Do not return credentials, session cookies, personal data, or other secrets in
  your webhook response body. Response content appears in delivery logs.
</Warning>


## OpenAPI

````yaml reference/openapi.json GET /webhooks/deliveries/{delivery_id}
openapi: 3.0.0
info:
  title: Unifystays API
  description: >-
    One unified hotel API across suppliers. Integrate once, then enable and
    manage suppliers from the Unifystays portal.
  version: '1.0'
  contact: {}
servers:
  - url: https://api-sandbox.unifystays.com
    description: Sandbox
  - url: https://api.unifystays.com
    description: Production
security:
  - x-api-key: []
tags: []
paths:
  /webhooks/deliveries/{delivery_id}:
    get:
      tags:
        - Webhooks
      summary: Get a delivery and its attempts
      description: >-
        Returns the delivery, source event, endpoint snapshot, and chronological
        attempt log.
      operationId: WebhookController_getDelivery
      parameters:
        - name: delivery_id
          required: true
          in: path
          description: Numeric webhook delivery ID.
          schema:
            example: '1842'
            type: string
        - name: language
          description: Enter language code(ex. en)
          in: header
          schema: {}
      responses:
        '200':
          description: Webhook delivery and attempt history retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookDeliveryDetailResponseDto'
components:
  schemas:
    WebhookDeliveryDetailResponseDto:
      type: object
      properties:
        id:
          type: string
          example: '1842'
          description: Numeric delivery ID.
        org_id:
          type: string
          example: org_123
          description: Owning organization ID.
        event_id:
          type: string
          example: evt_3bc2fa3d35cc4bbf98359b3fb85a4fb2
          description: Source event ID.
        endpoint_id:
          type: string
          format: uuid
          example: 8b95a9e0-4af3-4c6d-92df-84b64256d27f
          description: Destination endpoint ID.
        status:
          type: string
          enum:
            - PENDING
            - DELIVERING
            - RETRYING
            - SUCCEEDED
            - EXHAUSTED
            - CANCELLED
          example: SUCCEEDED
        attempt_count:
          type: number
          example: 1
          description: Attempts completed so far.
        max_attempts:
          type: number
          example: 8
          description: Maximum permitted attempts.
        next_attempt_at:
          type: string
          format: date-time
          example: '2026-08-08T08:30:00.100Z'
          description: Time the next attempt is eligible to run.
        locked_at:
          type: string
          format: date-time
          nullable: true
          example: null
          description: Time the worker claimed the delivery.
        locked_by:
          type: string
          nullable: true
          example: null
          description: Worker currently processing the delivery.
        last_http_status:
          type: number
          nullable: true
          example: 204
        last_error_code:
          type: string
          nullable: true
          example: null
        last_error_message:
          type: string
          nullable: true
          example: null
        last_duration_ms:
          type: number
          nullable: true
          example: 183
        completed_at:
          type: string
          format: date-time
          nullable: true
          example: '2026-08-08T08:30:00.283Z'
          description: Time the delivery reached a terminal state.
        created_at:
          type: string
          format: date-time
          example: '2026-08-08T08:30:00.000Z'
        updated_at:
          type: string
          format: date-time
          example: '2026-08-08T08:30:00.000Z'
        event:
          nullable: true
          description: Immutable source event and exact delivered payload.
          allOf:
            - $ref: '#/components/schemas/WebhookEventResponseDto'
        endpoint:
          nullable: true
          description: Current endpoint metadata without signing secrets.
          allOf:
            - $ref: '#/components/schemas/WebhookEndpointResponseDto'
        attempts:
          description: Delivery attempts ordered by attempt number.
          type: array
          items:
            $ref: '#/components/schemas/WebhookDeliveryAttemptResponseDto'
      required:
        - id
        - org_id
        - event_id
        - endpoint_id
        - status
        - attempt_count
        - max_attempts
        - next_attempt_at
        - locked_at
        - locked_by
        - last_http_status
        - last_error_code
        - last_error_message
        - last_duration_ms
        - completed_at
        - created_at
        - updated_at
        - event
        - endpoint
        - attempts
    WebhookEventResponseDto:
      type: object
      properties:
        id:
          type: string
          example: evt_3bc2fa3d35cc4bbf98359b3fb85a4fb2
          description: Immutable webhook event identifier.
        org_id:
          type: string
          example: org_123
          description: Organization that owns the event.
        event_type:
          type: string
          enum:
            - booking.created
            - booking.confirmed
            - booking.failed
            - booking.cancellation_requested
            - booking.cancelled
            - booking.cancellation_failed
            - webhook.test
          example: booking.confirmed
          description: Event type used for endpoint subscription matching.
        schema_version:
          type: number
          example: 1
          description: Event schema version.
        aggregate_type:
          type: string
          example: booking
          description: Resource category associated with the event.
        aggregate_id:
          type: string
          example: ubk_eGQ0dW9uV1Vi
          description: Identifier of the associated resource.
        aggregate_version:
          type: number
          example: 2
          description: >-
            Monotonically increasing resource version used to handle
            out-of-order events.
        payload:
          description: Exact JSON body sent to the receiver.
          allOf:
            - $ref: '#/components/schemas/WebhookPayloadResponseDto'
        occurred_at:
          type: string
          format: date-time
          example: '2026-08-08T08:30:00.000Z'
          description: Time the source event occurred.
        fanout_at:
          type: string
          format: date-time
          nullable: true
          example: '2026-08-08T08:30:00.100Z'
          description: Time endpoint delivery records were created.
        created_at:
          type: string
          format: date-time
          example: '2026-08-08T08:30:00.000Z'
          description: Event record creation time.
      required:
        - id
        - org_id
        - event_type
        - schema_version
        - aggregate_type
        - aggregate_id
        - aggregate_version
        - payload
        - occurred_at
        - fanout_at
        - created_at
    WebhookEndpointResponseDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 8b95a9e0-4af3-4c6d-92df-84b64256d27f
          description: Unique webhook endpoint identifier.
        name:
          type: string
          example: Production booking events
          description: Human-readable endpoint name.
        url:
          type: string
          format: uri
          example: https://example.com/webhooks/unifystays
          description: URL that receives signed webhook POST requests.
        status:
          type: string
          enum:
            - ACTIVE
            - PAUSED
            - DISABLED
          example: ACTIVE
          description: >-
            Current endpoint state. Paused and disabled endpoints do not receive
            new deliveries.
        event_types:
          type: array
          example:
            - booking.confirmed
            - booking.cancelled
          description: Normalized event subscriptions for this endpoint.
          items:
            type: string
            enum:
              - booking.created
              - booking.confirmed
              - booking.failed
              - booking.cancellation_requested
              - booking.cancelled
              - booking.cancellation_failed
              - booking.*
        consecutive_failures:
          type: number
          example: 0
          description: >-
            Consecutive delivery failures since the last success or
            reactivation.
        last_success_at:
          type: string
          format: date-time
          nullable: true
          example: '2026-08-08T08:30:00.000Z'
          description: Time of the most recent successful delivery, if any.
        last_failure_at:
          type: string
          format: date-time
          nullable: true
          example: null
          description: Time of the most recent failed delivery, if any.
        disabled_at:
          type: string
          format: date-time
          nullable: true
          example: null
          description: Time the endpoint was disabled, if applicable.
        disabled_reason:
          type: string
          nullable: true
          example: null
          description: Reason the endpoint was disabled, if applicable.
        created_at:
          type: string
          format: date-time
          example: '2026-08-08T08:00:00.000Z'
          description: Endpoint creation time.
        updated_at:
          type: string
          format: date-time
          example: '2026-08-08T08:30:00.000Z'
          description: Time the endpoint was last updated.
      required:
        - id
        - name
        - url
        - status
        - event_types
        - consecutive_failures
        - last_success_at
        - last_failure_at
        - disabled_at
        - disabled_reason
        - created_at
        - updated_at
    WebhookDeliveryAttemptResponseDto:
      type: object
      properties:
        id:
          type: string
          example: '9231'
          description: Numeric attempt ID.
        org_id:
          type: string
          example: org_123
          description: Owning organization ID.
        delivery_id:
          type: string
          example: '1842'
          description: Parent delivery ID.
        attempt_number:
          type: number
          example: 1
          description: One-based attempt number.
        started_at:
          type: string
          format: date-time
          example: '2026-08-08T08:30:00.100Z'
          description: Time the outbound request started.
        ended_at:
          type: string
          format: date-time
          example: '2026-08-08T08:30:00.283Z'
          description: Time the attempt finished.
        duration_ms:
          type: number
          example: 183
          description: Attempt duration in milliseconds.
        response_status:
          type: number
          nullable: true
          example: 204
          description: Receiver HTTP status, or null when no response was received.
        response_headers:
          type: object
          additionalProperties:
            type: string
          nullable: true
          example:
            x-request-id: receiver_req_123
          description: Safe response headers retained for debugging for 30 days.
        response_body:
          type: string
          nullable: true
          example: null
          description: Up to 16 KiB of receiver response body, retained for 30 days.
        response_body_truncated:
          type: boolean
          example: false
          description: Whether the stored response body exceeded the 16 KiB limit.
        error_code:
          type: string
          nullable: true
          example: null
          description: Machine-readable delivery error code.
        error_message:
          type: string
          nullable: true
          example: null
          description: Safe delivery error message.
        next_retry_at:
          type: string
          format: date-time
          nullable: true
          example: null
          description: Scheduled retry time, or null when no retry remains.
        created_at:
          type: string
          format: date-time
          example: '2026-08-08T08:30:00.283Z'
          description: Attempt record creation time.
      required:
        - id
        - org_id
        - delivery_id
        - attempt_number
        - started_at
        - ended_at
        - duration_ms
        - response_status
        - response_headers
        - response_body
        - response_body_truncated
        - error_code
        - error_message
        - next_retry_at
        - created_at
    WebhookPayloadResponseDto:
      type: object
      properties:
        id:
          type: string
          example: evt_3bc2fa3d35cc4bbf98359b3fb85a4fb2
          description: Event identifier used for idempotent processing.
        type:
          type: string
          enum:
            - booking.created
            - booking.confirmed
            - booking.failed
            - booking.cancellation_requested
            - booking.cancelled
            - booking.cancellation_failed
            - webhook.test
          example: booking.confirmed
          description: Event type.
        schema_version:
          type: number
          example: 1
          description: Version of the webhook payload schema.
        created_at:
          type: string
          format: date-time
          example: '2026-08-08T08:30:00.000Z'
          description: Time the event occurred.
        organization_id:
          type: string
          example: org_123
          description: Organization that owns the event.
        data:
          type: object
          additionalProperties: true
          example:
            object:
              object: booking
              id: ubk_eGQ0dW9uV1Vi
              version: 2
              status: CONFIRMED
              is_terminal: true
            previous_status: PROCESSING
          description: >-
            Event-specific data. The object field contains the current resource
            snapshot.
      required:
        - id
        - type
        - schema_version
        - created_at
        - organization_id
        - data
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: Environment-specific API key created in the Unifystays portal

````