Overview
Agents are pre-built workflows that process your videos with AI-powered editing capabilities. Each agent is designed for specific tasks like generating captions, creating shorts, or enhancing audio.Creating Agents
First, create an agent on edit.mosaic.so. Once created, you can find the agent ID in the URL when viewing your agent.POST /agent/[agent_id]/run
Execute an agent workflow. Supports standard video-input workflows and AI-only workflows (AI Content Generation or AI Avatar).Standard Workflows
For workflows starting with a Video Input node, you must provide video URLs. The backend will automatically detect the URL type, download the video, and run the workflow.AI-Only Workflows
For workflows starting with AI Content Generation or AI Avatar nodes (and no Video Input node), no video inputs should be provided. These agents generate video content based on the parameters configured in the agent.Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| video_urls | string[] | Array of video URLs to process. Required if the agent has a video input node. Supports YouTube URLs and signed URLs (HTTP/HTTPS). | |
| callback_url | string | Optional webhook URL for status updates | |
| update_params | object | Optional parameters to override node parameters in the agent workflow |
Video URL Requirements & Limits
Thevideo_urls field supports two types of URLs:
YouTube URLs:
- Supports standard YouTube video URLs (e.g.,
https://www.youtube.com/watch?v=VIDEO_ID) - Maximum duration: 1 hour per video
- The system automatically validates the video exists and checks duration before processing
- Must be HTTP or HTTPS URLs pointing to video files
- Maximum file size: 5 GB per video
- Maximum duration: 3 hours per video
Modifying Node Parameters
You can override specific parameters for any node in your agent workflow using theupdate_params field. This allows you to dynamically change behavior (like clip duration, prompt text, or number of clips) at runtime.
To find the correct parameters:
- Open your agent in the Mosaic Dashboard
- Click the settings icon on the node you want to modify
- Click “Learn more about [Node Name]” to expand the dev details
- Click Copy parameters to get the JSON structure

update_params value in your API request.
Uploading Media for Node Parameters
Some nodes accept images, audio, or videos as parameters. To set these programmatically, use the Uploads API to upload your files and get their UUIDs:Response
run_id is used to track the progress of your agent run.
GET /agent_run/[run_id]
Poll this endpoint to check the status of your agent run and retrieve outputs.Request
Response
Status Values
| Status | Description |
|---|---|
| running | Agent is processing your videos |
| completed | Processing finished successfully |
| partial_complete | Some outputs finished successfully, but others failed |
| failed | The entire run failed, no outputs generated |
| cancelled | The run was cancelled by the user |
POST /agent_run/[run_id]/cancel
Cancel an ongoing agent run. This stops all running tasks and prevents downstream nodes from starting.Request
Response
Webhook Callbacks
If you provide acallback_url when running an agent, Mosaic will send POST requests to notify you of status changes. See the Webhooks section for complete webhook documentation.
Next Steps
- Set up triggers to automatically run agents on new videos
- Configure webhooks for real-time notifications