Skip to main content
Add callback_url to an image or video generation request to receive a POST request when the task reaches completed or failed.

Callback request

APIPod sends Content-Type: application/json and User-Agent: APIPod-Callback/1.0.
A failed task uses the same envelope:
error_code is optional. Do not infer success from its absence; use status.

Delivery behavior

  • Any HTTP status from 200 through 299 acknowledges the callback.
  • Non-2xx responses and network errors are retried.
  • APIPod currently makes up to five delivery attempts with exponential backoff.
  • Duplicate delivery is possible, so receivers must be idempotent.
  • Callback delivery is asynchronous and does not change the task’s terminal state.

Secure the receiver

The current public callback contract does not include a signature header. Do not claim that a callback is authenticated solely because its JSON shape looks correct.
  • Use HTTPS and a high-entropy, unguessable token in the callback path.
  • Keep the callback URL server-side; do not expose it in client applications.
  • Match task_id and request_id against tasks your system created.
  • Store a processed-event key and make duplicate callbacks return the same successful outcome.
  • Validate field types and reject unexpectedly large bodies.
  • Return 2xx only after the callback has been durably accepted; process slow work asynchronously.
  • If authenticity is critical, query the authenticated status endpoint before applying irreversible business actions.

Minimal receiver