Skip to content

Event History

Query past notification events and resend failed notifications.

Query Events

Retrieve a paginated list of notification events with optional filtering.

Request

GET /v1/event_history

curl Example

bash
curl -X GET "https://api.notifications.paynetworx.cloud/v1/event_history?subscription_id=9603F4B2-1874-42FE-A2BC-F7B45C45A9D6&event_type=FAILED&limit=50" \
  -H "Authorization: YOUR_API_TOKEN"

Query Parameters

ParameterTypeDefaultDescription
subscription_idUUID-Filter by subscription ID
destination_idUUID-Filter by destination ID
date_fromdatetime-Filter events from this date (ISO 8601 format)
date_todatetime-Filter events until this date (ISO 8601 format)
event_typestring-Filter by event type (see Event Types below)
limitinteger10Maximum number of results (0-1000)
offsetinteger0Number of results to skip

Event Types

TypeDescription
CREATENotification event created and ready for processing
QUEUEDNotification queued for delivery
SUCCESSNotification successfully delivered (2xx response)
FAILEDNotification delivery failed
CONFIRMWebhook confirmation request sent
CONFIRMEDWebhook destination confirmed

Example Request

bash
GET /v1/event_history?subscription_id=9603F4B2-1874-42FE-A2BC-F7B45C45A9D6&event_type=FAILED&limit=50

Response

json
{
  "events": [
    {
      "run_id": "B2C3D4E5-6789-01AB-CDEF-234567890ABC",
      "subscription_id": "9603F4B2-1874-42FE-A2BC-F7B45C45A9D6",
      "subscription_name": "Transaction Alerts",
      "destination_id": "A1B2C3D4-5678-90AB-CDEF-1234567890AB",
      "destination_name": "Production Webhook",
      "date": "2024-01-15T10:30:00Z",
      "events": ["SUCCESS", "QUEUED", "CREATE"],
      "data": [
        {
          "event_id": "dfe1308f-eedc-48b7-84a8-d4f573334a14",
          "event_type": "SUCCESS",
          "date": "2024-01-15 10:30:45.123 -0800",
          "data": {
            "Error": "",
            "Header": {
              "Content-Type": ["application/json"],
              "Date": ["Mon, 15 Jan 2024 18:30:45 GMT"]
            },
            "Id": "7b42d843-fb3a-4d26-bf5d-0e9982719b2a",
            "Meta": {
              "DestinationId": "A1B2C3D4-5678-90AB-CDEF-1234567890AB",
              "EventType": "CREATE",
              "ResponseType": "SUCCESS",
              "RunId": "B2C3D4E5-6789-01AB-CDEF-234567890ABC",
              "SubscriptionId": "9603F4B2-1874-42FE-A2BC-F7B45C45A9D6"
            },
            "StatusCode": 200,
            "Type": "webhook"
          }
        },
        {
          "event_id": "3ddbff00-fde9-4f5a-97e6-f1aeebc5a80b",
          "event_type": "QUEUED",
          "date": "2024-01-15 10:30:09.865 -0800",
          "data": {
            "input": "{...}",
            "response": {
              "Id": "0",
              "MessageId": "7b42d843-fb3a-4d26-bf5d-0e9982719b2a"
            }
          }
        },
        {
          "event_id": "54f1d11f-97d1-415e-8400-ffc992a622ba",
          "event_type": "CREATE",
          "date": "2024-01-15 10:30:00.466 -0800",
          "data": {
            "Type": "webhook",
            "Webhook": {
              "content_type": "application/json",
              "http_endpoint_url": "https://example.com/webhook",
              "message_body": "{\"id\":\"54f1d11f-97d1-415e-8400-ffc992a622ba\",\"type\":\"transactions\",\"timestamp\":\"2024-01-15 10:30:00.466 -0800\",\"attempts\":[],\"data\":[...]}"
            }
          }
        }
      ]
    },
    {
      "run_id": "C3D4E5F6-7890-12BC-DEFA-345678901BCD",
      "subscription_id": "9603F4B2-1874-42FE-A2BC-F7B45C45A9D6",
      "subscription_name": "Transaction Alerts",
      "destination_id": "A1B2C3D4-5678-90AB-CDEF-1234567890AB",
      "destination_name": "Production Webhook",
      "date": "2024-01-15T09:15:00Z",
      "events": ["FAILED", "QUEUED", "CREATE"],
      "data": [
        {
          "event_id": "abc12345-6789-0123-4567-890abcdef012",
          "event_type": "FAILED",
          "date": "2024-01-15 09:15:45.123 -0800",
          "data": {
            "Error": "Connection timeout",
            "StatusCode": 500,
            "Type": "webhook"
          }
        }
      ]
    }
  ]
}

