Error Codes
Complete reference of API error codes and their meanings.
HTTP Status Codes
| Code | Name | Description |
|---|---|---|
| 200 | OK | Request successful |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Missing or invalid authentication |
| 403 | Forbidden | No permission to access resource |
| 404 | Not Found | Resource does not exist |
| 409 | Conflict | Resource already exists |
| 422 | Unprocessable Entity | Validation failed |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error |
Error Response Format
json
{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request",
"details": [
{
"field": "name",
"message": "name must be a string"
}
]
}Authentication Errors
401 - Invalid API Key
json
{
"statusCode": 401,
"message": "Invalid API Key",
"error": "Unauthorized"
}Causes:
- API Key is incorrect
- API Key header name is wrong
- API Key has been revoked
Solution: Verify API Key and header name (ls-api-key)
403 - Access Denied
json
{
"statusCode": 403,
"message": "Access denied to this resource",
"error": "Forbidden"
}Causes:
- API Key doesn't have access to the project
- Trying to access another project's resources
Solution: Verify project ID matches your API Key
Validation Errors
400 - Missing Required Field
json
{
"statusCode": 400,
"message": "name is required",
"error": "Bad Request"
}Solution: Include all required fields in request body
400 - Invalid UUID
json
{
"statusCode": 400,
"message": "projectId must be a valid UUID",
"error": "Bad Request"
}Solution: Use valid UUID format for IDs
Resource Errors
404 - Livestream Not Found
json
{
"statusCode": 404,
"message": "Livestream not found",
"error": "Not Found"
}Causes:
- Livestream ID is incorrect
- Livestream was deleted
- Livestream belongs to different project
404 - Media Server Not Found
json
{
"statusCode": 404,
"message": "Media server not found",
"error": "Not Found"
}Solution: Get available servers from /media-servers/available
Stream Errors
Push Token Errors
| Error | Description | Solution |
|---|---|---|
INVALID_PUSH_TOKEN | Token is malformed | Generate new token |
EXPIRED_PUSH_TOKEN | Token has expired | Generate new token with longer expiry |
TOKEN_MISMATCH | Token doesn't match stream | Use correct stream key |
Stream Status Errors
| Status | Description |
|---|---|
READY_FOR_USE | Stream created, waiting for broadcaster |
STARTED | Stream is live |
ENDED | Stream has ended |
TOKEN_EXPIRED | Push token expired during stream |
Rate Limiting
429 - Too Many Requests
json
{
"statusCode": 429,
"message": "Rate limit exceeded",
"error": "Too Many Requests",
"retryAfter": 60
}Solution: Wait for retryAfter seconds before retrying
| Endpoint Type | Limit |
|---|---|
| Livestream CRUD | 100 req/min |
| Public APIs | 1000 req/min |