API reference
Send test event
Send a test webhook event to your configured endpoints. Review Diffio API behavior, response fields, setup details, and production workflows.
Send a test webhook event to all endpoints configured for the API key.
POST
/v1/webhooks/send_test_eventEndpoint
HTTP request
https://api.diffio.ai/v1/webhooks/send_test_eventUse POST with a JSON body.
Permissions
webhooks:write
API keys must be active.
Authentication
Send the API key on every request using one of the supported headers.
Authorization: Bearer <apiKey>X-Api-Key: <apiKey>Xi-Api-Key: <apiKey>
Request
Provide the event type and mode for the test webhook.
Body fields
| Field | Type | Required | Description |
|---|---|---|---|
eventType | string | Yes | Webhook event type to send. |
mode | string | Yes | Webhook mode, either test or live. |
apiKeyId | string | No | Optional target API key id. Non-admin keys can only target themselves. |
samplePayload | object | No | Optional fields to merge into the generated test payload. |
samplePayload.apiProjectId | string | No | Optional project id override for the test payload. |
cURL
curl -X POST "https://api.diffio.ai/v1/webhooks/send_test_event" \ -H "Authorization: Bearer $DIFFIO_WEBHOOK_KEY" \ -H "Content-Type: application/json" \ -d '{ "eventType": "generation.completed", "mode": "live", "apiKeyId": "key_123" }'Response
Returns the message id and metadata for the test webhook.
Response fields
| Field | Type | Required | Description |
|---|---|---|---|
svixMessageId | string | Yes | Message id assigned by Svix. |
eventId | string | Yes | Event id generated for the test event. |
eventType | string | Yes | Event type that was sent. |
mode | string | Yes | Webhook mode used for delivery. |
apiKeyId | string | Yes | API key id used for the test event payload. |
Successful response
{ "svixMessageId": "msg_123", "eventId": "evt_123", "eventType": "generation.completed", "apiKeyId": "key_123", "mode": "live"}Return codes
200Success, treated as complete.: Test webhook sent.204Success, treated as empty response.: CORS preflight when method is OPTIONS.400Bad request, treated as client error.: Invalid JSON body, eventType is required, eventType is not supported, mode must be test or live, samplePayload must be an object.401Unauthorized, treated as auth error.: Missing API key, or invalid API key.403Forbidden, treated as permission error.: API key is not active, missing webhooks:write permission, or a non-admin key requested another apiKeyId.405Client error, treated as fix required.: Method is not POST.500Server error, treated as retryable.: Svix is not configured, failed to initialize webhook app, or failed to send test webhook.
Notes
- eventType must be one of generation.queued, generation.processing, generation.failed, or generation.completed.
- mode controls whether the test event is delivered to test or live endpoints.
- Admin keys can send a test event for another key on the same account by passing apiKeyId.
- samplePayload can override payload fields, but eventType, eventId, createdAt, apiKeyId, and status are always set by Diffio.
