Adds a composition: the timeline named by timeline_id, used as a clip (RF-083). Nothing is copied, so changing that timeline changes every composition that uses it. The default duration is the rest of the nested timeline from source_in. A timeline cannot contain itself at any depth, and compositions nest at most 4 deep.
Arguments#
| Argument | Type | Required | Notes |
|---|---|---|---|
duration | string | no | A length; default the rest of the nested timeline from source_in. |
fit | cover, contain, none | no | |
id | string | no | pattern ^itm_[0123456789abcdefghjkmnpqrstvwxyz]{10}$ |
source_in | string | no | Where in the nested timeline to start, as a length from its start; default 0s. |
start | string | no | Absolute position; omitted, the end of the last item of the track (0s on an empty track). |
timeline_id | string | yes | Another timeline of the same project.; pattern ^prj_[0123456789abcdefghjkmnpqrstvwxyz]{10}$ |
track_id | string | yes | A visual track.; pattern ^trk_[0123456789abcdefghjkmnpqrstvwxyz]{10}$ |
Errors#
E_VALIDATIONE_INVALID_TIMEE_NOT_FOUNDE_TYPE_MISMATCHE_INVALID_STATEE_LIMITE_ID_EXISTSE_OUT_OF_SOURCEE_OVERLAP
Scope#
Scope edit. The scope is the one an API key needs in network mode. Run stuarty command:help clip.add_composition for the same description from the binary, or call the command_help tool.
Next steps#
As an MCP call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "edit",
"arguments": {
"project_id": "prj_7k2m9x4q1b",
"base_revision": 12,
"operations": [
{
"op": "clip.add_composition",
"args": {
"id": "itm_m1n2p3q4r5",
"start": "0s",
"timeline_id": "prj_a1b2c3d4e5",
"track_id": "trk_f6g7h8j9k0"
}
}
]
}
}
}As a batch file for the CLI
[
{
"op": "clip.add_composition",
"args": {
"id": "itm_m1n2p3q4r5",
"start": "0s",
"timeline_id": "prj_a1b2c3d4e5",
"track_id": "trk_f6g7h8j9k0"
}
}
]stuarty edit --project prj_7k2m9x4q1b --ops batch.json --jsonOver HTTP
curl -X POST "http://127.0.0.1:7878/api/v1/projects/prj_7k2m9x4q1b/edit" \
-H "Authorization: Bearer $STUARTY_KEY" \
-H "Content-Type: application/json" \
-d '{
"base_revision": 12,
"operations": [
{
"op": "clip.add_composition",
"args": {
"id": "itm_m1n2p3q4r5",
"start": "0s",
"timeline_id": "prj_a1b2c3d4e5",
"track_id": "trk_f6g7h8j9k0"
}
}
]
}'The ids in the example are illustrative: read the real ones with project_get.