Skip to main content

Payload structure

Every event shares the same envelope:
JSON
{
  "webhook_event": "generation.completed",
  "webhook_timestamp": "...",
  "webhook_delivery_id": "...",
  "webhook_data": { ... }
}
webhook_event
string
Event type - one of the values below.
webhook_timestamp
string
Timestamp when the event was dispatched (ISO 8601).
webhook_delivery_id
string
Unique delivery identifier (UUID). Use this for idempotency.
webhook_data
object
Generation snapshot that triggered the event.

webhook_data

Only fields with values are included. Optional fields are omitted (not set to null) when they do not apply to the event.
FieldPresent on
account_idAll events
model_identifierAll events
generation_provider_initializegeneration.started
generation_provider_usedgeneration.completed
generation_statusAll events
generation_prediction_idgeneration.started, generation.completed
generation_idAll events
generation_output_filegeneration.completed
generation_errorgeneration.failed
generation_error_codegeneration.failed
credits_refundedgeneration.canceled

generation.started

Fired when BabySea has submitted the generation to an inference provider and processing has begun. Use this event to track that a generation is in-flight.
  • The webhook_data.generation_status will be processing.
JSON
{
  "webhook_event": "generation.started",
  "webhook_timestamp": "...",
  "webhook_delivery_id": "...",
  "webhook_data": {
    "account_id": "...",
    "model_identifier": "...",
    "generation_provider_initialize": "...",
    "generation_status": "processing",
    "generation_prediction_id": "...",
    "generation_id": "..."
  }
}

generation.completed

Fired when all output images have been generated and stored.
  • The webhook_data.generation_status will be succeeded.
  • The webhook_data.generation_output_file will contain the output URL.
JSON
{
  "webhook_event": "generation.completed",
  "webhook_timestamp": "...",
  "webhook_delivery_id": "...",
  "webhook_data": {
    "account_id": "...",
    "model_identifier": "...",
    "generation_provider_used": "...",
    "generation_status": "succeeded",
    "generation_prediction_id": "...",
    "generation_id": "...",
    "generation_output_file": [
      "..."
    ]
  }
}

generation.failed

Fired when all inference providers in the failover chain returned errors or timed out.
  • The webhook_data.generation_status will be failed.
  • No credits are charged for failed generations.
JSON
{
  "webhook_event": "generation.failed",
  "webhook_timestamp": "...",
  "webhook_delivery_id": "...",
  "webhook_data": {
    "account_id": "...",
    "model_identifier": "...",
    "generation_status": "failed",
    "generation_id": "...",
    "generation_error": "...",
    "generation_error_code": "..."
  }
}

generation.canceled

Fired when the user called POST /image-generation/{generation_id}/cancel.
  • The webhook_data.generation_status will be canceled.
  • The credits_refunded field indicates whether credits were refunded for this generation.
JSON
{
  "webhook_event": "generation.canceled",
  "webhook_timestamp": "...",
  "webhook_delivery_id": "...",
  "webhook_data": {
    "account_id": "...",
    "model_identifier": "...",
    "generation_status": "canceled",
    "generation_id": "...",
    "credits_refunded": true
  }
}

webhook.test

Fired when you click Send test event in your BabySea workspace. Use this event to verify that your endpoint is reachable and correctly verifying signatures.
  • Test events use a fixed generation_id of 00000000-0000-0000-0000-000000000000 and are not retried on failure. You can send another test event manually.
JSON
{
  "webhook_event": "webhook.test",
  "webhook_timestamp": "...",
  "webhook_delivery_id": "...",
  "webhook_data": {
    "account_id": "...",
    "model_identifier": "test",
    "generation_status": "succeeded",
    "generation_id": "00000000-0000-0000-0000-000000000000"
  }
}