API documentation

The Streamrun REST API lets you control configurations and server instances via HTTP. Query configurations, launch instances, manage destinations, and control running streams programmatically. Feedback is welcome at team@streamrun.com.

Authentication

All requests use the base URL https://streamrun.com and must be made over HTTPS. The API uses Bearer authentication. Create API keys on the API Keys page.

Authorization: Bearer <API_KEY>

Example: list configurations with cURL

curl -H "Authorization: Bearer <API_KEY>" https://streamrun.com/api/v1/configurations

Configurations

Build configurations in the Streamrun Editor or copy a template to your account. Avoid launching instances via the API while the configuration is open in the editor — concurrent changes may be applied out of order.

GET/api/v1/configurations

List all configurations.

GET/api/v1/configurations/{configurationId}

Fetch a single configuration.

GET/api/v1/configurations/{configurationId}/instances

List all instances running this configuration.

POST/api/v1/configurations/{configurationId}/instances

Launch one or more instances of a configuration. Without a payload, one instance with default settings is started. The response includes a Location header pointing to the instance request.

The optional autoStop field controls idle behavior. Set true to always stop the instance after 5 minutes of no inputs or outputs, or after 15 minutes of active outputs with no inputs, false to keep the instance running indefinitely, or omit it to use the account-level auto-stop settings.

{
    "numberOfInstances": 1,
    "autoStop": false,
    "instanceSettings": [
        {
            "name": "Instance name",
            "overrides": {
                "htmloverlay-1": {"url": "https://example.com"},
                "inputstream-1": {"pullUrl": "rtmp://customserver"},
                "outputstream-1": {"destinations": ["destination-id"]}
            }
        }
    ]
}

Response header: Location: /api/v1/instance-requests/{requestId}

PUT/api/v1/configurations/{configurationId}/instances

Set all output destinations live or offline for all instances running this configuration.

{ "outputs": "LIVE" | "OFFLINE" }
DELETE/api/v1/configurations/{configurationId}/instances

Stop all running or queued instances for this configuration.

Instance requests

When launching streaming instances, an instance request is created. It starts in the QUEUED state and transitions to RUNNING once a server has been allocated.

GET/api/v1/instance-requests/{requestId}

Fetch an instance request by ID to check its status.

Instances

Each instance is a server running a Streamrun configuration. Instances are launched using the configurations endpoint: POST /api/v1/configurations/{configurationId}/instances. Possible instance states are:

QUEUED

Waiting for an available server.

RUNNING

Live in production mode. Outputs can go live.

PREVIEW

Configuration is open in the Streamrun editor.

GET/api/v1/instances

List all instances.

GET/api/v1/instances/{instanceId}

Fetch a single instance.

DELETE/api/v1/instances

Stop all instances.

DELETE/api/v1/instances/{instanceId}

Stop a specific instance.

POST/api/v1/instances/{instanceId}/restart

Restart a specific instance.

GET/api/v1/instances/{instanceId}/overrides

Get the current setting overrides for an instance.

PATCH/api/v1/instances/{instanceId}/overrides

Update setting overrides for a running instance. Changes apply immediately.

{
    "htmloverlay-1": {"url": "https://example.com", "visible": true},
    "switch-1": {"activeInput": 2}
}

Outputs

Manage the live state of output stream elements and their individual destinations.

GET/api/v1/instances/{id}/outputs

List all output stream elements for a running instance with their current state.

{
    "outputs": [
        {
            "id": "outputstream-1",
            "type": "outputstream",
            "health": "OK",
            "state": {
                "destinations": [
                    { "id": "dest-1", "status": "LIVE" }
                ]
            }
        }
    ]
}
PATCH/api/v1/instances/{id}/outputs

Set all output destinations for an instance to LIVE or OFFLINE.

{ "desiredState": "LIVE" | "OFFLINE" }
PATCH/api/v1/instances/{id}/outputs/{outputId}

Set all destinations for a specific output element to LIVE or OFFLINE.

