A webhook endpoint is a URL on your server that Scute sends an app's events to. Each endpoint belongs to one app and subscribes to a list of event types. The events are listed in the event catalog.
Authentication#
Every webhook endpoint call takes two headers:
| Header | Value |
|---|---|
| Authorization | Bearer and the app key (scapp_...), or a workspace key of the app's workspace or one above it |
| X-Authorization | Bearer and an M2M token (scm2m_...) of the app |
Reads need the M2M token's read scope. Create, update, delete, test, rotate and redeliver need write. See Authentication.
The webhook endpoint object#
| Field | Type | Description |
|---|---|---|
| id | string | UUID of the endpoint. |
| app_id | string | UUID of the app. |
| url | string | Where deliveries are sent. Unique within the app. |
| description | string | Free text. |
| enabled | boolean | Off means no deliveries. Default true. |
| event_types | array | Event slugs the endpoint receives, or ["*"] for all. |
| retry_limit | integer | Attempts per delivery, 0 to 10. Default 3. |
| version | string | Payload version, sent as api_version. Default v1. |
| metadata | object | Default {}. |
| last_ping_at | string | ISO 8601 time, or null. |
| consecutive_failures | integer | Failed deliveries in a row. |
| circuit_open_until | string | End of the current pause, or null. |
| paused | boolean | true while deliveries are paused. |
| pause_after_failures | integer | Failures in a row that pause the endpoint: 5. |
| pause_minutes | integer | Length of a pause: 5. |
| secret_set | boolean | true when the endpoint has a signing secret. |
| secret | string | The signing secret. Only in the create and rotate responses. |
| created_at, updated_at | string | ISO 8601 times. |
The list response also adds last_delivery to each endpoint: the newest delivery (id, status, response_code, error_message, retry_count, delivered_at, created_at, and event with id and event_type), or null when nothing was sent yet.
List event types#
/v1/webhooks/event_typesApp key + access tokenReturns the catalog of event slugs you can subscribe to. It is the same for every app.
curl https://api.scute.io/v1/webhooks/event_types \ -H "Authorization: Bearer $SCUTE_APP_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "categories": [ { "value": "user", "label": "User lifecycle", "description": "User created, changed, deactivated, deleted, and support sign ins as a user" } ], "event_types": [ { "slug": "user.created", "category": "user", "label": "User created", "description": "..." } ]}List endpoints#
/v1/apps/:app_id/webhooksApp key + access tokencurl https://api.scute.io/v1/apps/$SCUTE_APP_ID/webhooks \ -H "Authorization: Bearer $SCUTE_APP_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "webhook_endpoints": [ { "id": "6f1c0d3b-7c1d-4b3b-9a10-2f6f1c0d3b7c", "url": "https://example.com/scute/webhook", "description": "Production", "enabled": true, "event_types": ["user.created", "challenge.completed"], "retry_limit": 3, "version": "v1", "secret_set": true, "paused": false, "pause_after_failures": 5, "pause_minutes": 5, "last_delivery": null } ]}Create an endpoint#
/v1/apps/:app_id/webhooksApp key + access tokenSend the fields inside a webhook_endpoint object.
curl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/webhooks \ -H "Authorization: Bearer $SCUTE_APP_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \ -H "Content-Type: application/json" \ -d '{"webhook_endpoint": {"url": "https://example.com/scute/webhook", "event_types": ["*"]}}'{ "webhook_endpoint": { "id": "6f1c0d3b-7c1d-4b3b-9a10-2f6f1c0d3b7c", "url": "https://example.com/scute/webhook", "enabled": true, "event_types": ["*"], "retry_limit": 3, "secret_set": true, "secret": "9f2c..." }, "secret": "9f2c..."}The secret is 64 hex characters. Store it: no other read returns it. A lost secret means rotating it.
Validation failures return 422 with the messages in error.
Get an endpoint#
/v1/apps/:app_id/webhooks/:idApp key + access tokenReturns { "webhook_endpoint": { ... } }. An unknown id returns 404 with error_code webhook_endpoint_not_found.
Update an endpoint#
/v1/apps/:app_id/webhooks/:idApp key + access tokenTakes the same webhook_endpoint fields as create. Send only the fields you change.
curl -X PATCH https://api.scute.io/v1/apps/$SCUTE_APP_ID/webhooks/$WEBHOOK_ID \ -H "Authorization: Bearer $SCUTE_APP_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \ -H "Content-Type: application/json" \ -d '{"webhook_endpoint": {"enabled": false}}'Delete an endpoint#
/v1/apps/:app_id/webhooks/:idApp key + access tokenDeletes the endpoint and its delivery history. Returns 200 with { "success": true }.
Send a test event#
/v1/apps/:app_id/webhooks/:id/testApp key + access tokenSends a webhook.test event to this endpoint only, whatever it subscribes to. A test is sent even while the endpoint is paused.
{ "message": "Test webhook dispatched", "delivery_id": "0193f901-7c1d-7b3b-9a10-2f6f1c0d3b7c", "paused": false, "paused_until": null}Rotate the signing secret#
/v1/apps/:app_id/webhooks/:id/rotate_secretApp key + access tokenReplaces the secret and returns the new one in secret, with the endpoint. There is no overlap: every delivery sent after the call is signed with the new secret. Update your verifier first.
List deliveries#
/v1/apps/:app_id/webhooks/:id/deliveriesApp key + access tokenNewest first, 25 per page.
{ "deliveries": [ { "id": "0193f901-7c1d-7b3b-9a10-2f6f1c0d3b7c", "webhook_endpoint_id": "6f1c0d3b-7c1d-4b3b-9a10-2f6f1c0d3b7c", "event_id": "0193f8ff-1111-7222-8333-444444444444", "status": "failed", "response_code": 500, "response_body": "Internal Server Error", "error_message": "HTTP 500: Internal Server Error", "retry_count": 3, "delivered_at": null, "created_at": "2026-11-18T10:00:00Z", "updated_at": "2026-11-18T10:05:00Z", "event": { "id": "0193f8ff-1111-7222-8333-444444444444", "created_at": "2026-11-18T10:00:00Z", "event_type": "user.created", "app_id": "...", "data": {}, "metadata": null }, "payload": { "id": "0193f901-7c1d-7b3b-9a10-2f6f1c0d3b7c", "event_type": "user.created" } } ], "meta": { "total_count": 1, "total_pages": 1, "current_page": 1 }}payload is the body as sent to your endpoint.
Redeliver one delivery#
/v1/apps/:app_id/webhooks/:webhook_id/deliveries/:id/redeliverApp key + access tokenCreates a new delivery of the same event with a fresh retry budget. The original stays in the history. Returns 201 with the new row in delivery. An unknown delivery returns 404 with error_code delivery_not_found.
Retry failed deliveries#
/v1/apps/:app_id/webhooks/:id/retry_failedApp key + access tokenSends every failed delivery of the endpoint again, as new deliveries. It takes failed deliveries from the last 7 days whose automatic retries are over, one per event, and only when the failed delivery is still the event's newest one. At most 100 per call, oldest first.
{ "retried": 12, "delivery_ids": ["..."], "remaining": 0, "window_days": 7, "limit": 100}Call it again while remaining is above 0. A disabled endpoint returns 422 with error_code webhook_endpoint_disabled.
The delivery request#
Scute sends each event as a POST with a JSON body and these headers:
| Header | Value |
|---|---|
| Content-Type | application/json |
| User-Agent | AppName-Webhooks/1.0 |
| X-Webhook-Signature | t=<timestamp>,v1=<signature> |
{ "id": "0193f901-7c1d-7b3b-9a10-2f6f1c0d3b7c", "app_id": "app_3mxZRrzWxhPZ08dXvqq6", "workspace_id": "0193f8aa-0000-7000-8000-000000000000", "verification_id": "0193f901-aaaa-7b3b-9a10-2f6f1c0d3b7c", "challenge_id": "0193f901-aaaa-7b3b-9a10-2f6f1c0d3b7c", "created_at": "2026-11-18T10:00:00Z", "event_type": "verification.success", "user": { "id": "0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee" }, "metadata": { "ticket_id": "T-123" }, "data": { "purpose": "verify_identity", "method": "magic_link" }, "api_version": "v1"}| Field | Description |
|---|---|
| id | The delivery's id. Automatic retries of a delivery keep it, so use it as the idempotency key. A redelivery has a new id. |
| app_id | Public id (app_...) of the app. |
| workspace_id | UUID of the app's workspace. Present for apps outside an MSP. |
| msp_workspace_id | UUID of the MSP workspace. Present instead of workspace_id when the app belongs to an MSP workspace or one of its client workspaces. |
| ms_tenant_id | Microsoft Entra tenant id, on events that carry one. |
| verification_id, challenge_id | The challenge id, on challenge events. Both carry the same value. |
| created_at | When the delivery was created. |
| event_type | The event slug. challenge.created, challenge.completed and challenge.failed are sent as verification.attempted, verification.success and verification.failed. |
| user | { "id": ... } with the app user's UUID. No email or phone. Omitted on events with no user. |
| metadata | The event's metadata. For a challenge, the metadata you passed when you created it. The internal _plain_code is removed, and an msp object keeps its routing ids only (name, logo_url and primary_color are removed). |
| data | Fields specific to the event. |
| api_version | The endpoint's version. |
Fields with no value are left out.
Verify the signature#
X-Webhook-Signature is t=<timestamp>,v1=<signature>:
- <timestamp> is the delivery's creation time in Unix seconds. Retries of a delivery send the same value.
- <signature> is the hex HMAC-SHA256 of <timestamp>.<raw body>, keyed with the endpoint's secret.
Compute it over the raw request body, before any JSON parsing, and compare in constant time.
import { createHmac, timingSafeEqual } from "node:crypto";export function verifyScuteWebhook(rawBody: string, header: string, secret: string): boolean { const parts = Object.fromEntries(header.split(",").map((p) => p.split("=", 2))); const expected = createHmac("sha256", secret).update(`${parts.t}.${rawBody}`).digest("hex"); const given = Buffer.from(parts.v1 ?? "", "utf8"); const want = Buffer.from(expected, "utf8"); return given.length === want.length && timingSafeEqual(given, want);}Delivery and retries#
- A 2xx response marks the delivery delivered. Any other status counts as a failure. Redirects are not followed and count as failures.
- Scute waits 10 seconds to connect and 10 seconds for the response.
- A failed delivery is tried again with increasing delays until it has been attempted retry_limit times (default 3), and at most 5 times in all.
- After 5 failed deliveries in a row, the endpoint is paused for 5 minutes. Events raised during the pause are recorded as skipped deliveries and not sent. The first event after the pause is sent normally: a success clears the count, a failure pauses the endpoint again.
- A URL whose host resolves to a private or internal address fails at send time.
Subscriptions#
- * matches every event except app.authz.decisions, which an endpoint receives only by naming it.
- challenge.completed, challenge.failed, challenge.denied, challenge.expired, challenge.created, challenge.sent and challenge.attempted also match the method-specific events of the same outcome, for example challenge.entra_push.completed.
- admin_action.all matches every admin_action.* event.
- verification.success, verification.failed and verification.attempted match challenge.completed, challenge.failed and challenge.created. verification.email.sent matches verification.email.requested.