All resources

Webhooks

Signed event endpoints: alarms, trips, geofences and jobs, with a delivery log and redelivery.

Base URLhttps://api.ping.nml.sa/v110 operations

Jump to an operation

Common errors

Operations on this page answer these errors in one shape; each operation lists the ones it returns.

  • 400The request is invalid (code: invalid_request), with field errors.
  • 401The API key is missing, unknown, expired or revoked (code: unauthorized).
  • 403The API key lacks the scope this operation needs (code: forbidden).
  • 404No such resource in this account, or outside the key's data scope (code: not_found).
  • 409The resource is not in a state that allows this (code: conflict), or the idempotency key is in use.
  • 429The key's rate limit is reached (code: rate_limited). Retry after the Retry-After header's seconds.

The account's webhook deliveries, newest first

GET/v1/webhook-deliveries

Deliveries are kept 30 days.

Scopewebhooks:read

Parameters

  • endpoint_idstring query

    One endpoint's deliveries.

    e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

  • statestring query

    Only deliveries in this state.

    e.g.succeeded

  • typestring query

    Only deliveries of this event type.

    e.g.trip.ended

  • limitinteger query

    Items per page, 1 to 200 (default 50).

  • cursorstring query

    The next_cursor of the previous page.

Response 200

  • dataobject[]
    Fields of data
    • idstring

      e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

    • endpoint_idstring

      e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

    • event_idstring

      e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

    • typestring

      A delivered event's type: a WebhookEventType, or webhook.test.

      one ofalarm.openedalarm.clearedtrip.endedgeofence.enteredgeofence.exitedjob.dispatchedjob.startedjob.completedjob.cancelledwebhook.test

    • redelivery_ofstring | null

      The delivery this one sends again.

    • statestring

      one ofpendingsucceededfailed

    • failurestring | null

      Why it failed: every attempt failed, or the endpoint was disabled first.

      one ofexhaustedendpoint_disablednull

    • attemptsinteger
    • next_attempt_atstring | null (date-time)

      When it is tried next (pending only).

    • created_atstring (date-time)
    • done_atstring | null (date-time)
  • next_cursorstring | null

Errors

400401403429

Example request
curl "https://api.ping.nml.sa/v1/webhook-deliveries" \
  -H "Authorization: Bearer $PING_API_KEY"
Example response · 200
{
  "data": [
    {
      "id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
      "endpoint_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
      "event_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
      "type": "trip.ended",
      "redelivery_of": "string",
      "state": "succeeded",
      "failure": "exhausted",
      "attempts": 0,
      "next_attempt_at": "string",
      "created_at": "string",
      "done_at": "string"
    }
  ],
  "next_cursor": "string"
}

One delivery with every attempt

GET/v1/webhook-deliveries/{deliveryId}

Scopewebhooks:read

Parameters

  • deliveryIdstring path required

    e.g.019ac0d2-3c4d-7e5f-8a6b-7c8d9e0f1a2b

