Skip to main content
Provide a callback_url when calling Run Agent to receive webhook POSTs for run lifecycle events.

Authentication

If you have a webhook secret configured, every webhook includes an X-Mosaic-Signature header containing the secret as a plaintext string. Validate with a direct comparison:

Common Fields

Every webhook payload contains these fields: needs_credits and errors are included on RUN_FINISHED payloads when available.

RUN_STARTED

Sent when the run begins.
Additional fields: inputs — array of { video_url, thumbnail_url } for the input videos.

RUN_PROGRESS

Sent when one or more nodes change status. Useful for progress tracking without polling.
Additional fields:

RUN_FINISHED

Sent when the run reaches a terminal state. Contains all final outputs.
When a run fails, errors contains error details grouped by template node:
Additional fields: When needs_credits is true, check GET /plan first. If no paid plan is active, list plans with GET /plan/list, upgrade with POST /plan/upgrade, and complete checkout if requires_checkout: true. After plan activation, optionally enable auto top-ups via POST /credits/settings if your active plan is creator, creator_annual, professional, or professional_annual, then call POST /agent_run/{run_id}/resume to continue the run. Output fields:

triggered_by

Present when the run was started by a trigger or YouTube URL. null for standard API runs.
type is one of "youtube", "schedule", or "manual".

Run Status Values