Overview
The RunAgent API uses standard HTTP status codes and returns detailed error information in a consistent format. This guide covers common errors and how to handle them.Error Response Format
All errors follow this structure:HTTP Status Codes
Status | Meaning | Common Causes |
---|---|---|
200 | Success | Request completed successfully |
201 | Created | Resource created successfully |
400 | Bad Request | Invalid parameters or malformed request |
401 | Unauthorized | Missing or invalid API key |
403 | Forbidden | Insufficient permissions |
404 | Not Found | Resource doesn’t exist |
409 | Conflict | Resource already exists |
422 | Unprocessable | Valid syntax but semantic errors |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Error | Server-side error |
503 | Service Unavailable | Temporary maintenance |
Common Error Codes
Authentication Errors
INVALID_API_KEY
EXPIRED_API_KEY
Validation Errors
MISSING_REQUIRED_FIELD
INVALID_FIELD_TYPE
Resource Errors
AGENT_NOT_FOUND
DEPLOYMENT_FAILED
Rate Limiting
RATE_LIMIT_EXCEEDED
Server Errors
INTERNAL_ERROR
Error Handling Best Practices
Python Example
JavaScript Example
Debugging Errors
Request ID
Every error includes arequest_id
for debugging:
Detailed Logging
Enable detailed logging in SDKs:Common Solutions
-
400 Bad Request
- Validate JSON syntax
- Check required fields
- Verify data types
-
401 Unauthorized
- Check API key format
- Verify key hasn’t expired
- Ensure proper header format
-
429 Rate Limited
- Implement exponential backoff
- Check rate limit headers
- Consider upgrading plan
-
500 Internal Error
- Retry with backoff
- Check status page
- Contact support if persistent
Webhook Error Handling
For webhook endpoints, implement proper error handling:See Also
- API Introduction - API overview
- Authentication - Auth errors
- Rate Limits - Rate limiting details