Skip to main content

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

CodeDescriptionMethod
200 OKThe request was successful and returned a response.All methods
201 CreatedThe request was successful and created a new resource.POST, PUT
204 No ContentThe 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.

CodeDescriptionMethods
400 Bad RequestThe request is invalid due to a client error.All methods
401 UnauthorizedAuthentication is missing or invalid. The access token may be expired and must be refreshed.All methods
403 ForbiddenThe authenticated user is not authorized to perform this action.All methods
404 Not FoundThe requested resource does not exist.All methods
406 Not AcceptableThe 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 EntityThe 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.

CodeDescriptionMethods
500 Internal Server ErrorA generic error for unexpected server problems. Try the request again later.All methods
501 Not ImplementedThe server does not support the requested functionality.All methods
503 Service UnavailableThe 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.