Skip to main content

Error Handling

The Artos API returns standard HTTP status codes with detailed error messages. This guide explains how to handle common errors.

HTTP Status Codes

Error Response Format

All error responses return a JSON object with error details:
For some endpoints, errors may include additional context:

Common Errors

401 Unauthorized - Missing Token

Error:
Cause: Authorization header is missing or empty Solution: Include a valid Bearer token:

401 Unauthorized - Invalid Token

Error:
Cause:
  • Token is malformed
  • Token has expired
  • Token was revoked
  • Token is for a different organization
Solution:
  1. Verify token format is correct
  2. Obtain a fresh token from your administrator
  3. Check token hasn’t been revoked
  4. Verify token is for the correct environment

403 Forbidden - Wrong Organization

Error:
Cause:
  • User’s token doesn’t have an organization
  • Resource belongs to a different organization
  • User is not member of the organization
Solution: Contact your organization administrator to verify your account setup

404 Not Found - Resource Missing

Error:
Cause:
  • Resource ID is incorrect
  • Resource has been deleted
  • Resource belongs to a different organization
Solution:
  1. Verify the resource ID is correct
  2. Check that the resource exists in your organization
  3. List available resources to find the correct ID

400 Bad Request - Validation Error

Error:
Cause: Request is missing required fields or has invalid values Solution:
  1. Check the API documentation for required fields
  2. Verify all required parameters are included
  3. Ensure values match the correct type and format

422 Unprocessable Entity - Invalid Structure

Error:
Cause: Request structure is invalid or doesn’t match schema Solution:
  1. Review the request body format
  2. Ensure nested objects are properly structured
  3. Validate against the OpenAPI specification

500 Internal Server Error

Error:
Cause: Server-side processing error Solution:
  1. Retry the request after a brief delay
  2. Check the Artos status page
  3. Contact support if the error persists

Error Handling Best Practices

1. Implement Exponential Backoff

Retry failed requests with increasing delays:

2. Check Status Codes

Always check the response status before processing:

3. Handle Async Operations

For async operations (202 responses), implement status polling:

4. Validate Input

Validate input before sending requests:

5. Log Errors for Debugging

Log error details for troubleshooting:

Debugging Tips

1. Enable Debug Logging

2. Check Token Validity

Verify your token hasn’t expired:

3. Test with curl

Use curl for quick testing:

4. Review OpenAPI Spec

Check the OpenAPI specification at /api-reference/openapi-v1.json for:
  • Required parameters
  • Expected response formats
  • Status codes for each endpoint

Support

If you encounter persistent errors:
  1. Check the documentation - Review endpoint documentation for parameters
  2. Verify your token - Contact your administrator if token issues
  3. Check system status - Look for maintenance or outages
  4. Enable debug logging - Get detailed request/response information
  5. Contact support - Reach out to internal@artosai.com with error details