Skip to main content
GET
/
webhook-events
List webhook events
curl --request GET \
  --url https://api.usecobalt.com/v1/webhook-events \
  --header 'access_token: <api-key>' \
  --header 'client_id: <api-key>' \
  --header 'client_secret: <api-key>'
{
  "success": true,
  "webhook_events": [
    {
      "id": "<string>",
      "access_token_reference_id": "<string>",
      "object": "<string>",
      "created": "2023-11-07T05:31:56Z",
      "type": "<string>",
      "job_id": "<string>",
      "status": "<string>",
      "delivered": true,
      "delivery_attempts": 123,
      "last_delivery_attempt": "2023-11-07T05:31:56Z",
      "response_status_code": 123,
      "data": {}
    }
  ],
  "pagination": {
    "current_page": 123,
    "total_pages": 123,
    "total_count": 123,
    "page_size": 123
  }
}
Use this endpoint to retrieve webhook events that have been sent to your registered webhook URLs.

Use Cases

  • Debug webhook delivery issues
  • Audit webhook event history
  • Recover missed webhook events after downtime
  • Verify event payloads during integration testing

Common Event Types

  • patient.insurance.added - Insurance successfully added to patient
  • patient.insurance.failed - Insurance addition failed
  • appointment.created - Appointment created
  • appointment.updated - Appointment updated
  • note.created - Clinical note created

Query Parameters

  • event_type (string, optional): Filter by event type (e.g., “patient.insurance.added”, “appointment.created”)
  • status (string, optional): Filter by event status (“success”, “failed”, “pending”)
  • start_date (string, optional): Filter events created on or after this date (ISO 8601 format: YYYY-MM-DD)
  • end_date (string, optional): Filter events created on or before this date (ISO 8601 format: YYYY-MM-DD)
  • page (integer, optional): Page number (default: 1, min: 1)
  • page_size (integer, optional): Number of events per page (default: 50, max: 100)
  • sort (string, optional): Sort order. Use “created” for ascending (oldest first) or “-created” for descending (newest first). Default: “-created”

Example Requests

Get Recent Events

curl -X GET "https://api.usecobalt.com/v1/webhook-events?page_size=20" \
  -H "client_id: your_client_id" \
  -H "client_secret: your_client_secret" \
  -H "access_token: your_access_token"

Filter by Event Type

curl -X GET "https://api.usecobalt.com/v1/webhook-events?event_type=patient.insurance.added&page_size=10" \
  -H "client_id: your_client_id" \
  -H "client_secret: your_client_secret" \
  -H "access_token: your_access_token"

Filter by Date Range

curl -X GET "https://api.usecobalt.com/v1/webhook-events?start_date=2025-01-01&end_date=2025-01-31" \
  -H "client_id: your_client_id" \
  -H "client_secret: your_client_secret" \
  -H "access_token: your_access_token"

Filter by Status

curl -X GET "https://api.usecobalt.com/v1/webhook-events?status=failed" \
  -H "client_id: your_client_id" \
  -H "client_secret: your_client_secret" \
  -H "access_token: your_access_token"

Get Page 2

curl -X GET "https://api.usecobalt.com/v1/webhook-events?page=2&page_size=50" \
  -H "client_id: your_client_id" \
  -H "client_secret: your_client_secret" \
  -H "access_token: your_access_token"

Example Response

{
  "success": true,
  "webhook_events": [
    {
      "id": "evt_abc123def456",
      "access_token_reference_id": "your_reference_id",
      "object": "event",
      "created": "2025-01-15T10:30:00.000Z",
      "type": "patient.insurance.added",
      "job_id": "12345",
      "status": "success",
      "delivered": true,
      "delivery_attempts": 1,
      "last_delivery_attempt": "2025-01-15T10:30:05.000Z",
      "response_status_code": 200,
      "data": {
        "patient_insurance_id": "xyz789abc123",
        "patient_mrn": "MRN123456"
      }
    }
  ],
  "pagination": {
    "current_page": 1,
    "total_pages": 10,
    "total_count": 487,
    "page_size": 50
  }
}

Response Fields

Top-Level Fields

  • success (boolean): Whether the request was successful
  • webhook_events (array): Array of webhook event objects
  • pagination (object): Pagination metadata

Event Object Fields

  • event_id (string): Unique event identifier
  • access_token_reference_id (string): The reference ID associated with your access token
  • created_at (string): ISO 8601 timestamp of event creation
  • event_type (string): Event type (e.g., “patient.insurance.added”, “appointment.created”)
  • job_id (string): Job ID if this event is related to an asynchronous operation
  • webhook_url (string): The URL the event was sent to.
  • status (string): Event status (“success”, “failed”, “pending”). This refers to whether the event was delivered to your endpoint.
  • data (object): Event-specific payload data

Pagination Object

  • current_page (integer): Current page number
  • total_pages (integer): Total number of pages
  • total_count (integer): Total number of events matching the filter
  • page_size (integer): Number of items per page
The data field in each event contains event-specific information that varies depending on the event type. Refer to the webhook events documentation for details on each event type’s payload structure.

Pagination

This endpoint supports page-based pagination:
  1. Make an initial request with optional page and page_size parameters
  2. Check the pagination object in the response for total_pages
  3. Request subsequent pages by incrementing the page parameter
  4. Continue until you reach total_pages

Authorizations

client_id
string
header
required
client_secret
string
header
required
access_token
string
header
required

Query Parameters

event_type
string

Filter by event type (e.g., "patient.insurance.added", "appointment.created")

status
enum<string>

Filter by event status

Available options:
success,
failed,
pending
start_date
string<date>

Filter events created on or after this date (ISO 8601 format: YYYY-MM-DD)

end_date
string<date>

Filter events created on or before this date (ISO 8601 format: YYYY-MM-DD)

page
integer
default:1

Page number (default: 1, min: 1)

Required range: x >= 1
page_size
integer
default:50

Number of events per page (default: 50, max: 100)

Required range: 1 <= x <= 100
sort
enum<string>
default:-created

Sort order. Use 'created' for ascending (oldest first) or '-created' for descending (newest first). Default: '-created'

Available options:
created,
-created

Response

Successful response with pagination

success
boolean
webhook_events
object[]
pagination
object
I