curl -X POST https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/disable \
-H "x-api-key: $STREAMPIXEL_API_KEY"
const res = await fetch(
'https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/disable',
{ method: 'POST', headers: { 'x-api-key': process.env.STREAMPIXEL_API_KEY } }
);
const r = await res.json();
if (!r.regionAnswered) console.warn('project is off but sessions may still be running:', r.error);
import os, requests
r = requests.post(
"https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/disable",
headers={"x-api-key": os.environ["STREAMPIXEL_API_KEY"]},
).json()
print(f'off; {r["sessionsSignalled"]} session(s) ended')
{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"name": "Showroom",
"region": "Europe",
"enabled": false,
"changed": true,
"sessionsSignalled": 3,
"regionAnswered": true
}
Disable Project
Switch a project off and end every live and queued session.
POST
/
api
/
v1
/
projects
/
{projectId}
/
disable
curl -X POST https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/disable \
-H "x-api-key: $STREAMPIXEL_API_KEY"
const res = await fetch(
'https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/disable',
{ method: 'POST', headers: { 'x-api-key': process.env.STREAMPIXEL_API_KEY } }
);
const r = await res.json();
if (!r.regionAnswered) console.warn('project is off but sessions may still be running:', r.error);
import os, requests
r = requests.post(
"https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/disable",
headers={"x-api-key": os.environ["STREAMPIXEL_API_KEY"]},
).json()
print(f'off; {r["sessionsSignalled"]} session(s) ended')
{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"name": "Showroom",
"region": "Europe",
"enabled": false,
"changed": true,
"sessionsSignalled": 3,
"regionAnswered": true
}
Switch a project off. Every live and queued session of the project is ended: viewers receive disconnect code
4000 (Project inactive), the applications are stopped, and new viewers are refused until the project is enabled again.
The call waits until the end-session signal has been sent and reports how many sessions it reached. That is the difference from the dashboard’s switch, which fires and forgets: a script can tell “disabled, 3 viewers disconnected” from “disabled, but the region did not answer”.
Scope:
control. Team members need the Editor role or above. Limited to 30 control calls per minute per account.This is immediate and has no undo for the viewers it disconnects. To clear sessions without taking the project offline, use End Sessions.
Path parameters
string
required
The project to switch off.
Headers
string
required
An API key issued with the
control scope.Response
boolean
Always
false after this call.boolean
false if the project was already off. Sessions are signalled either way.number
Live and queued sessions told to end.
boolean
false when the region’s session store could not be read. The project is off, but sessions may still be running; retry End Sessions.string
Only with
regionAnswered: false: why.curl -X POST https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/disable \
-H "x-api-key: $STREAMPIXEL_API_KEY"
const res = await fetch(
'https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/disable',
{ method: 'POST', headers: { 'x-api-key': process.env.STREAMPIXEL_API_KEY } }
);
const r = await res.json();
if (!r.regionAnswered) console.warn('project is off but sessions may still be running:', r.error);
import os, requests
r = requests.post(
"https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/disable",
headers={"x-api-key": os.environ["STREAMPIXEL_API_KEY"]},
).json()
print(f'off; {r["sessionsSignalled"]} session(s) ended')
{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"name": "Showroom",
"region": "Europe",
"enabled": false,
"changed": true,
"sessionsSignalled": 3,
"regionAnswered": true
}
Errors
| Status | code | Cause |
|---|---|---|
403 | API_KEY_SCOPE | The key was issued without control. |
403 | — | The project belongs to another account, or the team role cannot edit projects. |
404 | NOT_FOUND | No project with that id. |
429 | RATE_LIMITED | More than 30 control calls in a minute. Retry-After is set. |