Webhooks

Monitor and manage the status of webhook events via the public api

Our webhook system allows you to automate processes by sending event notifications to a designated URL when certain actions occur. Once a webhook is configured, it will automatically generate webhook events. These events will trigger HTTP requests to the specified webhook URL, delivering real-time data related to the event. With these endpoints you can check the status of webhook events and update the status, allowing you to requeue failed events for retry.

The status of the webhook events can be one of the following:

  • pending: Webhook event has been created and is queued for a request to be executed.
  • success: Webhook event has executed a request that has received a success response (i.e. 2xx response code).
  • failing: Webhook event has executed a request that resulted in a failed response. The event is still queued to be retried.
  • failed: All webhook event requests have resulted in failed responses and no more retries are scheduled.

List

Request a list of webhook events optionally filtered by status and startDate/endDate

Request

Endpoint

POST /v1/webhooks-events

Query Parameters

NameTypeDescription
statusenumAvailable values: pending, success, failing, failed
endDate optionalstringDate string in format of YYYY-MM-DD e.g. 2024-01-14.
startDate optionalstringDate string in format of YYYY-MM-DD e.g. 2024-01-14.
cursor optionalstringCursor for pagination purposes.

Response

HTTP status code

200

Body

{
  "data": [
    {
      "id": "1e7da25e-b8bc-4eda-b31b-c617f28f2c51",
      "status": "pending",
      "headers": {},
      "eventType": "Unspecified",
      "payload": "string",
      "metadata": {
        "patientId": "9890ed24-405d-4688-abcd-b7f829d75939"
      },
      "uri": "string",
      "format": "string",
      "createdAt": "2024-10-14T07:32:28.381Z",
      "updatedAt": "2024-10-14T07:32:28.381Z"
    }
  ],
  "meta": {
    "perPage": 50,
    "nextCursor": "eyJBbGVyd...",
    "nextPageUrl": "https://next.page/?cursor=eyJBbGVyd...",
    "prevCursor": "eyJBbGVyd...",
    "prevPageUrl": "https://next.page/?cursor=eyJBbGVyd..."
  }
}

Get

Get a detailed view of a specified webhook event. Including the requests that have been made for the event.

Request

Endpoint

POST /v1/webhooks-events/{event-id}

Path Parameters

NameTypeDescription
eventId requiredstring (UUID)The identifier for the requested webhook event, in the format of a UUID

Response

HTTP status code

200

Body

{
  "data": {
    "id": "1e7da25e-b8bc-4eda-b31b-c617f28f2c51",
    "status": "success",
    "headers": {},
    "eventType": "Unspecified",
    "payload": "string",
    "metadata": {
      "patientId": "9890ed24-405d-4688-abcd-b7f829d75939"
    },
    "uri": "string",
    "format": "string",
    "createdAt": "2024-10-14T07:38:18.414Z",
    "updatedAt": "2024-10-14T07:38:18.414Z",
    "requests": [
      {
        "id": "a701d246-e1c3-49db-9e7e-40483bcbdb11",
        "httpMessage": "string",
        "responseStatusCode": 200,
        "responseBodyPrefix": "OK",
        "createdAt": "2024-10-14T07:38:18.414Z",
        "updatedAt": "2024-10-14T07:38:18.414Z"
      }
    ]
  },
  "meta": {}
}

Patch

Allows the updating of webhook event statuses. If a status is updated back to pending the webhook event will be requeued and new requests will be attempted.

Request

Endpoint

PATCH /v1/webhooks-events/

Body

[
  {
    "id": "9890ed24-405d-4688-abcd-b7f829d75939",
    "status": "pending"
  },
  {
    "id": "9890ed24-405d-4688-abcd-b7f829d75939",
    "status": "pending"
  }
]

Response

HTTP status code

204