{ "desiredState": "LIVE" | "OFFLINE" }
PATCH/api/v1/instances/{id}/outputs/{outputId}/destinations/{destinationId}

Set a single destination within a specific output element to LIVE or OFFLINE.

{ "desiredState": "LIVE" | "OFFLINE" }

Instance actions

Trigger runtime behavior on a specific element inside a running instance. Actions are asynchronous and return 202 Accepted on success.

POST/api/v1/instances/{instanceId}/actions
{
    "elementId": "string",
    "action": "string",
    "params": {}
}

HTML Overlay

RELOAD_OVERLAY

Reload the web page shown as the overlay.

{ "elementId": "htmloverlay-1", "action": "RELOAD_OVERLAY" }

Input Stream

START_PULL

Start RTMP/SRT pull.

STOP_PULL

Stop RTMP/SRT pull.

Video Player

PLAY

Start or resume playback. If stopped, starts from the beginning. If paused, resumes from current position.

PAUSE

Pause playback at the current position. Playback position is preserved.

STOP

Stop playback and reset position to the beginning.

RESTART

Set position to the beginning without changing playback state.

Credits

Check your account balance and the cost of streams that are currently running. All amounts are integer USD cents.

GET/api/v1/credits

Get the credit balance plus the real-time cost of running streams. The balance only changes once a stream stops, so runningStreamsCostCents reports what live streams have accrued so far. This is an estimate that becomes an actual charge when the stream stops. creditsRemainingRealtimeCents is the balance with that in-flight cost already subtracted.

{
  "creditsRemainingCents": 1240,
  "runningStreamsCostCents": 87,
  "runningStreamsCount": 2,
  "creditsRemainingRealtimeCents": 1153
}

Destinations

Destinations are the platforms you stream to (Twitch, YouTube, custom RTMP, etc.). Use destination IDs as override settings when launching instances to control where each instance streams. Changes to destinations are saved but not applied to already-running instances.

For a built-in platform, pass its name and the server address is filled in automatically, so you only need a stream key. For custom or self-hosted targets, provide a url (an rtmp://, rtmps:// or srt:// address).

For SRT, an {streamId} placeholder in the url is replaced with the stream key. For example srt://host?streamid={streamId}&latency=500000 with stream key 12345 becomes srt://host?streamid=12345&latency=500000.

GET/api/v1/destinations

List all destinations.

GET/api/v1/destinations/platforms

List the streaming platforms predefined in Streamrun. Platforms with a server address only need a streamKey when creating a destination. Platforms where requiresUrl is true need a custom url.

{
    "platforms": [
        { "platform": "Twitch", "server": "rtmp://...", "requiresUrl": false, "link": "https://..." },
        { "platform": "Custom", "server": null, "requiresUrl": true, "link": null }
    ]
}
POST/api/v1/destinations

Add a new destination. Provide a streamKey (for a built-in platform), a custom url, or both.

{
    "platform": "Custom",
    "name": "My server",
    "url": "rtmp://live.example.com/app",
    "streamKey": "abc123"
}
FieldTypeRequiredDescription
platformstringYesUse a platform value from GET /destinations/platforms to auto-fill the server address, or any label for a custom destination.
namestringYesDisplay name to identify the destination, e.g. channel name.
urlstringNoFull rtmp://, rtmps:// or srt:// address. Required for custom destinations (platforms with requiresUrl). For a built-in platform the server address is filled in automatically.
streamKeystringNoStream key used to authenticate the stream. Stored encrypted. Required for built-in platforms; for custom destinations it is optional (the key may be embedded in the url).
PUT/api/v1/destinations/{destinationId}

Update an existing destination. Every field is optional; only the fields you send are changed.

FieldTypeRequiredDescription
platformstringNoUpdated platform name. Omit to keep the existing platform.
namestringNoUpdated display name. Omit to keep the existing name.
urlstringNoUpdated rtmp://, rtmps:// or srt:// address. Omit to keep the existing url.
streamKeystringNoUpdated stream key. Omit to keep the existing key.
DELETE/api/v1/destinations/{destinationId}

Delete a destination.