Skip to main content

HTTP Response Codes

The Authorium API uses standard HTTP status codes to indicate the outcome of API requests. Understanding these codes helps you handle responses effectively and implement robust error handling in your application.

Response Codes Used by Authorium

The following table summarizes the HTTP response codes you may encounter when working with the Authorium API:

CodeTypeMeaning
200SuccessThe request succeeded. The server returned the expected response.
201SuccessThe request succeeded, and a new resource was created.
400Client errorThe request was invalid, often due to formatting issues or missing data.
401Client errorAuthentication failed. The token may be missing, expired, or incorrect.
403Client errorAccess is forbidden. The authenticated user does not have permission to take action.
404Client errorThe requested resource was not found.
422Client errorThe request was understood but couldn't be processed due to semantic issues.

Error Response Format

When an error occurs, the API returns a structured JSON response with details about the failure:

{
"error": {
"code": "unauthorized",
"message": "Invalid email or password."
}
}

Where:

  • code: A short, machine-readable string that identifies the error type.
  • message: A human-readable explanation of the error.

Handling Responses

To ensure a robust integration, handle each category of response appropriately:

  • 2xx – Success: Continue processing the response as expected.
  • 4xx – Client error: Check your request for mistakes. These errors often relate to invalid input or authentication issues.
  • 5xx – Server error: These indicate an issue on the server. Retry the request or contact support if the issue persists.