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

# Query webhook events

> Query webhook events with filtering. Returns webhook events that have been triggered for your account.



## OpenAPI

````yaml /openapi.json post /webhooks/query
openapi: 3.0.0
info:
  title: JetEmail API
  version: 1.0.0
  description: API documentation for JetEmail's transactional email service.
servers:
  - url: https://api.jetemail.com
    description: Production
security:
  - apiKeyAuth: []
externalDocs:
  description: Download OpenAPI Specification
  url: /openapi.json
paths:
  /webhooks/query:
    post:
      tags:
        - Webhooks
      summary: Query webhook events
      description: >-
        Query webhook events with filtering. Returns webhook events that have
        been triggered for your account.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                uuid:
                  type: string
                  format: uuid
                  description: Filter by webhook config UUID
                  example: a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d
                event_id:
                  type: string
                  description: Filter by specific event ID
                  example: evt_xyz789
                event_type:
                  type: string
                  enum:
                    - outbound.queued
                    - outbound.delivered
                    - outbound.bounced
                    - outbound.rejected
                    - outbound.deferred
                    - outbound.spam
                    - outbound.dropped
                    - outbound.virus
                    - outbound.opened
                    - outbound.clicked
                    - outbound.complaint
                    - inbound.received
                    - inbound.delivered
                    - inbound.spam
                    - inbound.blocked
                  description: Filter by event type
                  example: outbound.delivered
                source_uid:
                  type: string
                  description: Filter by source message UID
                  example: message-uid-123
                status:
                  type: string
                  enum:
                    - success
                    - failed
                    - retry
                    - pending
                  description: Filter by delivery status
                  example: success
                date_from:
                  type: integer
                  description: Filter from Unix timestamp
                  example: 1704825600
                date_to:
                  type: integer
                  description: Filter to Unix timestamp
                  example: 1704912000
                limit:
                  type: integer
                  minimum: 1
                  maximum: 1000
                  default: 50
                  description: Maximum results to return
                  example: 50
                offset:
                  type: integer
                  minimum: 0
                  default: 0
                  description: Pagination offset
                  example: 0
            examples:
              Query by webhook:
                value:
                  uuid: a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d
                  limit: 50
              Query by event type and date:
                value:
                  event_type: outbound.delivered
                  date_from: 1704825600
                  date_to: 1704912000
                  limit: 100
              Query failed deliveries:
                value:
                  status: failed
                  limit: 50
      responses:
        '200':
          description: Webhook events retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  events:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Event ID
                          example: evt_xyz789
                        uuid:
                          type: string
                          format: uuid
                          description: Webhook config UUID
                          example: a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d
                        service:
                          type: string
                          enum:
                            - outbound
                            - inbound
                          description: Service that triggered the event
                          example: outbound
                        event_type:
                          type: string
                          description: Event type
                          example: outbound.delivered
                        source_uid:
                          type: string
                          description: Source message UID
                          example: message-uid-123
                        source_action:
                          type: string
                          description: Original action or logtype
                          example: ACCEPTED
                        payload:
                          type: object
                          description: Event payload sent to webhook
                          example:
                            to: recipient@example.com
                            from: sender@example.com
                        webhook_url:
                          type: string
                          format: uri
                          description: Target webhook URL
                          example: https://example.com/webhook
                        created_at:
                          type: integer
                          description: Unix timestamp when event was created
                          example: 1704825600
                        latest_status:
                          type: string
                          enum:
                            - success
                            - failed
                            - retry
                          description: Latest delivery status
                          example: success
                        total_attempts:
                          type: integer
                          description: Total delivery attempts
                          example: 1
                        last_response_code:
                          type: integer
                          description: HTTP response code from last attempt
                          example: 200
                  total:
                    type: integer
                    description: Total number of matching events
                    example: 150
                  limit:
                    type: integer
                    description: Limit used for this query
                    example: 50
                  offset:
                    type: integer
                    description: Offset used for this query
                    example: 0
        '400':
          description: Bad request - Invalid input
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Invalid event_type
        '401':
          description: Unauthorized - User not authenticated
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: User authentication not found
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Failed to query webhook events
components:
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: API key for account management endpoints. Use your api_ prefixed token.

````