Documentation Index
Fetch the complete documentation index at: https://mintlify.com/kortix-ai/suna/llms.txt
Use this file to discover all available pages before exploring further.
Error Response Format
All API errors follow a consistent JSON structure:HTTP Status Codes
The Kortix API uses standard HTTP status codes to indicate success or failure.2xx Success
Request succeeded
Resource created successfully
4xx Client Errors
Invalid request format or parameters
Missing or invalid authentication credentials
Authenticated but lacking required permissions
Requested resource does not exist
Rate limit exceeded (currently 25 concurrent IPs per instance)
5xx Server Errors
Unexpected server error occurred
Service temporarily unavailable (maintenance, shutdown, or overload)
Authentication Errors
401 Unauthorized
Returned when authentication credentials are missing, invalid, or expired.core/utils/auth_utils.py:136-492
Common Causes
- No Authentication Header: Missing both
X-API-KeyandAuthorizationheaders - Wrong API Key Format: API key not in
pk_xxx:sk_xxxformat - Invalid Credentials: Wrong API key or JWT token
- Expired Token: JWT token past its
exptimestamp - Token Forgery: Signature verification failed (possible attack)
Resolution
403 Forbidden
Returned when credentials are valid but lack required permissions.core/utils/auth_utils.py:143-146, 651-670, 963
Common Causes
- Wrong Account: Resource belongs to a different account
- Team Access: Not a member of the resource’s team
- Public vs Private: Attempting write access on read-only public resource
- Admin Only: Endpoint requires admin privileges
404 Not Found
Returned when a resource doesn’t exist or user lacks access to view it.core/utils/auth_utils.py:319, 636, 895
For security, 404 responses don’t reveal whether the resource exists but user lacks access, or doesn’t exist at all.
Server Configuration Errors
500 Internal Server Error
Returned when server configuration is incorrect or an unexpected error occurs.core/utils/auth_utils.py:130-132, 222-225, 288-291, 680-684
503 Service Unavailable
Returned when the service is temporarily unavailable.api.py:450-459, core/utils/auth_utils.py:548-549, 675-679
Common Causes
- Deployment: Kubernetes rolling update in progress
- Maintenance: Scheduled maintenance window
- Database Issues: Connection pool exhausted or shutdown
- Redis Issues: Cache unavailable (degraded mode)
Retry Strategy
For 503 errors, implement exponential backoff:API-Specific Errors
API Key Errors
core/services/api_keys.py:335-456
JWT Token Errors
core/utils/auth_utils.py:151-266
Thread Access Errors
core/utils/auth_utils.py:591-684
Sandbox Access Errors
core/utils/auth_utils.py:845-1112
Validation Errors
400 Bad Request
Returned when request data is malformed or violates validation rules.Debugging Errors
Enable Detailed Logging
In development, set log level to DEBUG:Health Check Endpoints
Use health endpoints to diagnose issues:api.py:444-546
Debug Response Example
api.py:498-508
Redis Health Response
api.py:510-545
Common Debug Scenarios
Authentication Failing
Authentication Failing
- Check API key format:
pk_xxx:sk_xxx - Verify key hasn’t expired or been revoked
- Confirm JWT token hasn’t expired
- Check JWT algorithm (ES256 or HS256)
- Ensure SUPABASE_JWT_SECRET is configured (HS256)
- Verify JWKS endpoint is reachable (ES256)
Access Denied (403)
Access Denied (403)
- Verify resource belongs to your account
- Check if you’re a team member
- Confirm resource isn’t private
- Check if write access is required
- Verify admin key for admin endpoints
Resource Not Found (404)
Resource Not Found (404)
- Confirm resource ID is correct
- Check if resource was deleted
- Verify you have access (404 may hide 403)
- Ensure correct account/project scope
Server Errors (5xx)
Server Errors (5xx)
- Check health endpoints
- Verify database connectivity
- Check Redis status
- Look for deployment in progress
- Review server logs (if accessible)
Error Handling Best Practices
Example Error Handler
Next Steps
Authentication
Learn about authentication methods
API Introduction
Return to API overview