Skip to main content

Events & Webhooks

Subscribe to fleet events via webhooks and query aggregated activity.

Endpoints

MethodPathDescription
GET/api/orgs/{org_id}/webhooksList webhook endpoints
POST/api/orgs/{org_id}/webhooksCreate a webhook endpoint
GET/api/orgs/{org_id}/webhooks/{id}Get a webhook endpoint
PUT/api/orgs/{org_id}/webhooks/{id}Update a webhook endpoint
DELETE/api/orgs/{org_id}/webhooks/{id}Delete a webhook endpoint
GET/api/orgs/{org_id}/webhooks/{id}/deliveriesList webhook deliveries
POST/api/orgs/{org_id}/webhooks/{id}/testSend a test webhook
GET/api/orgs/{org_id}/events/aggregatesAggregate event counts

List webhook endpoints

GET /api/orgs/{org_id}/webhooks

Admin only.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.

Query parameters:

NameTypeRequiredDescription
cursorstringNoOpaque pagination cursor from a prior response's meta.after/meta.before.
limitintegerNoMax items per page (clamped 1–100). Defaults to 20. Range 1–100.
directionstringNoPage direction relative to the cursor. One of: after, before. Defaults to "after".

Responses:

StatusBodyDescription
200data: array of WebhookEndpoint, meta: PaginationMetaEndpoints (secrets omitted).

Example request:

curl "https://connect.peridio.com/api/orgs/{org_id}/webhooks" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"data": [
{
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"organization_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"url": "https://example.com",
"events": ["string"],
"enabled": true,
"inserted_at": "2026-08-14T12:00:00Z",
"updated_at": "2026-08-14T12:00:00Z"
}
],
"meta": {
"after": "string",
"before": "string",
"has_next": true,
"has_previous": true,
"total": 0
}
}

Create a webhook endpoint

POST /api/orgs/{org_id}/webhooks

Admin only. The signing secret is returned once, in the create response only.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.

Request body:

FieldTypeRequiredDescription
webhook_endpointobjectYes
webhook_endpoint.namestringNo
webhook_endpoint.urlstring (uri)Yes
webhook_endpoint.eventsstring[]No
webhook_endpoint.enabledbooleanNo

Responses:

StatusBodyDescription
201data: WebhookEndpointCreated.
422ValidationErrorRequest body failed validation.

Example request:

curl -X POST "https://connect.peridio.com/api/orgs/{org_id}/webhooks" \
-H "Authorization: Bearer $AVOCADO_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"webhook_endpoint": {
"name": "string",
"url": "https://example.com",
"events": [
"string"
],
"enabled": true
}
}'

Example response (201):

{
"data": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"organization_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"url": "https://example.com",
"events": ["string"],
"enabled": true,
"secret": "string",
"inserted_at": "2026-08-14T12:00:00Z",
"updated_at": "2026-08-14T12:00:00Z"
}
}

Get a webhook endpoint

GET /api/orgs/{org_id}/webhooks/{id}

Admin only.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.
idstring

Responses:

StatusBodyDescription
200data: WebhookEndpointEndpoint.
404ErrorResource not found.

Example request:

curl "https://connect.peridio.com/api/orgs/{org_id}/webhooks/{id}" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"data": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"organization_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"url": "https://example.com",
"events": ["string"],
"enabled": true,
"inserted_at": "2026-08-14T12:00:00Z",
"updated_at": "2026-08-14T12:00:00Z"
}
}

Update a webhook endpoint

PUT /api/orgs/{org_id}/webhooks/{id}

Admin only.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.
idstring

Request body:

FieldTypeRequiredDescription
webhook_endpointobjectYes
webhook_endpoint.namestringNo
webhook_endpoint.urlstring (uri)No
webhook_endpoint.eventsstring[]No
webhook_endpoint.enabledbooleanNo

Responses:

StatusBodyDescription
200data: WebhookEndpointUpdated.
404ErrorResource not found.
422ValidationErrorRequest body failed validation.

Example request:

curl -X PUT "https://connect.peridio.com/api/orgs/{org_id}/webhooks/{id}" \
-H "Authorization: Bearer $AVOCADO_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"webhook_endpoint": {
"name": "string",
"url": "https://example.com",
"events": [
"string"
],
"enabled": true
}
}'

Example response (200):

{
"data": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"organization_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"name": "string",
"url": "https://example.com",
"events": ["string"],
"enabled": true,
"inserted_at": "2026-08-14T12:00:00Z",
"updated_at": "2026-08-14T12:00:00Z"
}
}

Delete a webhook endpoint

DELETE /api/orgs/{org_id}/webhooks/{id}

Admin only.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.
idstring

Responses:

StatusBodyDescription
200OkDeleted.
404ErrorResource not found.

Example request:

curl -X DELETE "https://connect.peridio.com/api/orgs/{org_id}/webhooks/{id}" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"ok": true
}