Response 200

  • deliveryobject
    Fields of delivery
    • idstring

      e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

    • endpoint_idstring

      e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

    • event_idstring

      e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

    • typestring

      A delivered event's type: a WebhookEventType, or webhook.test.

      one ofalarm.openedalarm.clearedtrip.endedgeofence.enteredgeofence.exitedjob.dispatchedjob.startedjob.completedjob.cancelledwebhook.test

    • redelivery_ofstring | null

      The delivery this one sends again.

    • statestring

      one ofpendingsucceededfailed

    • failurestring | null

      Why it failed: every attempt failed, or the endpoint was disabled first.

      one ofexhaustedendpoint_disablednull

    • attemptsinteger
    • next_attempt_atstring | null (date-time)

      When it is tried next (pending only).

    • created_atstring (date-time)
    • done_atstring | null (date-time)
  • payloadalarm.opened | alarm.cleared | trip.ended | geofence.entered | geofence.exited | job.dispatched | job.started | job.completed | job.cancelled | webhook.test

    One webhook body: the payload of its type.

  • attempt_logobject[]

    Every attempt, first first.

    Fields of attempt_log
    • ninteger
    • atstring (date-time)
    • urlstring

      The URL it went to (the endpoint's at the time).

    • addressstring | null

      The address dialled.

      e.g.203.0.113.7

    • outcomestring

      delivered: 2xx; http_error: another status (redirects are not followed); unreachable: DNS, connection or TLS; refused_address: the host resolved to a non-public address.

      one ofdeliveredhttp_errortimeoutunreachablerefused_address

    • statusinteger | null
    • duration_msinteger
    • errorstring | null

      What went wrong, for people.

Errors

400401403404429

Example request
curl "https://api.ping.nml.sa/v1/webhook-deliveries/019ac0d2-3c4d-7e5f-8a6b-7c8d9e0f1a2b" \
  -H "Authorization: Bearer $PING_API_KEY"
Example response · 200
{
  "delivery": {
    "id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
    "endpoint_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
    "event_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
    "type": "trip.ended",
    "redelivery_of": "string",
    "state": "succeeded",
    "failure": "exhausted",
    "attempts": 0,
    "next_attempt_at": "string",
    "created_at": "string",
    "done_at": "string"
  },
  "payload": {
    "id": "019ac0d1-7a2b-7c3d-8e4f-5a6b7c8d9e0f",
    "type": "alarm.opened",
    "occurred_at": "2026-11-17T08:30:00Z",
    "data": {
      "alarm_id": "019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b",
      "rule_id": "string",
      "vehicle_id": "string",
      "kind": "overspeed",
      "severity": "info",
      "opened_at": "string",
      "lat": 24.7136,
      "lon": 46.6753
    }
  },
  "attempt_log": [
    {
      "n": 0,
      "at": "string",
      "url": "string",
      "address": "203.0.113.7",
      "outcome": "delivered",
      "status": 0,
      "duration_ms": 0,
      "error": "string"
    }
  ]
}

Send a finished delivery's event to its endpoint again, as a new delivery (same event id)

POST/v1/webhook-deliveries/{deliveryId}/redeliver

Only a delivery that succeeded or failed, to an enabled endpoint (else 409).

Scopewebhooks:write

Parameters

  • deliveryIdstring path required

    e.g.019ac0d2-3c4d-7e5f-8a6b-7c8d9e0f1a2b

Response 202

  • idstring

    e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

  • endpoint_idstring

    e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

  • event_idstring

    e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

  • typestring

    A delivered event's type: a WebhookEventType, or webhook.test.

    one ofalarm.openedalarm.clearedtrip.endedgeofence.enteredgeofence.exitedjob.dispatchedjob.startedjob.completedjob.cancelledwebhook.test

  • redelivery_ofstring | null

    The delivery this one sends again.

  • statestring

    one ofpendingsucceededfailed

  • failurestring | null

    Why it failed: every attempt failed, or the endpoint was disabled first.

    one ofexhaustedendpoint_disablednull

  • attemptsinteger
  • next_attempt_atstring | null (date-time)

    When it is tried next (pending only).

  • created_atstring (date-time)
  • done_atstring | null (date-time)

Errors

400401403404409429

Example request
curl -X POST "https://api.ping.nml.sa/v1/webhook-deliveries/019ac0d2-3c4d-7e5f-8a6b-7c8d9e0f1a2b/redeliver" \
  -H "Authorization: Bearer $PING_API_KEY"
Example response · 202
{
  "id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
  "endpoint_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
  "event_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
  "type": "trip.ended",
  "redelivery_of": "string",
  "state": "succeeded",
  "failure": "exhausted",
  "attempts": 0,
  "next_attempt_at": "string",
  "created_at": "string",
  "done_at": "string"
}

List the account's webhook endpoints, oldest first

GET/v1/webhook-endpoints

Scopewebhooks:read

Parameters

  • limitinteger query

    Items per page, 1 to 200 (default 50).

  • cursorstring query

    The next_cursor of the previous page.

Response 200

  • dataobject[]
    Fields of data
    • idstring

      e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

    • urlstring

      e.g.https://erp.example.com/ping/webhooks

    • descriptionstring | null

      e.g.ERP alarms feed

    • event_typesstring[]
    • enabledboolean
    • disabled_reasonstring | null

      owner: turned off by a person; failing: disabled after repeated failure; account_ended: the account left PING (its exit).

      one ofownerfailingaccount_endednull

    • disabled_atstring | null (date-time)
    • secret_hintstring

      The secret's last four characters.

      e.g.x7Qa

    • secret_rotated_atstring (date-time)
    • consecutive_failuresinteger

      Deliveries in a row that failed for good.

    • created_atstring (date-time)
    • updated_atstring (date-time)
  • next_cursorstring | null

Errors

400401403429

Example request
curl "https://api.ping.nml.sa/v1/webhook-endpoints" \
  -H "Authorization: Bearer $PING_API_KEY"
Example response · 200
{
  "data": [
    {
      "id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
      "url": "https://erp.example.com/ping/webhooks",
      "description": "ERP alarms feed",
      "event_types": [
        "alarm.opened"
      ],
      "enabled": false,
      "disabled_reason": "owner",
      "disabled_at": "string",
      "secret_hint": "x7Qa",
      "secret_rotated_at": "string",
      "consecutive_failures": 0,
      "created_at": "string",
      "updated_at": "string"
    }
  ],
  "next_cursor": "string"
}

Add a webhook endpoint: an https URL and the event types it receives. Its signing secret is answered once

POST/v1/webhook-endpoints

The URL must be https and its host a name or a public address (private, loopback, link-local and reserved addresses are refused, and checked again on every delivery). At most 10 endpoints per account.

Scopewebhooks:write Accepts Idempotency-Key

Parameters

  • Idempotency-Keystring header

    A unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.

Request body

  • urlstring required

    https only; no credentials, no private, loopback or link-local address.

    e.g.https://erp.example.com/ping/webhooks

  • descriptionstring

    e.g.ERP alarms feed

  • event_typesstring[] required

    e.g.["alarm.opened","alarm.cleared"]

  • enabledboolean

Response 201

  • endpointobject
    Fields of endpoint
    • idstring

      e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

    • urlstring

      e.g.https://erp.example.com/ping/webhooks

    • descriptionstring | null

      e.g.ERP alarms feed

    • event_typesstring[]
    • enabledboolean
    • disabled_reasonstring | null

      owner: turned off by a person; failing: disabled after repeated failure; account_ended: the account left PING (its exit).

      one ofownerfailingaccount_endednull

    • disabled_atstring | null (date-time)
    • secret_hintstring

      The secret's last four characters.

      e.g.x7Qa

    • secret_rotated_atstring (date-time)
    • consecutive_failuresinteger

      Deliveries in a row that failed for good.

    • created_atstring (date-time)
    • updated_atstring (date-time)
  • secretstring

    The signing secret, shown only in this answer.

    e.g.whsec_4fJ9kQ2mX7pL1sV8nR3tY6wZ0aB5cD7x

Errors

400401403409429

Example request
curl -X POST "https://api.ping.nml.sa/v1/webhook-endpoints" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://erp.example.com/ping/webhooks", "description": "ERP alarms feed", "event_types": ["alarm.opened", "alarm.cleared"]}'
Example response · 201
{
  "endpoint": {
    "id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
    "url": "https://erp.example.com/ping/webhooks",
    "description": "ERP alarms feed",
    "event_types": [
      "alarm.opened"
    ],
    "enabled": false,
    "disabled_reason": "owner",
    "disabled_at": "string",
    "secret_hint": "x7Qa",
    "secret_rotated_at": "string",
    "consecutive_failures": 0,
    "created_at": "string",
    "updated_at": "string"
  },
  "secret": "whsec_4fJ9kQ2mX7pL1sV8nR3tY6wZ0aB5cD7x"
}

One webhook endpoint

GET/v1/webhook-endpoints/{endpointId}

Scopewebhooks:read

Parameters

  • endpointIdstring path required

    e.g.019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f

Response 200

  • idstring

    e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

  • urlstring

    e.g.https://erp.example.com/ping/webhooks

  • descriptionstring | null

    e.g.ERP alarms feed

  • event_typesstring[]
  • enabledboolean
  • disabled_reasonstring | null

    owner: turned off by a person; failing: disabled after repeated failure; account_ended: the account left PING (its exit).

    one ofownerfailingaccount_endednull

  • disabled_atstring | null (date-time)
  • secret_hintstring

    The secret's last four characters.

    e.g.x7Qa

  • secret_rotated_atstring (date-time)
  • consecutive_failuresinteger

    Deliveries in a row that failed for good.

  • created_atstring (date-time)
  • updated_atstring (date-time)

Errors

400401403404429

Example request
curl "https://api.ping.nml.sa/v1/webhook-endpoints/019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f" \
  -H "Authorization: Bearer $PING_API_KEY"
Example response · 200
{
  "id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
  "url": "https://erp.example.com/ping/webhooks",
  "description": "ERP alarms feed",
  "event_types": [
    "alarm.opened"
  ],
  "enabled": false,
  "disabled_reason": "owner",
  "disabled_at": "string",
  "secret_hint": "x7Qa",
  "secret_rotated_at": "string",
  "consecutive_failures": 0,
  "created_at": "string",
  "updated_at": "string"
}

Change an endpoint's URL, description, event types or enabled flag

PATCH/v1/webhook-endpoints/{endpointId}

Fields given replace the stored ones; event_types replaces the list whole. enabled false stops deliveries (pending ones fail as endpoint_disabled); enabled true turns a disabled endpoint back on and clears its failure count.

Scopewebhooks:write

Parameters

  • endpointIdstring path required

    e.g.019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f

Request body

  • urlstring

    e.g.https://erp.example.com/ping/webhooks

  • descriptionstring

    An empty description clears it.

  • event_typesstring[]
  • enabledboolean

Response 200

  • idstring

    e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

  • urlstring

    e.g.https://erp.example.com/ping/webhooks

  • descriptionstring | null

    e.g.ERP alarms feed

  • event_typesstring[]
  • enabledboolean
  • disabled_reasonstring | null

    owner: turned off by a person; failing: disabled after repeated failure; account_ended: the account left PING (its exit).

    one ofownerfailingaccount_endednull

  • disabled_atstring | null (date-time)
  • secret_hintstring

    The secret's last four characters.

    e.g.x7Qa

  • secret_rotated_atstring (date-time)
  • consecutive_failuresinteger

    Deliveries in a row that failed for good.

  • created_atstring (date-time)
  • updated_atstring (date-time)

Errors

400401403404429

Example request
curl -X PATCH "https://api.ping.nml.sa/v1/webhook-endpoints/019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://erp.example.com/ping/webhooks"}'
Example response · 200
{
  "id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
  "url": "https://erp.example.com/ping/webhooks",
  "description": "ERP alarms feed",
  "event_types": [
    "alarm.opened"
  ],
  "enabled": false,
  "disabled_reason": "owner",
  "disabled_at": "string",
  "secret_hint": "x7Qa",
  "secret_rotated_at": "string",
  "consecutive_failures": 0,
  "created_at": "string",
  "updated_at": "string"
}

