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_eventPermissions: webhooks:write

Endpoint

HTTP request

https://api.diffio.ai/v1/webhooks/send_test_event

Use 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

FieldTypeRequiredDescription
eventTypestringYesWebhook event type to send.
modestringYesWebhook mode, either test or live.
apiKeyIdstringNoOptional target API key id. Non-admin keys can only target themselves.
samplePayloadobjectNoOptional fields to merge into the generated test payload.
samplePayload.apiProjectIdstringNoOptional 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

FieldTypeRequiredDescription
svixMessageIdstringYesMessage id assigned by Svix.
eventIdstringYesEvent id generated for the test event.
eventTypestringYesEvent type that was sent.
modestringYesWebhook mode used for delivery.
apiKeyIdstringYesAPI 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.