List webhook deliveries

GET /api/orgs/{org_id}/webhooks/{id}/deliveries

Admin only. Delivery attempts for the endpoint.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.
idstring

Query parameters:

NameTypeRequiredDescription
cursorstringNoOpaque pagination cursor from a prior response's meta.after/meta.before.
limitintegerNoMax items per page (clamped 1–100). Defaults to 20. Range 1–100.
directionstringNoPage direction relative to the cursor. One of: after, before. Defaults to "after".

Responses:

StatusBodyDescription
200data: array of WebhookDelivery, meta: PaginationMetaDeliveries.
404ErrorResource not found.

Example request:

curl "https://connect.peridio.com/api/orgs/{org_id}/webhooks/{id}/deliveries" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"data": [
{
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"webhook_endpoint_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"event_type": "string",
"status": "string",
"response_status": 0,
"attempt_count": 0,
"last_attempted_at": "2026-08-14T12:00:00Z",
"delivered_at": "2026-08-14T12:00:00Z",
"inserted_at": "2026-08-14T12:00:00Z"
}
],
"meta": {
"after": "string",
"before": "string",
"has_next": true,
"has_previous": true,
"total": 0
}
}

Send a test webhook

POST /api/orgs/{org_id}/webhooks/{id}/test

Admin only. Enqueues a ping delivery to the endpoint and returns the created delivery record.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.
idstring

Responses:

StatusBodyDescription
200data: WebhookDeliveryTest delivery enqueued.
404ErrorResource not found.

Example request:

curl -X POST "https://connect.peridio.com/api/orgs/{org_id}/webhooks/{id}/test" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"data": {
"id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"webhook_endpoint_id": "0198a2e6-6f24-7cc3-b456-663cd21c4b12",
"event_type": "string",
"status": "string",
"response_status": 0,
"attempt_count": 0,
"last_attempted_at": "2026-08-14T12:00:00Z",
"delivered_at": "2026-08-14T12:00:00Z",
"inserted_at": "2026-08-14T12:00:00Z"
}
}

Aggregate event counts

GET /api/orgs/{org_id}/events/aggregates

Returns time-bucketed event counts for the org over the given range, optionally filtered by event types, resource type, cohorts, tags, device search, or device status.

Path parameters:

NameTypeDescription
org_idstring (uuid)Organization UUID.

Query parameters:

NameTypeRequiredDescription
rangestringNoOne of: 24h, 7d, 30d. Defaults to "24h".
typesstringNoComma-separated event types.
resource_typestringNo
cohort_idsstringNoComma-separated cohort UUIDs.
tagsstringNoComma-separated device tags.
searchstringNo
statusstringNoOne of: unregistered, registered, online, offline.

Responses:

StatusBodyDescription
200data: EventAggregateAggregates.
400ErrorInvalid range.

Example request:

curl "https://connect.peridio.com/api/orgs/{org_id}/events/aggregates" \
-H "Authorization: Bearer $AVOCADO_TOKEN"

Example response (200):

{
"data": {
"range": "24h",
"bucket_size": "string",
"buckets": [{}],
"totals": {}
}
}

Object reference

WebhookEndpoint

FieldTypeDescription
idstring
organization_idstring
namestringNullable.
urlstring (uri)
eventsstring[]Event types this endpoint subscribes to.
enabledboolean
secretstringSigning secret — returned only on create.
inserted_atstring (date-time)
updated_atstring (date-time)

PaginationMeta

Cursor pagination metadata. Present only when the request supplied a pagination param (cursor, limit, or direction); otherwise the full list is returned unpaginated with no meta.

FieldTypeDescription
afterstringOpaque cursor for the next page. Pass back as ?cursor=. Nullable.
beforestringOpaque cursor for the previous page. Nullable.
has_nextboolean
has_previousboolean
totalintegerNullable.

ValidationError

Changeset validation error. Keys are field names; values are lists of messages.

FieldTypeDescription
errorsobject

Error

Standard error envelope.

FieldTypeDescription
errorstringMachine-readable error code.
messagestringHuman-readable explanation.

Ok

Simple acknowledgement.

FieldTypeDescription
okboolean

WebhookDelivery

FieldTypeDescription
idstring
webhook_endpoint_idstring
event_typestring
statusstringe.g. pending, delivered, failed.
response_statusintegerHTTP status returned by the endpoint. Nullable.
attempt_countinteger
last_attempted_atstring (date-time)Nullable.
delivered_atstring (date-time)Nullable.
inserted_atstring (date-time)

EventAggregate

FieldTypeDescription
rangestringOne of: 24h, 7d, 30d.
bucket_sizestringTime bucket granularity, e.g. hour.
bucketsobject[]Per-bucket event counts.
totalsobjectTotals keyed by event type; _all is the grand total.