Remove an endpoint with its deliveries

DELETE/v1/webhook-endpoints/{endpointId}

Scopewebhooks:write

Parameters

  • endpointIdstring path required

    e.g.019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f

Response 204

Removed.

Errors

400401403404429

Example request
curl -X DELETE "https://api.ping.nml.sa/v1/webhook-endpoints/019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f" \
  -H "Authorization: Bearer $PING_API_KEY"

Replace an endpoint's signing secret; the new one is answered once and signs every delivery from now on

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

Scopewebhooks:write

Parameters

  • endpointIdstring path required

    e.g.019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f

Response 200

  • endpointobject
    Fields of endpoint
    • idstring

      e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

    • urlstring

      e.g.https://erp.example.com/ping/webhooks

    • descriptionstring | null

      e.g.ERP alarms feed

    • event_typesstring[]
    • enabledboolean
    • disabled_reasonstring | null

      owner: turned off by a person; failing: disabled after repeated failure; account_ended: the account left PING (its exit).

      one ofownerfailingaccount_endednull

    • disabled_atstring | null (date-time)
    • secret_hintstring

      The secret's last four characters.

      e.g.x7Qa

    • secret_rotated_atstring (date-time)
    • consecutive_failuresinteger

      Deliveries in a row that failed for good.

    • created_atstring (date-time)
    • updated_atstring (date-time)
  • secretstring

    The signing secret, shown only in this answer.

    e.g.whsec_4fJ9kQ2mX7pL1sV8nR3tY6wZ0aB5cD7x

