Skip to main content

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

Common Error Codes

Authentication Errors

INVALID_API_KEY

Solution: Check your API key format and ensure it’s correct.

EXPIRED_API_KEY

Solution: Generate a new API key from the dashboard.

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 a request_id for debugging:

Detailed Logging

Enable detailed logging in SDKs:

Common Solutions

  1. 400 Bad Request
    • Validate JSON syntax
    • Check required fields
    • Verify data types
  2. 401 Unauthorized
    • Check API key format
    • Verify key hasn’t expired
    • Ensure proper header format
  3. 429 Rate Limited
    • Implement exponential backoff
    • Check rate limit headers
    • Consider upgrading plan
  4. 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