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 respond with a 2xx status code, NexHealth retries on the schedule below. If errors continue for 48 hours, NexHealth sets the webhook endpoint's active field to false and stops sending webhooks. Otherwise, webhook endpoints do not expire.

To reactivate your endpoint, send a PATCH request to the subscription or endpoint and set active to true.

Retry #Total time
130 sec
21.5 min
33.5 min
410 min
530 min
62 hours
75 hours
810 hours
924 hours
1048 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
}