Skip to main content

Error Handling

The ZenFlow API uses standard HTTP status codes and returns detailed error information in JSON format.

Error Response Format

All errors follow this structure:

HTTP Status Codes

Common Error Codes

Authentication Errors

Authorization Errors

Validation Errors

Resource Errors

Rate Limiting

See Rate Limits for handling strategies.

Handling Errors

JavaScript/TypeScript

Python

Best Practices

Check success Field

Always check the success field in responses

Log Error Codes

Log error codes for debugging and monitoring

Handle Retries

Implement retry logic for transient errors

User Messages

Show user-friendly messages for validation errors

Retry Strategy

Retry these errors with exponential backoff:
  • 429 Rate limit exceeded
  • 500 Internal server error
  • 503 Service unavailable
  • Network timeouts
Don’t retry these errors:
  • 400 Bad request (fix the request first)
  • 401 Unauthorized (fix authentication)
  • 403 Forbidden (check permissions)
  • 404 Not found (resource doesn’t exist)

Getting Help

If you encounter persistent errors:
  1. Check the error code and message
  2. Review the API documentation
  3. Check service status
  4. Contact [email protected] with:
    • Error code and message
    • Request details (endpoint, method)
    • Timestamp of the error