Forward function response data to an external endpoint via POST by adding theDocumentation Index
Fetch the complete documentation index at: https://cerebrium.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
webhookEndpoint query parameter to any API call:
Retry Behavior
Webhook requests are sent asynchronously and do not block the function’s response. Failed deliveries are retried automatically:- Maximum attempts: 3 attempts total
- Delay between retries: Up to 5 seconds between attempts
- Network errors (connection failures, timeouts) will trigger retries
404 Not Foundresponses will trigger retries (endpoint may be temporarily unreachable)- Other
4xxclient errors will not be retried (considered permanent failures) 5xxserver errors will not be retried (to avoid potential duplicate side effects)- Non-2xx responses (excluding the above) will trigger retries
{"smile": "wave"}, the proxy sends a POST like this to the webhook:
Cerebrium does not literally use
curl. This is illustrative of the request
the webhook endpoint receives.Webhook Signature Verification
Verify that webhooks originate from Cerebrium using signature verification:- Include an
X-Webhook-Secretheader with a secret value when making requests to the Cerebrium API. - Incoming webhooks include the following headers:
X-Request-Id: A unique identifier for the requestX-Cerebrium-Webhook-Timestamp: The Unix timestamp when the webhook was sentX-Cerebrium-Webhook-Signature: The signature in the formatv1,<signature>
- To verify the signature:
The body should include everything returned from cerebrium (run_id, function
response, timestamp etc) not just your function response