Soundroo

Docs

The Soundroo REST API

The API lives at https://www.soundroo.com/api/v1. Requests and responses are JSON. The toolkit uses the same API when it shares music, so anything it does, your code can do too.

Keys

Send a key as Authorization: Bearer …. You can make named keys in Settings. The toolkit gets its key from soundroo login, which you approve at /link, or it makes a key for a new artist page with POST /guest-keys the first time it shares. Reading public music needs no key.

Endpoints

Request What it does Key
GET /meta Supported engines, score versions and limits. No
POST /guest-keys Makes an artist page without an owner, with a key that can only publish and a claim link. No
POST /claim-email Emails a link that gives the key's artist page to the person who confirms it. Body: {"email": "…"}. Yes
POST /claim-links A new claim link for the key's artist page. Yes
POST /device/code Starts the device sign-in that soundroo login uses. No
POST /device/token Turns an approved device code into a key. No
GET /me The artist behind the key and their collections. Yes
POST /releases Publishes or updates the tracks of a library. Send an Idempotency-Key header. Yes
GET /releases/{id} Render progress, links and errors of a publish. Yes
GET /tracks/{id} A track's details, with its sections in seconds. For private music
PATCH /tracks/{id} Changes title, description, visibility, access, genre or cover. Yes
DELETE /tracks/{id} Deletes a track. Yes
GET /tracks/{id}/score Score, mix and credits of an open track. For private music
POST /tracks/{id}/play Counts a listen, once per listener and day. No
GET /collections/{id} A collection with its tracks. For private music
PATCH /collections/{id} Changes title, description, visibility or cover. Yes
GET /artists/{handle} An artist's profile. No
GET /artists/{handle}/tracks An artist's public tracks. No
GET /explore Public tracks and collections, newest or most played this week. No
GET /search Searches public tracks, collections and artists. No
POST /previews Renders a score as a private preview. Yes
GET /previews/{id} A preview's status, audio and report. Yes
POST /previews/{id}/publish Publishes a preview as a track. Yes

Publishing a library

One request publishes a whole library. Send the same request again with the same Idempotency-Key and you get the same release back, not a second copy. Then ask GET /releases/{id} until each track has rendered. Tracks that didn't change keep their audio and don't count toward the daily limit.

{
    "client": {
        "name": "my-script",
        "version": "1.0.0"
    },
    "engine": {
        "version": "0.8.0",
        "hash": "c2e52ab982a0d8ae2e687c7d87ea31dfb9ec7dd2ae10670ce2e0fdf82d1de8dc"
    },
    "libraryUid": "night-trains-01",
    "collection": {
        "title": "Night Trains",
        "description": "Night drive music",
        "visibility": "unlisted"
    },
    "rightsAccepted": true,
    "tracks": [
        {
            "localId": "night-bus",
            "score": {
                "version": 2,
                "id": "night-bus",
                "title": "Night Bus",
                "bpm": 124,
                "beats": 64,
                "parts": [
                    {
                        "id": "kick",
                        "instrument": "kick",
                        "patterns": {
                            "four": {
                                "beats": 4,
                                "steps": "X...x...X...x..."
                            }
                        },
                        "clips": [
                            {
                                "pattern": "four",
                                "beat": 0,
                                "repeat": 16
                            }
                        ]
                    },
                    {
                        "id": "hats",
                        "instrument": "hi-hat",
                        "patterns": {
                            "offbeat": {
                                "beats": 4,
                                "steps": "..x...x...x...xo"
                            }
                        },
                        "clips": [
                            {
                                "pattern": "offbeat",
                                "beat": 8,
                                "repeat": 14
                            }
                        ]
                    },
                    {
                        "id": "bass",
                        "instrument": "acid-bass",
                        "patterns": {
                            "line": {
                                "beats": 4,
                                "line": "C2/.5 - C2 Eb2/.5 - G1/.5 Bb1 C2/.5"
                            }
                        },
                        "clips": [
                            {
                                "pattern": "line",
                                "beat": 0,
                                "repeat": 16
                            }
                        ]
                    },
                    {
                        "id": "hook",
                        "instrument": "analog-lead",
                        "patterns": {
                            "hook": {
                                "beats": 8,
                                "line": "G4/.5 Bb4 C5/1 - Eb5/.5 D5 C5/1.5 Bb4/.5 G4/2"
                            }
                        },
                        "clips": [
                            {
                                "pattern": "hook",
                                "beat": 16,
                                "repeat": 6
                            }
                        ]
                    }
                ]
            },
            "mix": {},
            "visibility": "unlisted",
            "access": "open"
        }
    ]
}

Errors

Errors use normal HTTP status codes and one shape. Problems with a score name the JSON path, including the track they belong to.

{
  "error": {
    "code": "invalid_request",
    "message": "Expected a MIDI integer 0–127 or scientific pitch such as C#4.",
    "issues": [{ "path": "tracks.1.score.parts[2].notes[14].pitch", "message": "Expected a MIDI integer 0–127 or scientific pitch such as C#4." }]
  }
}

A few codes tell you what to do next. claim_required means an artist page without an owner is full, so the owner needs to confirm an email address first. rate_limited comes with a Retry-After header.

Limits

LimitValue
Tracks on an artist page without an owner10
New renders a day without an owner20
New renders a day after you keep the page60
Tracks in one share30
Shortest track20 seconds
Longest track10 minutes
Instrument parts in a score64
Notes in a score100,000

Not playing Choose something to play