curl -X POST https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/sessions/end \
-H "x-api-key: $STREAMPIXEL_API_KEY"
const res = await fetch(
'https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/sessions/end',
{ method: 'POST', headers: { 'x-api-key': process.env.STREAMPIXEL_API_KEY } }
);
console.log(await res.json());
import os, requests
r = requests.post(
"https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/sessions/end",
headers={"x-api-key": os.environ["STREAMPIXEL_API_KEY"]},
)
print(r.json())
{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"name": "Showroom",
"region": "Europe",
"enabled": true,
"sessionsSignalled": 2,
"regionAnswered": true
}
End Sessions
End every live and queued session of a project while keeping it on.
POST
/
api
/
v1
/
projects
/
{projectId}
/
sessions
/
end
curl -X POST https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/sessions/end \
-H "x-api-key: $STREAMPIXEL_API_KEY"
const res = await fetch(
'https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/sessions/end',
{ method: 'POST', headers: { 'x-api-key': process.env.STREAMPIXEL_API_KEY } }
);
console.log(await res.json());
import os, requests
r = requests.post(
"https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/sessions/end",
headers={"x-api-key": os.environ["STREAMPIXEL_API_KEY"]},
)
print(r.json())
{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"name": "Showroom",
"region": "Europe",
"enabled": true,
"sessionsSignalled": 2,
"regionAnswered": true
}
End every live and queued session of a project without switching it off. Viewers receive disconnect code
4000 and the player shows This stream has been turned off by the project owner, the same message as Disable Project; new viewers can join straight away. Use it to clear stuck viewers, or right before switching the active build so everyone lands on the new one.
Scope:
control. Team members need the Editor role or above. Limited to 30 control calls per minute per account.Path parameters
string
required
The project whose sessions to end.
Headers
string
required
An API key issued with the
control scope.Response
boolean
The project’s on/off state, unchanged by this call.
number
Live and queued sessions told to end.
0 when there were none, null when pending is true.boolean
false when the region’s session store could not be read; nothing was ended. Retry.boolean
true when the disconnect is taking longer than the request budget and is finishing in the background; sessionsSignalled is then null. Poll Live Stats to confirm. Only appears on busy regions.curl -X POST https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/sessions/end \
-H "x-api-key: $STREAMPIXEL_API_KEY"
const res = await fetch(
'https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/sessions/end',
{ method: 'POST', headers: { 'x-api-key': process.env.STREAMPIXEL_API_KEY } }
);
console.log(await res.json());
import os, requests
r = requests.post(
"https://platform.streampixel.io/api/v1/projects/664f1a2b3c4d5e6f7a8b9c0d/sessions/end",
headers={"x-api-key": os.environ["STREAMPIXEL_API_KEY"]},
)
print(r.json())
{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"name": "Showroom",
"region": "Europe",
"enabled": true,
"sessionsSignalled": 2,
"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. |