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

# Get a webhook delivery payload

> Returns the retained JSON request body for one delivery attempt. Payloads are retained for 7 days and may no longer be available after `payload_expires_at`.



## OpenAPI

````yaml /openapi-app.json get /webhooks/{public_id}/deliveries/{delivery_id}/payload
openapi: 3.1.0
info:
  description: Programmatic access to your Qubrics email infrastructure.
  title: Qubrics API
  version: 1.0.0
servers:
  - description: API v1
    url: https://app.qubrics.com/api/v1
security:
  - bearerAuth: []
  - oauth2: []
paths:
  /webhooks/{public_id}/deliveries/{delivery_id}/payload:
    get:
      tags:
        - Webhooks
      summary: Get a webhook delivery payload
      description: >-
        Returns the retained JSON request body for one delivery attempt.
        Payloads are retained for 7 days and may no longer be available after
        `payload_expires_at`.
      operationId: managementGetDeliveryPayload
      parameters:
        - in: path
          name: public_id
          required: true
          schema:
            description: Webhook public ID
            type: string
        - in: path
          name: delivery_id
          required: true
          schema:
            description: Delivery-attempt public ID
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookDeliveryPayloadResponse'
          description: Delivery payload
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Authentication required
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Insufficient permissions
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Delivery not found or payload no longer available
      security:
        - bearerAuth: []
        - oauth2:
            - webhook.read
