Webhook endpoints

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 retries

If your application does not answer with a 2xx, NexHealth retries the delivery seven times over about 11 hours: after 30 seconds, 2 minutes, 5 minutes, 15 minutes, 1 hour, 3 hours and 7 hours. Then it marks the delivery failed.

After more than 10 failed attempts in a row, NexHealth pauses the endpoint for 60 minutes and marks the events due in that hour skipped. When a delivery runs out of retries and the last 100 finished deliveries to the endpoint (successful or failed) all failed, NexHealth sets the endpoint's active field to false, emails you and stops sending. Otherwise, webhook endpoints do not expire.

To reactivate your endpoint, send a PATCH request to the endpoint and set active to true, then do the same for each of its subscriptions. See Setting up webhooks.

Sample response

{
  "code": true,
  "description": null,
  "error": null,
  "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": 1
}
ChangelogMCP serverErrorsdevelopers@nexhealth.com