Adds a text item. The style is stored exactly as given, including keys equal to the default. x and y are the centre of the item in pixels; without them the item is centred.
Arguments#
| Argument | Type | Required | Notes |
|---|---|---|---|
duration | string | yes | A length of at least 1 frame. |
id | string | no | pattern ^itm_[0123456789abcdefghjkmnpqrstvwxyz]{10}$ |
start | string | yes | A time with a unit: "12.5s", "375f" or "00:00:12.500" |
style | object | no | A partial TextStyle. |
text | string | yes | The text; line breaks are allowed.; min length 1; max length 2000 |
track_id | string | no | A visual track; omitted, the highest visual track free over the item (an empty track you made for video counts; pass track_id to keep it clear), or a new one on top. effective.track_id names it.; pattern ^trk_[0123456789abcdefghjkmnpqrstvwxyz]{10}$ |
x | number | no | |
y | number | no |
Errors#
E_VALIDATIONE_INVALID_TIMEE_NOT_FOUNDE_TYPE_MISMATCHE_ID_EXISTSE_LIMITE_FONT_UNKNOWNE_OVERLAP
Scope#
Scope edit. The scope is the one an API key needs in network mode. Run stuarty command:help text.add 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": "text.add",
"args": {
"duration": "2s",
"id": "itm_s6t7v8w9x0",
"start": "0s",
"style": {
"size": 96
},
"text": "Hello",
"track_id": "trk_f6g7h8j9k0"
}
}
]
}
}
}As a batch file for the CLI
[
{
"op": "text.add",
"args": {
"duration": "2s",
"id": "itm_s6t7v8w9x0",
"start": "0s",
"style": {
"size": 96
},
"text": "Hello",
"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": "text.add",
"args": {
"duration": "2s",
"id": "itm_s6t7v8w9x0",
"start": "0s",
"style": {
"size": 96
},
"text": "Hello",
"track_id": "trk_f6g7h8j9k0"
}
}
]
}'The ids in the example are illustrative: read the real ones with project_get.