Setting up a webhook endpoint is the first step to using NexHealth webhooks.
To start, send a POST request to webhook_endpoints with the URL where you want to receive messages. Webhook messages may contain Protected Health Information (PHI), so you must use a secure HTTPS URL.
The response gives you an ID for the new webhook endpoint. Your server is publicly reachable, so the endpoint also includes a secret key. Use it to check the signature on each incoming message, so you know it came from NexHealth. See Setting up webhooks.
After you set up your endpoint, subscribe to the events you want to receive. NexHealth sends nothing to the endpoint until it has at least one subscription. See webhook subscriptions.
Webhook retriesIf your application does not respond with a 2xx status code, NexHealth retries on the schedule below. If errors continue for 48 hours, NexHealth sets the webhook endpoint's
activefield tofalseand stops sending webhooks. Otherwise, webhook endpoints do not expire.To reactivate your endpoint, send a
PATCHrequest to the subscription or endpoint and setactivetotrue.
Retry # Total time 1 30 sec 2 1.5 min 3 3.5 min 4 10 min 5 30 min 6 2 hours 7 5 hours 8 10 hours 9 24 hours 10 48 hours
Sample response
{
"code": true,
"description": [
[
"Description"
]
],
"error": [
[
"Error"
]
],
"data": [
{
"id": 1,
"target_url": "https://your-app.example.com/hooks",
"secret_key": "***",
"active": true,
"created_at": "2020-06-05T20:16:57.007Z",
"updated_at": "2020-06-05T20:16:57.007Z"
}
],
"count": 2
}