API reference

Webhooks

Endpoints that receive an app's events as signed POST requests, and the API that manages them.

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:

HeaderValue
AuthorizationBearer and the app key (scapp_...), or a workspace key of the app's workspace or one above it
X-AuthorizationBearer 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#

FieldTypeDescription
idstringUUID of the endpoint.
app_idstringUUID of the app.
urlstringWhere deliveries are sent. Unique within the app.
descriptionstringFree text.
enabledbooleanOff means no deliveries. Default true.
event_typesarrayEvent slugs the endpoint receives, or ["*"] for all.
retry_limitintegerAttempts per delivery, 0 to 10. Default 3.
versionstringPayload version, sent as api_version. Default v1.
metadataobjectDefault {}.
last_ping_atstringISO 8601 time, or null.
consecutive_failuresintegerFailed deliveries in a row.
circuit_open_untilstringEnd of the current pause, or null.
pausedbooleantrue while deliveries are paused.
pause_after_failuresintegerFailures in a row that pause the endpoint: 5.
pause_minutesintegerLength of a pause: 5.
secret_setbooleantrue when the endpoint has a signing secret.
secretstringThe signing secret. Only in the create and rotate responses.
created_at, updated_atstringISO 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#

GET/v1/webhooks/event_typesApp key + access token

Returns the catalog of event slugs you can subscribe to. It is the same for every app.

cURLbash
curl https://api.scute.io/v1/webhooks/event_types \  -H "Authorization: Bearer $SCUTE_APP_KEY" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"
Response 200json
{  "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#

GET/v1/apps/:app_id/webhooksApp key + access token
cURLbash
curl https://api.scute.io/v1/apps/$SCUTE_APP_ID/webhooks \  -H "Authorization: Bearer $SCUTE_APP_KEY" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"
Response 200json
{  "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#

POST/v1/apps/:app_id/webhooksApp key + access token

Send the fields inside a webhook_endpoint object.

webhook_endpoint.urlstringrequired
An http or https URL. Private, local and internal addresses (localhost, .local, .internal, .lan, .home.arpa, private IP ranges) are refused.
webhook_endpoint.event_typesstring[]required
Event slugs in category.action form, or *.
webhook_endpoint.descriptionstring
Free text.
webhook_endpoint.enabledboolean
Default true.
webhook_endpoint.retry_limitinteger
0 to 10. Default 3.
cURLbash
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": ["*"]}}'
Response 201json
{  "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#

GET/v1/apps/:app_id/webhooks/:idApp key + access token

Returns { "webhook_endpoint": { ... } }. An unknown id returns 404 with error_code webhook_endpoint_not_found.

Update an endpoint#

PATCH/v1/apps/:app_id/webhooks/:idApp key + access token

Takes the same webhook_endpoint fields as create. Send only the fields you change.

cURLbash
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#

DELETE/v1/apps/:app_id/webhooks/:idApp key + access token

Deletes the endpoint and its delivery history. Returns 200 with { "success": true }.

Send a test event#

POST/v1/apps/:app_id/webhooks/:id/testApp key + access token

Sends a webhook.test event to this endpoint only, whatever it subscribes to. A test is sent even while the endpoint is paused.

Response 200json
{  "message": "Test webhook dispatched",  "delivery_id": "0193f901-7c1d-7b3b-9a10-2f6f1c0d3b7c",  "paused": false,  "paused_until": null}

Rotate the signing secret#

POST/v1/apps/:app_id/webhooks/:id/rotate_secretApp key + access token

Replaces 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#

GET/v1/apps/:app_id/webhooks/:id/deliveriesApp key + access token

Newest first, 25 per page.

pageinteger
Page number. Default 1.
statusstring
One status, or several separated by commas: pending, processing, delivered, failed, skipped. Any other value returns 422 with error_code invalid_status.
Response 200json
{  "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#

POST/v1/apps/:app_id/webhooks/:webhook_id/deliveries/:id/redeliverApp key + access token

Creates 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#

POST/v1/apps/:app_id/webhooks/:id/retry_failedApp key + access token

Sends 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.

Response 201json
{  "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:

HeaderValue
Content-Typeapplication/json
User-AgentAppName-Webhooks/1.0
X-Webhook-Signaturet=<timestamp>,v1=<signature>
Bodyjson
{  "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"}
FieldDescription
idThe delivery's id. Automatic retries of a delivery keep it, so use it as the idempotency key. A redelivery has a new id.
app_idPublic id (app_...) of the app.
workspace_idUUID of the app's workspace. Present for apps outside an MSP.
msp_workspace_idUUID 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_idMicrosoft Entra tenant id, on events that carry one.
verification_id, challenge_idThe challenge id, on challenge events. Both carry the same value.
created_atWhen the delivery was created.
event_typeThe 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.
metadataThe 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).
dataFields specific to the event.
api_versionThe 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.