iMarioiMario
DocumentsAPI reference

Guides

API Overview and QuickstartAuthenticationSandbox and Test KeysAPI ErrorsPaginationIdempotent RequestsRate LimitsAPI VersioningWebhooks

Endpoints

All EndpointsWorkspaceAudiencesPeopleStudiesReportsLibraryFilesAuto StudiesConnectionsMembersAPI KeysWebhook Endpoints
Endpoints

Webhook Endpoints

The endpoints iMario sends events to, test events, signing secrets and the delivery log. Owners and admins.

Base URL https://api.imario.ai/v1. Each call needs a key that holds the scope shown and acts with at least the role shown (Authentication). Errors are described in API errors.

List webhook endpoints

GET /v1/webhook-endpoints

Scope webhooks:read · Role owner or admin

The endpoints of the key's mode (live or test), newest first. A webhook_endpoint: id, livemode (a test key's endpoints are test endpoints and receive sandbox events only), created_at, url, description, events (event types, or ["*"] for all), enabled, disabled_reason (delivery_failures when iMario turned it off after 3 days of failed deliveries, disabled_by_user, or null).

Parameters

NameInTypeRequiredDescription
limitqueryintegerNoHow many objects to return (1-100). Default 20.
cursorquerystringNoThe next_cursor of the previous page. Up to 200 characters.

Example

curl https://api.imario.ai/v1/webhook-endpoints \
  -H "Authorization: Bearer $IMARIO_API_KEY"

Response

Returns a list: {"object": "list", "data": [...], "has_more": false, "next_cursor": null}. See Pagination.

Create a webhook endpoint

POST /v1/webhook-endpoints

Scope webhooks:write · Role owner or admin

The response carries secret (whsec_...), shown this once: keep it to verify webhook-signature (Standard Webhooks). The URL must be https and resolve to public addresses only; it is checked again at every delivery. A webhook_endpoint: id, livemode (a test key's endpoints are test endpoints and receive sandbox events only), created_at, url, description, events (event types, or ["*"] for all), enabled, disabled_reason (delivery_failures when iMario turned it off after 3 days of failed deliveries, disabled_by_user, or null).

Request body

FieldTypeRequiredDescription
urlstringYesA public https URL. Redirects are not followed. Up to 2,048 characters.
eventsstring[]YesEvent types to receive, or ["*"] for every type. Up to 20 items.
descriptionstringNoUp to 200 characters.

Example

curl https://api.imario.ai/v1/webhook-endpoints \
  -H "Authorization: Bearer $IMARIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/imario/webhooks",
    "events": ["study.completed", "study.failed", "report.completed"],
    "description": "Production receiver"
  }'

Retrieve a webhook endpoint

GET /v1/webhook-endpoints/{endpoint_id}

Scope webhooks:read · Role owner or admin

A webhook_endpoint: id, livemode (a test key's endpoints are test endpoints and receive sandbox events only), created_at, url, description, events (event types, or ["*"] for all), enabled, disabled_reason (delivery_failures when iMario turned it off after 3 days of failed deliveries, disabled_by_user, or null).

Example

curl https://api.imario.ai/v1/webhook-endpoints/ENDPOINT_ID \
  -H "Authorization: Bearer $IMARIO_API_KEY"

Update a webhook endpoint

PATCH /v1/webhook-endpoints/{endpoint_id}

Scope webhooks:write · Role owner or admin

Send only the fields to change. A webhook_endpoint: id, livemode (a test key's endpoints are test endpoints and receive sandbox events only), created_at, url, description, events (event types, or ["*"] for all), enabled, disabled_reason (delivery_failures when iMario turned it off after 3 days of failed deliveries, disabled_by_user, or null).

Request body

FieldTypeRequiredDescription
urlstringNoUp to 2,048 characters.
eventsstring[]NoUp to 20 items.
descriptionstringNoUp to 200 characters.
enabledbooleanNofalse stops deliveries (and drops the pending ones); true turns the endpoint on again.

Example

curl -X PATCH https://api.imario.ai/v1/webhook-endpoints/ENDPOINT_ID \
  -H "Authorization: Bearer $IMARIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": false
  }'

Delete a webhook endpoint

DELETE /v1/webhook-endpoints/{endpoint_id}

Scope webhooks:write · Role owner or admin

Deliveries waiting for it are dropped. Returns {object, id, deleted: true}.

Example

curl -X DELETE https://api.imario.ai/v1/webhook-endpoints/ENDPOINT_ID \
  -H "Authorization: Bearer $IMARIO_API_KEY"

Send a test event

POST /v1/webhook-endpoints/{endpoint_id}/test

Scope webhooks:write · Role owner or admin

Queues a ping event to this endpoint alone (its data.object is the endpoint) and returns the webhook_delivery: id, endpoint_id, event_id, event_type, status (pending, delivered, failed), attempts, last_status_code, last_error, created_at, delivered_at, next_attempt_at.

Example

curl -X POST https://api.imario.ai/v1/webhook-endpoints/ENDPOINT_ID/test \
  -H "Authorization: Bearer $IMARIO_API_KEY"

Rotate the signing secret

POST /v1/webhook-endpoints/{endpoint_id}/rotate-secret

Scope webhooks:write · Role owner or admin

A new secret, shown this once. For 24 hours deliveries carry two signatures (the new secret's and the old one's), so a receiver can switch without missing an event. A webhook_endpoint: id, livemode (a test key's endpoints are test endpoints and receive sandbox events only), created_at, url, description, events (event types, or ["*"] for all), enabled, disabled_reason (delivery_failures when iMario turned it off after 3 days of failed deliveries, disabled_by_user, or null).

Example

curl -X POST https://api.imario.ai/v1/webhook-endpoints/ENDPOINT_ID/rotate-secret \
  -H "Authorization: Bearer $IMARIO_API_KEY"

List an endpoint's deliveries

GET /v1/webhook-endpoints/{endpoint_id}/deliveries

Scope webhooks:read · Role owner or admin

Newest first, kept 30 days. Each webhook_delivery: id, endpoint_id, event_id (the webhook-id header), event_type, status (pending, delivered, failed), attempts, last_status_code, last_error, created_at, delivered_at, next_attempt_at. A failed attempt is tried again after 1 min, 5 min, 30 min, 2 h, 6 h and 12 h.

Parameters

NameInTypeRequiredDescription
limitqueryintegerNoHow many objects to return (1-100). Default 20.
cursorquerystringNoThe next_cursor of the previous page. Up to 200 characters.

Example

curl https://api.imario.ai/v1/webhook-endpoints/ENDPOINT_ID/deliveries \
  -H "Authorization: Bearer $IMARIO_API_KEY"

Response

Returns a list: {"object": "list", "data": [...], "has_more": false, "next_cursor": null}. See Pagination.

← API Keys

On this page

List webhook endpointsCreate a webhook endpointRetrieve a webhook endpointUpdate a webhook endpointDelete a webhook endpointSend a test eventRotate the signing secretList an endpoint's deliveries