Event Object Fields

FieldTypeDescription
run_idUUIDUnique identifier for this notification run
subscription_idUUIDID of the subscription that triggered the event
subscription_namestringName of the subscription (may be null)
destination_idUUIDID of the destination the event was sent to
destination_namestringName of the destination
datedatetimeWhen the run was created (ISO 8601 format)
eventsarrayList of event types that occurred during this run
dataarrayArray of detailed event records (see below)

Event Record Fields

Each item in the data array represents an individual event in the notification lifecycle:

FieldTypeDescription
event_idUUIDUnique identifier for this specific event
event_typestringType of event (CREATE, QUEUED, SUCCESS, FAILED, etc.)
datedatetimeWhen this event occurred
dataobjectEvent-specific payload data (varies by event type)

Event Data by Type

CREATE Event

Contains the original webhook request details:

FieldTypeDescription
TypestringDestination type (e.g., "webhook")
Webhook.content_typestringContent type of the request
Webhook.http_endpoint_urlstringTarget URL for the webhook
Webhook.message_bodystringJSON payload sent to the destination
Webhook.HeadersobjectCustom headers included in the request

QUEUED Event

Contains queue processing details:

FieldTypeDescription
inputstringSerialized input data sent to the queue
response.MessageIdstringQueue message identifier

SUCCESS Event

Contains the successful delivery response:

FieldTypeDescription
StatusCodeintegerHTTP status code returned by destination
HeaderobjectResponse headers from destination
ErrorstringEmpty string on success
IdstringMessage identifier
MetaobjectMetadata about the delivery
TypestringDestination type

FAILED Event

Contains failure details:

FieldTypeDescription
StatusCodeintegerHTTP status code (if available)
ErrorstringError message describing the failure
TypestringDestination type

CONFIRMED Event

Contains webhook confirmation response:

FieldTypeDescription
StatusCodeintegerHTTP status code from confirmation request
HeaderobjectResponse headers
Meta.ResponseTypestring"CONFIRMED" on success

Error Responses

StatusDescription
403Forbidden - Insufficient permissions

Resend Notification

Resend a notification that previously failed or needs to be redelivered.

Request

POST /v1/event_history/{id}
Content-Type: application/json

curl Example

bash
curl -X POST "https://api.notifications.paynetworx.cloud/v1/event_history/B2C3D4E5-6789-01AB-CDEF-234567890ABC" \
  -H "Authorization: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "destination_id": "A1B2C3D4-5678-90AB-CDEF-1234567890AB"
  }'

Path Parameters

ParameterTypeDescription
idUUIDThe event/run ID to resend

Request Body

FieldTypeRequiredDescription
destination_idUUIDNoOverride destination (optional)

Example Request

json
{
  "destination_id": "A1B2C3D4-5678-90AB-CDEF-1234567890AB"
}

Response

json
{
  "status": "success",
  "run_id": "D4E5F6A7-8901-23CD-EFAB-456789012CDE",
  "message": "Notification queued for redelivery"
}

Error Responses

StatusDescription
400Bad Request - Invalid event ID
403Forbidden - Insufficient permissions

Understanding Event Flow

A typical notification goes through these event stages:

CREATE → QUEUED → SUCCESS (successful delivery)
                  └→ FAILED (if delivery fails)

For webhook confirmation:

CONFIRM → QUEUED → CONFIRMED (confirmation successful)

Successful Delivery

  1. CREATE: Notification event is created with the webhook payload
  2. QUEUED: Notification is placed in the delivery queue
  3. SUCCESS: Destination returned 2xx status code

Failed Delivery

  1. CREATE: Notification event is created with the webhook payload
  2. QUEUED: Notification is placed in the delivery queue
  3. FAILED: Destination returned non-2xx status or connection failed

Webhook Confirmation Flow

  1. CONFIRM: Confirmation request is initiated
  2. QUEUED: Confirmation is placed in the delivery queue
  3. CONFIRMED: Webhook endpoint confirmed successfully

The system may retry failed deliveries automatically. Each retry creates a new run with the same subscription and destination but a different run_id.

Filtering Best Practices

Find Failed Notifications

bash
GET /v1/event_history?event_type=FAILED&date_from=2024-01-01T00:00:00Z

Monitor Specific Subscription

bash
GET /v1/event_history?subscription_id={id}&limit=100

Check Destination Health

bash
GET /v1/event_history?destination_id={id}&date_from=2024-01-15T00:00:00Z&date_to=2024-01-16T00:00:00Z