Status codes and error handling
Overview
This page lists the possible success and error codes returned by Akkuro Lending APIs and explains the standard error message format.
Success codes
| Code | Description | Method |
|---|---|---|
| 200 OK | The request was successful and returned a response. | All methods |
| 201 Created | The request was successful and created a new resource. | POST, PUT |
| 204 No Content | The request was successful but returned no response body. | PUT, PATCH, DELETE |
Error responses
Client-side error codes
These errors occur when there is a problem with the request.
| Code | Description | Methods |
|---|---|---|
| 400 Bad Request | The request is invalid due to a client error. | All methods |
| 401 Unauthorized | Authentication is missing or invalid. The access token may be expired and must be refreshed. | All methods |
| 403 Forbidden | The authenticated user is not authorized to perform this action. | All methods |
| 404 Not Found | The requested resource does not exist. | All methods |
| 406 Not Acceptable | The server cannot return a response matching the Accept header. For example, the API version in the Accept header is not supported. | All methods |
| 422 Unprocessable Entity | The request syntax is correct, and the server understands the content type, but could not be processed. | All methods |
Server-side error codes
These errors occur when there is a problem with the server.
| Code | Description | Methods |
|---|---|---|
| 500 Internal Server Error | A generic error for unexpected server problems. Try the request again later. | All methods |
| 501 Not Implemented | The server does not support the requested functionality. | All methods |
| 503 Service Unavailable | The service is temporarily unavailable. Try the request again later. | All methods |
Error response format
When a request fails, the API returns error responses in the RFC 7807 format, also known as Problem Details for HTTP APIs, with the application/problem+json content type. This is a standardized way to provide machine-readable error details in HTTP APIs. It helps you quickly identify what went wrong, why it happened, and how to fix it.
For example, the API should return a detailed error like this:
{
"type": "https://httpstatuses.io/401",
"title": "Unauthorized",
"status": 401,
"detail": "The certificate is not found"
}
This response contains the following fields:
type: A URI that links to documentation describing the error type.title: A short summary of the error.status: The HTTP status code.detail: A detailed and human-readable explanation of the error.