Error Handling

Express API uses standard HTTP status codes and returns detailed error information for validation errors:

Validation Error (422)

{
  "detail": [
    {
      "loc": ["string", 0],
      "msg": "string", 
      "type": "string"
    }
  ]
}
detail
array
Array of validation error details.

Common Error Scenarios

401 Unauthorized
  • Invalid or expired JWT token
  • Missing or invalid API key/secret key
  • Invalid OIDC provider ID
422 Unprocessable Entity
  • Invalid chain parameter
  • Malformed hash format
  • Invalid base64 encoding
500 Internal Server Error
  • Server-side processing errors
  • Contact Magic support if persistent
Always implement proper error handling in your application:
  • Check HTTP status codes before processing responses
  • Log error details for debugging
  • Provide meaningful error messages to your users
  • Implement retry logic for transient errors