curl "https://platform.streampixel.io/api/v1/analytics/projects/664f1a2b3c4d5e6f7a8b9c0d/disconnect-codes?startDate=2026-09-25T00:00:00Z&endDate=2026-09-26T00:00:00Z" \
-H "x-api-key: $STREAMPIXEL_API_KEY"
const u = new URL('https://platform.streampixel.io/api/v1/analytics/projects/664f1a2b3c4d5e6f7a8b9c0d/disconnect-codes');
u.search = new URLSearchParams({ startDate: '2026-09-25T00:00:00Z', endDate: '2026-09-26T00:00:00Z' });
const { disconnectCodes } = await (await fetch(u, { headers: { 'x-api-key': process.env.STREAMPIXEL_API_KEY } })).json();
const histogram = {};
for (const e of disconnectCodes) histogram[e.disconnectCode] = (histogram[e.disconnectCode] ?? 0) + 1;
console.log(histogram); // e.g. { 1000: 118, 1006: 12, 4004: 9, 4006: 2 }
import os, collections, requests
r = requests.get(
"https://platform.streampixel.io/api/v1/analytics/projects/664f1a2b3c4d5e6f7a8b9c0d/disconnect-codes",
params={"startDate": "2026-09-25T00:00:00Z", "endDate": "2026-09-26T00:00:00Z"},
headers={"x-api-key": os.environ["STREAMPIXEL_API_KEY"]},
)
print(collections.Counter(e["disconnectCode"] for e in r.json()["disconnectCodes"]))
{
"success": true,
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"totalDisconnectEntries": 141,
"count": 141,
"limit": 1000,
"skip": 0,
"disconnectCodes": [
{ "disconnectCode": 1000, "sessionId": "session_1790294409382_3035", "streamingId": "st_7f3a", "timestamp": "2026-09-25T14:31:40.000Z", "logType": "Webrtc" },
{ "disconnectCode": 4006, "sessionId": "session_1790293988120_2210", "streamingId": "st_6c11", "timestamp": "2026-09-25T13:58:02.000Z", "logType": "Webrtc" }
]
}
Disconnect Codes
Every session ending in a window, with the close code that explains it.
GET
/
api
/
v1
/
analytics
/
projects
/
{projectId}
/
disconnect-codes
curl "https://platform.streampixel.io/api/v1/analytics/projects/664f1a2b3c4d5e6f7a8b9c0d/disconnect-codes?startDate=2026-09-25T00:00:00Z&endDate=2026-09-26T00:00:00Z" \
-H "x-api-key: $STREAMPIXEL_API_KEY"
const u = new URL('https://platform.streampixel.io/api/v1/analytics/projects/664f1a2b3c4d5e6f7a8b9c0d/disconnect-codes');
u.search = new URLSearchParams({ startDate: '2026-09-25T00:00:00Z', endDate: '2026-09-26T00:00:00Z' });
const { disconnectCodes } = await (await fetch(u, { headers: { 'x-api-key': process.env.STREAMPIXEL_API_KEY } })).json();
const histogram = {};
for (const e of disconnectCodes) histogram[e.disconnectCode] = (histogram[e.disconnectCode] ?? 0) + 1;
console.log(histogram); // e.g. { 1000: 118, 1006: 12, 4004: 9, 4006: 2 }
import os, collections, requests
r = requests.get(
"https://platform.streampixel.io/api/v1/analytics/projects/664f1a2b3c4d5e6f7a8b9c0d/disconnect-codes",
params={"startDate": "2026-09-25T00:00:00Z", "endDate": "2026-09-26T00:00:00Z"},
headers={"x-api-key": os.environ["STREAMPIXEL_API_KEY"]},
)
print(collections.Counter(e["disconnectCode"] for e in r.json()["disconnectCodes"]))
{
"success": true,
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"totalDisconnectEntries": 141,
"count": 141,
"limit": 1000,
"skip": 0,
"disconnectCodes": [
{ "disconnectCode": 1000, "sessionId": "session_1790294409382_3035", "streamingId": "st_7f3a", "timestamp": "2026-09-25T14:31:40.000Z", "logType": "Webrtc" },
{ "disconnectCode": 4006, "sessionId": "session_1790293988120_2210", "streamingId": "st_6c11", "timestamp": "2026-09-25T13:58:02.000Z", "logType": "Webrtc" }
]
}
Return the disconnect-code entries recorded for a project in a window: one per session ending, with the code, the session it belongs to and when. Group by code to see why sessions end; the meaning of each code is in Disconnect codes.
Scope:
read. Default limit is 1000, newest first.Path parameters
string
required
The project.
Query parameters
string
ISO 8601 start of the window.
string
ISO 8601 end of the window.
integer
default:"1000"
Entries to return.
integer
default:"0"
Offset.
Headers
string
required
Your Streampixel API key.
Response
number
Entries in the window.
number
Entries returned.
array
curl "https://platform.streampixel.io/api/v1/analytics/projects/664f1a2b3c4d5e6f7a8b9c0d/disconnect-codes?startDate=2026-09-25T00:00:00Z&endDate=2026-09-26T00:00:00Z" \
-H "x-api-key: $STREAMPIXEL_API_KEY"
const u = new URL('https://platform.streampixel.io/api/v1/analytics/projects/664f1a2b3c4d5e6f7a8b9c0d/disconnect-codes');
u.search = new URLSearchParams({ startDate: '2026-09-25T00:00:00Z', endDate: '2026-09-26T00:00:00Z' });
const { disconnectCodes } = await (await fetch(u, { headers: { 'x-api-key': process.env.STREAMPIXEL_API_KEY } })).json();
const histogram = {};
for (const e of disconnectCodes) histogram[e.disconnectCode] = (histogram[e.disconnectCode] ?? 0) + 1;
console.log(histogram); // e.g. { 1000: 118, 1006: 12, 4004: 9, 4006: 2 }
import os, collections, requests
r = requests.get(
"https://platform.streampixel.io/api/v1/analytics/projects/664f1a2b3c4d5e6f7a8b9c0d/disconnect-codes",
params={"startDate": "2026-09-25T00:00:00Z", "endDate": "2026-09-26T00:00:00Z"},
headers={"x-api-key": os.environ["STREAMPIXEL_API_KEY"]},
)
print(collections.Counter(e["disconnectCode"] for e in r.json()["disconnectCodes"]))
{
"success": true,
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"totalDisconnectEntries": 141,
"count": 141,
"limit": 1000,
"skip": 0,
"disconnectCodes": [
{ "disconnectCode": 1000, "sessionId": "session_1790294409382_3035", "streamingId": "st_7f3a", "timestamp": "2026-09-25T14:31:40.000Z", "logType": "Webrtc" },
{ "disconnectCode": 4006, "sessionId": "session_1790293988120_2210", "streamingId": "st_6c11", "timestamp": "2026-09-25T13:58:02.000Z", "logType": "Webrtc" }
]
}
Grouping codes
| Group | Codes | Meaning |
|---|---|---|
| Normal | 1000, 1001 | The viewer left. |
| Transient | 1005, 1006 | Network or a suspended tab; the SDK reconnects. |
| Your build | 4002, 4003, 4006 | Missing, would not start, or crashed. Read the log. |
| Your settings | 4000, 4004 | Project off, or the runtime limit was reached. |
| Capacity | 4001 | No free streaming server. |
| Platform | 4005, 4007, 4008, 4009 | Setup or reconnection failed. Contact support if it repeats. |
Errors
| Status | Cause |
|---|---|
403 | The key lacks read, or the project belongs to another account. |