DocsREST API
Webhooks API
Create, update, test and inspect webhooks for an organization.
Webhooks belong to an organization and fire for events in any of its projects. This page covers the management endpoints; for receiving and verifying deliveries, see the webhooks guide.
Listing webhooks and deliveries needs the viewer role; everything else needs admin. All routes need a session token. Webhooks are not available to API keys.
List webhooks
GET /v1/orgs/:orgId/webhooks
[
{
"id": "whk_3aa7f…",
"orgId": "org_77bqm…",
"url": "https://example.com/hooks/generic-translation",
"events": ["job.completed", "project.published"],
"enabled": true,
"createdAt": "2026-11-30T10:00:00.000Z",
"updatedAt": "2026-11-30T10:00:00.000Z"
}
]
The signing secret is never included in a listing.
Create a webhook
POST /v1/orgs/:orgId/webhooks
curl -X POST https://generic-translation-api.jacobfv123.workers.dev/v1/orgs/org_77bqm/webhooks \
-H "authorization: Bearer $GENERIC_TRANSLATION_SESSION" \
-H "content-type: application/json" \
-d '{ "url": "https://example.com/hooks/generic-translation", "events": ["job.completed", "project.published"] }'
| Field | Type | Required | Notes |
|---|---|---|---|
url |
string | yes | A public http(s) URL. Addresses on localhost or private networks are rejected. |
events |
string[] | yes | At least one of job.completed, job.failed, translation.updated, translation.approved, project.published. |
The response (status 201) is the webhook plus its secret (it starts with whsec_), which is returned only this once:
{
"id": "whk_3aa7f…",
"url": "https://example.com/hooks/generic-translation",
"events": ["job.completed", "project.published"],
"enabled": true,
"secret": "…",
"createdAt": "2026-11-30T10:00:00.000Z",
"updatedAt": "2026-11-30T10:00:00.000Z"
}
Errors: 400 invalid_request for an unknown event name, an empty events list or an unusable URL (localhost, .local / .internal hosts and private or link-local IP ranges are rejected).
Update or delete a webhook
| Route | Body |
|---|---|
PATCH /v1/orgs/:orgId/webhooks/:webhookId |
Any of url, events, enabled. |
DELETE /v1/orgs/:orgId/webhooks/:webhookId |
none |
Set "enabled": false to pause deliveries without losing the configuration or the secret. PATCH returns the updated webhook (without the secret); DELETE returns { "ok": true } and removes the delivery history. The secret cannot be rotated: delete the webhook and create a new one.
Send a test event
POST /v1/orgs/:orgId/webhooks/:webhookId/test
Sends a signed webhook.test event to the URL (even if the webhook is disabled or not subscribed to it) and returns the delivery record with the event as payload, so you can check your endpoint and signature verification without waiting for a real event.
{
"id": "dlv_0q8n1…",
"webhookId": "whk_3aa7f…",
"eventId": "evt_71kc4…",
"eventType": "webhook.test",
"success": true,
"statusCode": 200,
"error": null,
"durationMs": 182,
"attempt": 1,
"nextRetryAt": null,
"createdAt": "2026-11-30T10:00:22.000Z",
"payload": {
"id": "evt_71kc4…",
"type": "webhook.test",
"createdAt": "2026-11-30T10:00:22.000Z",
"data": { "webhookId": "whk_3aa7f…", "message": "This is a test event from Generic Translation." }
}
}
List deliveries
GET /v1/orgs/:orgId/webhooks/:webhookId/deliveries
Recent delivery attempts, newest first. Query: limit (1 to 200, default 50). Each item also includes the payload that was sent.
[
{
"id": "dlv_0q8n1…",
"webhookId": "whk_3aa7f…",
"eventId": "evt_71kc4…",
"eventType": "job.completed",
"success": true,
"statusCode": 200,
"error": null,
"durationMs": 182,
"attempt": 1,
"nextRetryAt": null,
"createdAt": "2026-11-30T10:00:22.000Z"
}
]
A delivery is successful when your endpoint answers with a 2xx status within 10 seconds. Redirects are not followed. error describes what went wrong otherwise.
attempt is 1-based. A failed attempt is retried by a cron after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours (6 attempts in all); nextRetryAt is the ISO timestamp of the pending retry, or null when none is scheduled (the delivery succeeded, was the last attempt, or was claimed by a retry already). Each attempt is its own delivery row and carries the same eventId. webhook.test is never retried. See Retries.
Something wrong or unclear on this page? Open an issue.