swap_clip
Replace a cutaway with a B-roll asset and re-render the video. Supports both local projects and hosted Swap & Refine timelines, where changes appear live in the editor.
Instructions
Replace one cutaway with a chosen B-roll asset (from suggest_clips), then re-render. LOCAL project (default): pass cut (0-based) + asset (filename) → re-renders locally, returns the MP4 path. HOSTED Swap & Refine project (pass job_id, or set VIRALSPIN_HOSTED_JOB_ID): pass segment_id + asset_url → patches the same timeline the browser editor shows and kicks off a cloud re-render; the change appears live in Swap & Refine. Returns immediately — the new preview lands on the project shortly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cut | No | LOCAL: index of the cutaway to replace (0-based). | |
| asset | No | LOCAL: asset filename from suggest_clips (e.g. "v03.mp4" or "07.jpg"). | |
| job_id | No | HOSTED: the Swap & Refine project. Omit to use VIRALSPIN_HOSTED_JOB_ID. | |
| reason | No | HOSTED: optional one-line rationale for WHY this clip fits here (e.g. "the line says 'the day she arrived'"). Stored as provenance + shown on the timeline. | |
| render | No | HOSTED: re-render now (costs a render/credits). Default false = instant timeline-only edit; iterate freely, then call render_project once to bake & publish. | |
| asset_url | No | HOSTED: public URL of the replacement B-roll (from suggest_clips). | |
| asset_kind | No | HOSTED: optional — kind of the replacement asset. | |
| segment_id | No | HOSTED: the cutaway's segment id (from suggest_clips). |