Skip to main content
The HopX API uses conventional HTTP status codes and returns detailed error responses to help you troubleshoot issues.

Error Response Format

All errors return a JSON response with this structure:

HTTP Status Codes

Error Codes

Authentication Errors

AUTHENTICATION_REQUIRED (401)

Cause: No API key or JWT token provided. Fix: Include Authorization: Bearer $HOPX_API_KEY header.

INVALID_TOKEN (401)

Cause: JWT token is invalid or expired. Fix: Refresh the JWT token using the Control Plane API.

Request Errors

INVALID_REQUEST (400)

Cause: Missing required parameters or invalid request format. Fix: Check the request body and ensure all required fields are present.

RESOURCE_NOT_FOUND (404)

Cause: The requested resource doesn’t exist. Fix: Verify the resource ID is correct.

CONFLICT (409)

Cause: Resource already exists. Fix: Use a different name or set update=true.

Execution Errors

EXECUTION_TIMEOUT (408)

Cause: Code execution exceeded the timeout limit. Fix: Increase the timeout or optimize your code.

CODE_EXECUTION_ERROR (500)

Cause: Code execution failed (syntax error, runtime error, etc.). Fix: Check the stderr field for error details and fix your code.

Resource Errors

PAYMENT_REQUIRED (402)

Cause: Account credit limit reached or payment method required. Fix: Add payment method or increase credit limit.

RESOURCE_LIMIT_ERROR (429)

Cause: Account resource limit reached. Fix: Delete unused sandboxes or upgrade your plan.

FORBIDDEN (403)

Cause: Access to resource or path is forbidden. Fix: Only access allowed paths (e.g., /workspace, /tmp).

Rate Limiting

RATE_LIMIT_EXCEEDED (429)

Cause: Too many requests in a short time. Fix: Wait and retry. Use exponential backoff. See Rate Limits for details.

Service Errors

SERVICE_UNAVAILABLE (503)

Cause: Service is temporarily down or overloaded. Fix: Retry with exponential backoff.

INTERNAL_ERROR (500)

Cause: Unexpected server error. Fix: Retry the request. Contact support with request_id if issue persists.

Error Handling Best Practices

1. Check Status Codes

2. Parse Error Responses

3. Implement Retry Logic

4. Handle Specific Errors

Getting Support

When contacting support, always include:
  1. Request ID - From the error response
  2. Timestamp - When the error occurred
  3. API endpoint - The URL you called
  4. HTTP status code - The response status
  5. Error message - The full error response
Example support request:

Next Steps