GET /webhooks List webhooks

Returns all registered webhooks for your account.

Example Request

bash
curl -X GET \
  "https://api.sonarhealth.co/v1/webhooks" \
  -H "Authorization: Bearer $TOKEN"

Response 200 Webhook list

json
{
  "data": [
    {
      "id": "whk_abc123",
      "url": "https://yourapp.com/webhooks/sonar",
      "events": [
        "data.updated",
        "score.updated"
      ],
      "status": "active",
      "created_at": "2025-01-15T10:00:00Z",
      "last_delivery_at": "2025-01-20T08:31:00Z"
    }
  ]
}
POST /webhooks Register a webhook

Registers an endpoint to receive real-time event notifications via HTTP POST. Sonar signs every request with HMAC-SHA256.

Example Request

bash
curl -X POST \
  "https://api.sonarhealth.co/v1/webhooks" \
  -H "Authorization: Bearer $TOKEN"
PATCH /webhooks/{webhook_id} Update a webhook

Updates a webhook's URL, subscribed events, or active status.

ParameterInTypeRequiredDescription
webhook_idpathstringrequiredWebhook ID

Example Request

bash
curl -X PATCH \
  "https://api.sonarhealth.co/v1/webhooks/:webhook_id" \
  -H "Authorization: Bearer $TOKEN"

Response 200 Updated webhook

json
{
  "data": {
    "id": "whk_abc123",
    "url": "https://yourapp.com/webhooks/sonar",
    "events": [
      "data.updated",
      "score.updated",
      "device.connected",
      "device.disconnected"
    ],
    "status": "active"
  }
}
DELETE /webhooks/{webhook_id} Delete a webhook

Removes a webhook. Pending deliveries for this webhook will be cancelled.

ParameterInTypeRequiredDescription
webhook_idpathstringrequiredWebhook ID

Example Request

bash
curl -X DELETE \
  "https://api.sonarhealth.co/v1/webhooks/:webhook_id" \
  -H "Authorization: Bearer $TOKEN"