Aibubu
Visit Aibubu ↗
Task management

Webhooks

Receive signed task, balance, and credit-pack events through workspace webhooks or a per-request callback_url, without giving up polling.

POST/v1/generations

There are two ways to receive events, and both belong to a workspace, not to an API key:

  • Workspace webhooks: subscribe one or more endpoints to event types; every matching event in the workspace is delivered.
  • Per-request callback_url: a single task's terminal event is delivered to the URL passed with that request.

Personal workspaces (Owner) and team workspaces (Owner or Admin) can configure both in the platform console at /console/webhooks, and workspaces never see each other's configuration. Webhook delivery and polling can coexist; polling remains the recovery path if a receiver is unavailable.

Delivery model

  • Task events: task.succeeded, task.failed, and task.canceled
  • Billing events: balance.low and credits.granted
  • running progress is not pushed in v1
  • Each payload is { id, type, created_at, api_version, data }. A task event's id is stable (evt_task_<task_id>_<event>) and is the same for the workspace webhook delivery and the callback_url delivery of that event.

Signing

Workspace webhooks and callback_url callbacks share the same signature and headers:

HeaderMeaning
Aibubu-Signaturet=<unix>,v1=<hex>; carries several v1= values for 24 hours after a secret rotation
X-Aibubu-TimestampSame value as t in the signature
X-Aibubu-Event, Aibubu-EventEvent type; both spellings carry the same value
X-Aibubu-Delivery-ID, Aibubu-Delivery-IDUnique delivery ID; both spellings carry the same value

Compute HMAC-SHA256(secret, "{timestamp}.{raw_body}") as hex and accept the delivery if any v1 matches. Read the raw body, validate timestamp freshness (300 seconds is a good tolerance), deduplicate by id or delivery ID, and return 2xx before doing slow work.

Which secret signs a delivery:

DeliverySecret
Workspace webhook endpointThat endpoint's whsec_ secret, shown once when the endpoint is created
callback_urlThe workspace callback_url signing secret, set on /console/webhooks

Rotating a secret

After you rotate an endpoint secret or the callback_url signing secret in the console, the previous secret stays valid for 24 hours, and every delivery in that window is signed with both the new and the previous secret. Switch your receiver to the new secret within 24 hours; during the switch you can also check both secrets.

The official SDKs implement these rules: Python aibubu_sdk.webhooks.construct_event(...) and TypeScript constructEvent(...) from aibubu-sdk.

Workspace webhooks

Manage endpoints on /console/webhooks. When you create one, the console generates a secret starting with whsec_ and shows it only once, so save it right away.

When deliveries keep failing, the console shows the failure count and lists each delivery's status and last error under "Recent deliveries". Disabling an endpoint, manually or after 20 consecutive failures, also abandons its deliveries that have not been sent yet; re-enable it after fixing the receiver.

Per-request callback callback_url

POST /v1/images/generations, POST /v1/videos/generations, and POST /v1/generations accept an optional top-level callback_url that sets a callback endpoint for a single task:

{
  "model": "gpt-image-2",
  "prompt": "A cinematic fashion poster",
  "callback_url": "https://example.com/aibubu/callback"
}
  • Must be a publicly reachable https URL, at most 2048 characters.
  • When the task reaches a terminal state (succeeded, failed, or canceled), the matching task.succeeded, task.failed, or task.canceled event is POSTed to that URL. Workspace webhooks subscribed to the event still receive it as well.
  • Deliveries are signed with the workspace callback_url signing secret, using the same headers and verification as Signing above; the retry rules below apply.
  • Set the callback_url signing secret on /console/webhooks before passing callback_url.
HTTPcodeCause
400invalid_callback_urlNot https, not a public address, or a malformed URL
400callback_secret_requiredThe workspace has no callback_url signing secret

Retries

  • timeout: 5 seconds; redirects are not followed
  • max attempts: 8
  • backoff: min(2^n * 10s, 6h) with ±20% jitter
  • only 429, 5xx, and network errors (timeouts, failed connections) are retried; other responses end the delivery
  • 20 consecutive failures disable a workspace endpoint; callback_url failures never disable anything