Error Response Format
All API errors follow a consistent JSON format:Machine-readable error code for programmatic handling
Human-readable description of the error
Additional context and metadata about the error (optional)
HTTP Status Codes
2xx Success
2xx Success
4xx Client Errors
4xx Client Errors
Invalid request parameters or malformed request
Missing or invalid API key
Valid credentials but insufficient permissions
Requested resource does not exist
Request conflicts with current state
Request body or file exceeds size limits
Valid request format but unable to process
Rate limit exceeded
Common Error Codes
Authentication Errors
UNAUTHORIZED
UNAUTHORIZED
FORBIDDEN
FORBIDDEN
HTTP Status: 403
Cause: Valid credentials but insufficient permissionsSolutions:
Cause: Valid credentials but insufficient permissionsSolutions:
- Verify your organization has access to the requested resource
- Contact your organization admin to check permissions
- Ensure you’re accessing resources within your organization scope
API_KEY_EXPIRED
API_KEY_EXPIRED
HTTP Status: 401
Cause: API key has expired or been revokedSolutions:
Cause: API key has expired or been revokedSolutions:
- Generate a new API key in the Newton Console
- Update your application with the new key
- Implement key rotation in your system
Request Errors
INVALID_REQUEST
INVALID_REQUEST
HTTP Status: 400
Cause: Malformed request or missing required parametersSolutions:
Cause: Malformed request or missing required parametersSolutions:
- Check that all required parameters are included
- Verify parameter types and formats
- Ensure JSON is properly formatted for POST requests
INVALID_LENS_ID
INVALID_LENS_ID
HTTP Status: 400
Cause: Specified lens_id does not exist or is not availableSolutions:
Cause: Specified lens_id does not exist or is not availableSolutions:
- Get available lens IDs from
/lens/metadataendpoint - Verify the lens ID format is correct
- Check that the lens belongs to your organization
INVALID_FILE_FORMAT
INVALID_FILE_FORMAT
HTTP Status: 400
Cause: Unsupported file format uploadedSolutions:
Cause: Unsupported file format uploadedSolutions:
- Check supported formats: JPEG, PNG, MP4, CSV, TSV, JSON
- Verify file extension matches content type
- Convert file to supported format if needed
FILE_TOO_LARGE
FILE_TOO_LARGE
HTTP Status: 413
Cause: File exceeds 1GB size limitSolutions:
Cause: File exceeds 1GB size limitSolutions:
- Compress or resize the file
- Split large files into smaller chunks
- Use video compression for large video files
Session Errors
SESSION_NOT_FOUND
SESSION_NOT_FOUND
HTTP Status: 404
Cause: Session ID does not exist or has been destroyedSolutions:
Cause: Session ID does not exist or has been destroyedSolutions:
- Verify the session ID is correct
- Check if session was destroyed or timed out
- Create a new session if needed
SESSION_LIMIT_EXCEEDED
SESSION_LIMIT_EXCEEDED
HTTP Status: 429
Cause: Maximum concurrent sessions reachedSolutions:
Cause: Maximum concurrent sessions reachedSolutions:
- Destroy unused sessions with
/lens/sessions/destroy - Implement session pooling in your application
- Contact support to discuss higher limits
SESSION_TIMEOUT
SESSION_TIMEOUT
HTTP Status: 408
Cause: Session idle for more than 30 minutesSolutions:
Cause: Session idle for more than 30 minutesSolutions:
- Send periodic keep-alive messages
- Recreate session if needed
- Implement automatic session refresh
Rate Limiting
RATE_LIMIT_EXCEEDED
RATE_LIMIT_EXCEEDED
HTTP Status: 429
Cause: Too many requests in a short time periodResponse includes retry information:Solutions:
Cause: Too many requests in a short time periodResponse includes retry information:
- Implement exponential backoff
- Respect the
retry_aftervalue - Reduce request frequency
- Implement request queuing
Retry Strategies
Exponential Backoff
Implement exponential backoff for transient errors:Circuit Breaker Pattern
For production systems, implement a circuit breaker:Error Monitoring
Logging Best Practices
Check API Status
View current system status and incidents
Contact Support
Get help from our technical support team. Send an email directly to [email protected]
- Error codes and messages
- Request/response examples
- Timestamps of errors
- Your organization ID
- Steps to reproduce the issue