GET /generations/{id}, you can pass webhook_url when you create a generation. Codzen then sends the finished generation to that URL in a POST request.
webhook_url must be an HTTPS URL. It is set per generation; there is no account-wide webhook to register.
When webhooks are sent
A webhook is sent only once the generation reaches a terminal state:succeeded or failed. There is no webhook for queued or processing.
The request body is the finished generation, exactly as GET /generations/{id} returns it:
The webhook reference has the same payload as a schema.
Delivery and retries
- Answer with any 2xx status to confirm the delivery. Any other status, a timeout or a connection error counts as a failure.
- Failed deliveries are retried with exponential backoff for 24 hours, then dropped. A failed delivery never changes the generation; you can still read it with
GET /generations/{id}. - Delivery is at least once. The same webhook can arrive more than once. Every retry carries the same
webhook-idheader, so store the IDs you have handled and skip a webhook whose ID you have already seen. - Order is not guaranteed across generations. Use each generation’s
idandstatus, not arrival order.
200, and do slow work such as downloading outputs afterwards.
Verify the signature
Webhooks follow the Standard Webhooks specification. Every webhook carries three headers:
Each signature is an HMAC-SHA256 of the string
<webhook-id>.<webhook-timestamp>.<body>, keyed with your webhook signing secret. The secret looks like whsec_<base64>; the key is the base64-decoded part after whsec_. Your account has one webhook signing secret, which you can view and rotate in the console.
To verify a webhook:
- Read the raw request body as bytes, before any JSON parsing. Re-serialized JSON will not match the signature.
- Reject the webhook if
webhook-timestampis more than 5 minutes from your clock, so that a captured request cannot be replayed later. - Compute the HMAC-SHA256 of
<webhook-id>.<webhook-timestamp>.<body>and base64-encode it. - Accept the webhook if any
v1signature inwebhook-signaturematches, compared in constant time.
Rotate the webhook signing secret
You can rotate the webhook signing secret in the console at any time. Rotation creates a new secret right away, and the old one stays valid for 24 hours. During those 24 hours, every webhook’swebhook-signature carries two signatures, one made with each secret, separated by a space.
To rotate without dropping webhooks:
- Rotate the secret in the console and copy the new one.
- Deploy the new secret to your webhook handler within 24 hours. Because each webhook is signed with both secrets meanwhile, the handler accepts webhooks with either the old or the new secret, and the examples above need no change.
- After 24 hours, webhooks carry only the new signature.

