curl -X POST https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/enable \
-H "x-api-key: $STREAMPIXEL_API_KEY"
const res = await fetch(
'https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/enable',
{ method: 'POST', headers: { 'x-api-key': process.env.STREAMPIXEL_API_KEY } }
);
const { enabled, warnings } = await res.json();
import os, requests
r = requests.post(
"https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/enable",
headers={"x-api-key": os.environ["STREAMPIXEL_API_KEY"]},
)
print(r.json())
{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"name": "Showroom",
"region": "Europe",
"enabled": true,
"changed": true,
"warnings": []
}
{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"name": "Showroom",
"region": "Europe",
"enabled": true,
"changed": true,
"warnings": [
"No approved build on this project: viewers will be refused with code 4009 until one is set active and approved."
]
}
Enable Project
Switch a project on so viewers are admitted.
POST
/
api
/
v1
/
projects
/
{projectId}
/
enable
curl -X POST https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/enable \
-H "x-api-key: $STREAMPIXEL_API_KEY"
const res = await fetch(
'https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/enable',
{ method: 'POST', headers: { 'x-api-key': process.env.STREAMPIXEL_API_KEY } }
);
const { enabled, warnings } = await res.json();
import os, requests
r = requests.post(
"https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/enable",
headers={"x-api-key": os.environ["STREAMPIXEL_API_KEY"]},
)
print(r.json())
{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"name": "Showroom",
"region": "Europe",
"enabled": true,
"changed": true,
"warnings": []
}
{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"name": "Showroom",
"region": "Europe",
"enabled": true,
"changed": true,
"warnings": [
"No approved build on this project: viewers will be refused with code 4009 until one is set active and approved."
]
}
Switch a project on. Viewers are admitted from the moment the call returns. Idempotent: calling it on a project that is already on succeeds with
changed: false.
Scope:
control. Team members need the Editor role or above. Limited to 30 control calls per minute per account.Enabling a project with no approved build does not fail, but viewers will be refused with disconnect code
4009 until a build is approved. The response carries a warning when that is the case.Path parameters
string
required
The project to switch on.
Headers
string
required
An API key issued with the
control scope.Response
string
The project id.
string
Project name.
string
Project region.
boolean
Always
true after this call.boolean
false if the project was already on.string[]
Empty, or one line per condition that will stop viewers even though the project is on.
curl -X POST https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/enable \
-H "x-api-key: $STREAMPIXEL_API_KEY"
const res = await fetch(
'https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/enable',
{ method: 'POST', headers: { 'x-api-key': process.env.STREAMPIXEL_API_KEY } }
);
const { enabled, warnings } = await res.json();
import os, requests
r = requests.post(
"https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/enable",
headers={"x-api-key": os.environ["STREAMPIXEL_API_KEY"]},
)
print(r.json())
{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"name": "Showroom",
"region": "Europe",
"enabled": true,
"changed": true,
"warnings": []
}
{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"name": "Showroom",
"region": "Europe",
"enabled": true,
"changed": true,
"warnings": [
"No approved build on this project: viewers will be refused with code 4009 until one is set active and approved."
]
}
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. |
Next steps
Disable Project
Switch it off and end live sessions.
Set Active Build
Choose which build viewers get.