Developers · HTTP API
Story tracks endpoints
A story's lanes: name, mute, solo, gain and the device chain.
A track is one lane of a story's timeline: its name, mute, solo and gain, and its device chain. The clips on a lane are segments.
Each endpoint lists the errors it returns itself. A 400 body has detail and
failure. Any endpoint can also return the
common errors.
Track object
A lane gets a row when a setting first changes; until then it has the defaults.
| Field | Type | Description |
|---|---|---|
story_id, track_index |
string, integer | The story and the lane |
name |
string or null | Up to 80 characters. Default null |
muted, soloed |
boolean | Default false. With any lane soloed, only soloed lanes are heard |
gain_db |
number | −40 to 24. Default 0 |
devices |
object[] | The insert chain, each { id, kind, bypassed, params }. id is stable; a bypassed device stays in the chain, unheard; params holds every knob |
Each device kind has these knobs, given as range (default), with times in seconds:
compressor:threshold−60 to 0 dB (−24),ratio1–20 (4),attack0.001–0.3 (0.006),release0.01–1 (0.15)eq:low,mid,high−24 to 12 dB (0),lowFrequency80–1,000 Hz (400),highFrequency1,000–10,000 Hz (2,500)reverb:decay0.1–10 (1.8),preDelay0–0.3 (0.02),wet0–1 (0.25)delay:delayTime0.01–1 (0.25),feedback0–0.95 (0.3),wet0–1 (0.25)distortion:distortion0–1 (0.3),wet0–1 (0.5)gate:threshold−80 to 0 dB (−45),smoothing0.01–0.5 (0.06)limiter:threshold−24 to 0 dB (−1)autotune:tuneKey0–11, C to B (0),scale0–2, Chromatic, Major, Minor (0),retune0–0.4 (0.08),amount0–1 (1)
List tracks
GET /api/stories/<STORY_ID>/tracks
Returns the lanes with a row, in order.
| Name | Type | Required | Description |
|---|---|---|---|
<STORY_ID> |
string | Yes | The story's id |
This request lists lanes:
curl "http://127.0.0.1:17494/api/stories/<STORY_ID>/tracks"A successful response is 200 OK with an array of
track objects.
| Status | Cause |
|---|---|
404 |
No story has this id |
Update a track
PATCH /api/stories/<STORY_ID>/tracks/<TRACK_INDEX>
Changes a lane, creating its row if needed. devices replaces the chain:
unknown knobs are dropped, values clamped (tuneKey and scale also rounded),
and missing knobs take defaults.
| Name | Type | Required | Description |
|---|---|---|---|
<STORY_ID>, <TRACK_INDEX> |
string, integer | Yes | The story's id and the lane |
name, muted, soloed, gain_db |
mixed | No | As in the track object |
devices |
object[] | No | Up to 16 { kind, id?, bypassed?, params? }. [] empties it |
This request names lane 0 and adds two devices:
curl -X PATCH "http://127.0.0.1:17494/api/stories/<STORY_ID>/tracks/0" \
-H 'Content-Type: application/json' \
-d '{
"name": "Dialogue",
"gain_db": -3,
"devices": [
{
"kind": "compressor"
},
{
"kind": "reverb",
"params": {
"wet": 0.2
}
}
]
}'A successful response is 200 OK with the track object.
| Status | Cause |
|---|---|
404 |
No story has this id |
422 |
<TRACK_INDEX> is not an integer |
Delete a track
DELETE /api/stories/<STORY_ID>/tracks/<TRACK_INDEX>
Deletes a lane and its clips. Higher lanes move down one.
| Name | Type | Required | Description |
|---|---|---|---|
<STORY_ID>, <TRACK_INDEX> |
string, integer | Yes | The story's id and the lane |
This request deletes lane 2:
curl -X DELETE -H 'X-Soundbox: 1' \
"http://127.0.0.1:17494/api/stories/<STORY_ID>/tracks/2"A successful response is 200 OK with the clips removed:
{
"removed_clips": 3
}| Status | Cause |
|---|---|
404 |
No story has this id |
422 |
<TRACK_INDEX> is not an integer |