API reference

Send test event

Send a test webhook event to your configured endpoints.

Send a test webhook event to all endpoints configured for the API key.

POST/v1/webhooks/send_test_eventPermissions: read

Endpoint

HTTP request

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

Use POST with a JSON body.

Permissions

read

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 API key id to assert; must match the authenticated key.
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_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "eventType": "generation.completed",    "mode": "live"  }'

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.
Successful response
{  "svixMessageId": "msg_123",  "eventId": "evt_123",  "eventType": "generation.completed",  "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 read permission, or does not match 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.
  • samplePayload can override payload fields, but eventType, eventId, createdAt, apiKeyId, and status are always set by Diffio.