components:
  schemas:
    WebhookDeliveryPayloadResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - properties:
            data:
              $ref: '#/components/schemas/WebhookDeliveryPayload'
            meta:
              $ref: '#/components/schemas/ResponseMeta'
          required:
            - data
          type: object
      unevaluatedProperties: false
    ApiError:
      additionalProperties: false
      properties:
        error:
          additionalProperties: false
          properties:
            code:
              description: Machine-readable error code
              enum:
                - invalid_parameter
                - missing_parameter
                - authentication_required
                - insufficient_permissions
                - not_found
                - conflict
                - limit_exceeded
                - idempotency_conflict
                - payload_too_large
                - validation_error
                - rate_limit_exceeded
                - service_unavailable
                - internal_error
              example: invalid_parameter
              type: string
            doc_url:
              description: Link to relevant documentation
              type: string
            errors:
              description: >-
                Accumulated per-field issues for validation errors. Only present
                on 400/422 responses.
              items:
                $ref: '#/components/schemas/ApiErrorDetail'
              type: array
            message:
              description: Human-readable error description
              type: string
            param:
              description: The parameter that caused the error
              type: string
            retryable:
              description: >-
                Whether the caller may safely retry this request. 4xx are
                typically false (except 429); 5xx are typically true.
              example: false
              type: boolean
          required:
            - code
            - message
            - retryable
          type: object
        meta:
          additionalProperties: false
          properties:
            request_id:
              example: req_clxxxxxxxxxxxxxxxxxxxxxxxxx
              type: string
          required:
            - request_id
          type: object
        ok:
          enum:
            - false
          type: boolean
      required:
        - ok
        - error
        - meta
      type: object
    SuccessEnvelope:
      properties:
        meta:
          additionalProperties: {}
          properties: {}
          type: object
        ok:
          enum:
            - true
          type: boolean
      required:
        - ok
        - meta
      type: object
    WebhookDeliveryPayload:
      additionalProperties: false
      properties:
        created_at:
          description: ISO 8601 attempt timestamp
          example: '2026-05-21T09:12:00Z'
          type: string
        delivery_attempt:
          description: 1-based retry attempt number.
          example: 1
          exclusiveMinimum: 0
          type: integer
        event_id:
          description: Webhook event ID
          example: evt_clxxxxxxxxxxxxxxxxxxxxxxxxx
          type: string
        event_type:
          description: >-
            Event types a webhook may subscribe to. `sendmux.test` is accepted
            so you can verify end-to-end delivery via POST /webhooks/{id}/test.
          enum:
            - message.delivered
            - message.bounced
            - message.complained
            - message.rejected
            - message.delivery_delayed
            - message.received
            - message.received.spam
            - calendar.changed
            - sendmux.test
          example: message.bounced
          type: string
        expires_at:
          description: Timestamp when this retained payload expires.
          example: '2026-05-28T09:12:00Z'
          type: string
        id:
          description: Delivery-attempt public ID
          example: whda_clxxxxxxxxxxxxxxxxxxxxxxxxx
          type: string
        payload:
          $ref: '#/components/schemas/WebhookEventPayload'
      required:
        - id
        - event_id
        - event_type
        - delivery_attempt
        - created_at
        - expires_at
        - payload
      type: object
    ResponseMeta:
      additionalProperties: false
      properties:
        request_id:
          example: req_clxxxxxxxxxxxxxxxxxxxxxxxxx
          type: string
      required:
        - request_id
      type: object
    ApiErrorDetail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Machine-readable issue code from the validator (e.g. zod issue
            code).
          example: invalid_string
          type: string
        field:
          description: Dot-path of the offending request field.
          example: recipient.email
          type: string
        message:
          description: Human-readable issue description.
          type: string
      required:
        - field
        - code
        - message
      type: object
    WebhookEventPayload:
      description: The JSON request body delivered to the webhook endpoint.
      discriminator:
        mapping:
          calendar.changed: '#/components/schemas/CalendarWebhookEventPayload'
          message.bounced: '#/components/schemas/MailWebhookEventPayload'
          message.complained: '#/components/schemas/MailWebhookEventPayload'
          message.delivered: '#/components/schemas/MailWebhookEventPayload'
          message.delivery_delayed: '#/components/schemas/MailWebhookEventPayload'
          message.received: '#/components/schemas/MailWebhookEventPayload'
          message.received.spam: '#/components/schemas/MailWebhookEventPayload'
          message.rejected: '#/components/schemas/MailWebhookEventPayload'
          sendmux.test: '#/components/schemas/MailWebhookEventPayload'
        propertyName: type
      example:
        data:
          bounce_subtype: null
          bounce_type: null
          complaint_subtype: null
          complaint_type: null
          delay_expires_at: null
          delay_type: null
          is_spam: false
          mailbox_id: mbx_123
          message_id: ME3P282MB076951B3AAD3255D686EA8EDCA0F2@example.com
          message_id_kind: rfc5322
          qubrics_message_id: null
          recipients:
            - inbox@example.com
          reject_reason: null
          sender: sender@example.com
          sendmux_message_id: null
          webhook_id: null
        id: evt_clxxxxxxxxxxxxxxxxxxxxxxxxx
        occurred_at: '2026-05-21T09:12:00Z'
        team_public_id: team_clxxxxxxxxxxxxxxxxxxxxxxxxx
        type: message.received
      oneOf:
        - $ref: '#/components/schemas/MailWebhookEventPayload'
        - $ref: '#/components/schemas/CalendarWebhookEventPayload'
    CalendarWebhookEventPayload:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/CalendarWebhookEventData'
        id:
          description: >-
            Stable per-event identifier. Also sent in the X-Qubrics-Event-Id and
            X-Sendmux-Event-Id headers.
          example: evt_clxxxxxxxxxxxxxxxxxxxxxxxxx
          type: string
        occurred_at:
          description: When the event occurred.
          example: '2026-05-21T09:12:00Z'
          type: string
        team_public_id:
          description: Team that owns the event.
          example: team_clxxxxxxxxxxxxxxxxxxxxxxxxx
          type: string
        type:
          enum:
            - calendar.changed
          type: string
      required:
        - id
        - type
        - team_public_id
        - occurred_at
        - data
      type: object
    MailWebhookEventPayload:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/WebhookEventData'
        id:
          description: >-
            Stable per-event identifier. Also sent in the X-Qubrics-Event-Id and
            X-Sendmux-Event-Id headers.
          example: evt_clxxxxxxxxxxxxxxxxxxxxxxxxx
          type: string
        occurred_at:
          description: When the event occurred.
          example: '2026-05-21T09:12:00Z'
          type: string
        team_public_id:
          description: Team that owns the event.
          example: team_clxxxxxxxxxxxxxxxxxxxxxxxxx
          type: string
        type:
          description: >-
            Dotted event type. Same value as the X-Qubrics-Event-Type and
            X-Sendmux-Event-Type headers.
          enum:
            - message.delivered
            - message.bounced
            - message.complained
            - message.rejected
            - message.delivery_delayed
            - message.received
            - message.received.spam
            - sendmux.test
          example: message.received
          type: string
      required:
        - id
        - type
        - team_public_id
        - occurred_at
        - data
      type: object
    CalendarWebhookEventData:
      additionalProperties: false
      properties:
        created:
          items:
            description: Opaque identifier scoped to the selected mailbox.
            maxLength: 4096
            minLength: 1
            pattern: ^[A-Za-z0-9_-]+$
            type: string
          maxItems: 100
          type: array
        destroyed:
          items:
            description: Opaque identifier scoped to the selected mailbox.
            maxLength: 4096
            minLength: 1
            pattern: ^[A-Za-z0-9_-]+$
            type: string
          maxItems: 100
          type: array
        has_more:
          type: boolean
        mailbox_id:
          type: string
        new_state:
          description: Opaque identifier scoped to the selected mailbox.
          maxLength: 4096
          minLength: 1
          pattern: ^[A-Za-z0-9_-]+$
          type: string
        old_state:
          description: Opaque identifier scoped to the selected mailbox.
          maxLength: 4096
          minLength: 1
          pattern: ^[A-Za-z0-9_-]+$
          type: string
        resource:
          enum:
            - calendar
            - event
          type: string
        sync_required:
          type: boolean
        updated:
          items:
            description: Opaque identifier scoped to the selected mailbox.
            maxLength: 4096
            minLength: 1
            pattern: ^[A-Za-z0-9_-]+$
            type: string
          maxItems: 100
          type: array
      required:
        - mailbox_id
        - resource
        - created
        - updated
        - destroyed
        - old_state
        - new_state
        - has_more
        - sync_required
      type: object
    WebhookEventData:
      additionalProperties: false
      properties:
        bounce_subtype:
          description: More specific bounce category when available.
          example: null
          type:
            - string
            - 'null'
        bounce_type:
          description: Bounce category for `message.bounced` events.
          enum:
            - Permanent
            - Transient
            - Undetermined
          example: null
          type:
            - string
            - 'null'
        complaint_subtype:
          description: More specific complaint category when available.
          example: null
          type:
            - string
            - 'null'
        complaint_type:
          description: Complaint category for `message.complained` events.
          example: null
          type:
            - string
            - 'null'
        delay_expires_at:
          description: When delivery retries are expected to stop, when provided.
          example: null
          type:
            - string
            - 'null'
        delay_type:
          description: Delay category for `message.delivery_delayed` events.
          example: null
          type:
            - string
            - 'null'
        is_spam:
          description: Only populated for inbound mailbox events.
          example: false
          type:
            - boolean
            - 'null'
        mailbox_id:
          description: Mailbox public ID for inbound mailbox events when resolved.
          example: mbx_123
          type:
            - string
            - 'null'
        message_id:
          description: Message identifier from the event source.
          example: ME3P282MB076951B3AAD3255D686EA8EDCA0F2@example.com
          type:
            - string
            - 'null'
        message_id_kind:
          description: >-
            `provider` for sending feedback IDs; `rfc5322` for inbound email
            Message-ID header values.
          enum:
            - provider
            - rfc5322
          example: rfc5322
          type:
            - string
            - 'null'
        qubrics_message_id:
          description: >-
            Qubrics message correlation ID, equal to sendmux_message_id. May be
            absent from older retained events.
          example: null
          type:
            - string
            - 'null'
        recipients:
          description: All affected recipients. Empty for synthetic test events.
          example:
            - inbox@example.com
          items:
            type: string
          type: array
        reject_reason:
          description: Reject reason for `message.rejected` events.
          example: null
          type:
            - string
            - 'null'
        sender:
          description: Sender/envelope-from address when available.
          example: sender@example.com
          type:
            - string
            - 'null'
        sendmux_message_id:
          description: >-
            Compatibility alias of qubrics_message_id for outbound sending
            feedback.
          example: null
          type:
            - string
            - 'null'
        webhook_id:
          description: Target webhook ID for synthetic `sendmux.test` payloads.
          example: null
          type:
            - string
            - 'null'
      required:
        - message_id
        - message_id_kind
        - sendmux_message_id
        - sender
        - recipients
        - mailbox_id
        - bounce_type
        - bounce_subtype
        - complaint_type
        - complaint_subtype
        - reject_reason
        - delay_type
        - delay_expires_at
        - is_spam
        - webhook_id
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: API Key
      description: >-
        Qubrics API key. Use a root API key for Management API routes, or a
        mailbox credential for Mailbox API routes. Obtain keys from the
        dashboard under API Keys.
      scheme: bearer
      type: http
    oauth2:
      description: >-
        Use the authorisation-code flow with S256 PKCE and
        resource=https://qubrics.com/api. The user selects the team, API access
        and mailboxes during consent. OAuth access tokens authenticate HTTP API
        requests; use separate credentials for SMTP and IMAP.
      flows:
        authorizationCode:
          authorizationUrl: https://app.qubrics.com/oauth/authorize
          refreshUrl: https://app.qubrics.com/oauth/token
          scopes:
            analytics.*: All analytics operations
            analytics.read: View key usage analytics and verification logs
            billing.*: All billing operations
            billing.auto_topup: Configure auto top-up settings
            billing.read: View balance, transactions, invoices
            billing.topup: Purchase balance top-ups
            calendar.read: Read calendars and events in this mailbox
            calendar.write: >-
              Create calendars and create, edit and delete events in this
              mailbox
            domain.*: All domain operations
            domain.create: Add sending domains
            domain.delete: Remove domains
            domain.read: List/view domains and DNS status
            domain.verify: Trigger domain verification
            email.receive: Authorise email reception
            email.send: Send email through the HTTP API
            key.*: All key management operations
            key.create: Create new API keys (both root and mailbox)
            key.read: List/view API keys and their metadata
            key.revoke: Revoke API keys
            key.rotate: Rotate API keys
            logs.*: All log operations
            logs.read: View delivery logs
            mailbox.admin.*: All mailbox admin operations
            mailbox.admin.create: Create mailboxes (admin-level)
            mailbox.admin.delete: Delete mailboxes (admin-level)
            mailbox.admin.manage: Manage all mailbox settings
            mailbox.admin.read: List/view mailboxes (admin-level)
            mailbox.drafts.write: Create and edit saved mailbox drafts
            mailbox.read: Read mailbox contents (folders, messages)
            mailbox.settings.update: Update own mailbox settings (signature, auto-reply)
            provider.*: All provider operations
            provider.create: Add email provider accounts (Google, Microsoft, SMTP)
            provider.delete: Remove provider accounts
            provider.read: List/view provider accounts and connection status
            provider.update: Update provider settings, refresh tokens
            routing.*: All routing operations
            routing.create: Create delivery groups
            routing.delete: Remove delivery groups
            routing.read: List/view delivery groups and routing rules
            routing.update: Update delivery group configuration
            team.*: All team operations
            team.members.invite: Invite team members
            team.members.remove: Remove team members
            team.members.roles: Change member roles
            team.read: View team settings and members
            team.update: Update team settings
            webhook.*: All webhook operations
            webhook.create: Create webhook subscriptions
            webhook.delete: Delete webhook subscriptions
            webhook.manage: Rotate signing secret + send test events
            webhook.read: List/view webhook subscriptions
            webhook.update: Update webhook URL, event types, enabled flag
          tokenUrl: https://app.qubrics.com/oauth/token
      type: oauth2

````

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