Errors

400401403404409429

Example request
curl -X POST "https://api.ping.nml.sa/v1/webhook-endpoints/019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f/rotate-secret" \
  -H "Authorization: Bearer $PING_API_KEY"
Example response · 200
{
  "endpoint": {
    "id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
    "url": "https://erp.example.com/ping/webhooks",
    "description": "ERP alarms feed",
    "event_types": [
      "alarm.opened"
    ],
    "enabled": false,
    "disabled_reason": "owner",
    "disabled_at": "string",
    "secret_hint": "x7Qa",
    "secret_rotated_at": "string",
    "consecutive_failures": 0,
    "created_at": "string",
    "updated_at": "string"
  },
  "secret": "whsec_4fJ9kQ2mX7pL1sV8nR3tY6wZ0aB5cD7x"
}

Send the endpoint a webhook.test event (signed, retried like any other); the delivery is answered

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

Scopewebhooks:write

Parameters

  • endpointIdstring path required

    e.g.019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f

Response 202

  • idstring

    e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

  • endpoint_idstring

    e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

  • event_idstring

    e.g.019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c

  • typestring

    A delivered event's type: a WebhookEventType, or webhook.test.

    one ofalarm.openedalarm.clearedtrip.endedgeofence.enteredgeofence.exitedjob.dispatchedjob.startedjob.completedjob.cancelledwebhook.test

  • redelivery_ofstring | null

    The delivery this one sends again.

  • statestring

    one ofpendingsucceededfailed

  • failurestring | null

    Why it failed: every attempt failed, or the endpoint was disabled first.

    one ofexhaustedendpoint_disablednull

  • attemptsinteger
  • next_attempt_atstring | null (date-time)

    When it is tried next (pending only).

  • created_atstring (date-time)
  • done_atstring | null (date-time)

Errors

400401403404409429

Example request
curl -X POST "https://api.ping.nml.sa/v1/webhook-endpoints/019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f/test" \
  -H "Authorization: Bearer $PING_API_KEY"
Example response · 202
{
  "id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
  "endpoint_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
  "event_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
  "type": "trip.ended",
  "redelivery_of": "string",
  "state": "succeeded",
  "failure": "exhausted",
  "attempts": 0,
  "next_attempt_at": "string",
  "created_at": "string",
  "done_at": "string"
}