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 anX-Mosaic-Signature header containing the secret as a plaintext string. Validate with a direct comparison:
Common Fields
Every webhook payload contains these fields:| Field | Type | Description |
|---|---|---|
flag | string | "RUN_STARTED", "RUN_PROGRESS", or "RUN_FINISHED" |
agent_id | string | Agent UUID |
run_id | string | Run UUID |
status | string | Current run status |
node_status_counts | object | { completed, in_progress, failed } |
triggered_by | object | null | What initiated the run (see below) |
needs_credits and errors are included on RUN_FINISHED payloads when available.
RUN_STARTED
Sent when the run begins.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.| Field | Type | Description |
|---|---|---|
updated_nodes[].original_node_id | string | null | Template agent_node_id — use to map back to your agent |
updated_nodes[].status | string | completed, running, queued, failed, blocked, partial_complete |
updated_nodes[].status_message | string | null | Human-readable message |
updated_nodes[].errors | array | Error messages from failed tasks in this node. Empty array when the node has no errors. |
updated_nodes[].outputs | array | Outputs produced by this node (if any) |
RUN_FINISHED
Sent when the run reaches a terminal state. Contains all final outputs.errors contains error details grouped by template node:
| Field | Type | Description |
|---|---|---|
status | string | completed, partial_complete, or failed |
status_message | string | null | Human-readable detail on failure |
needs_credits | boolean | true when one or more runtime tasks in the run are marked needs_credits=true (insufficient credits). |
errors | array | Error messages grouped by template node. Empty array [] when the run has no errors. |
errors[].original_node_id | string | null | Template agent_node_id the errors originated from |
errors[].messages | array | List of error messages from failed tasks in this node |
inputs | array | { video_url, thumbnail_url } for each input |
outputs | array | Final rendered outputs (see below) |
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:
| Field | Type | Description |
|---|---|---|
id | string | Render ID — use for chaining runs via node_render_ids |
video_url | string | Signed download URL (valid 7 days) |
thumbnail_url | string | null | Signed thumbnail URL |
premiere_prproj_url | string | null | Signed URL for the Premiere Pro timeline zip attached to this render (when available) |
completed_at | string | ISO 8601 timestamp |
original_node_id | string | null | Template node that produced this output |
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
| Status | Meaning |
|---|---|
running | Processing in progress |
completed | All outputs generated successfully |
partial_complete | Some outputs succeeded, others failed |
failed | No outputs generated |
cancelled | Cancelled by user |