Status and error codes

All API responses are assigned specific numeric codes that allow you to quickly identify if a request to an endpoint has been successful or not; and if not, why.

You may inspect response codes via curl by adding the --include option:

curl -s https://eu2-cloud.acronis.com/api/2/clients/<your client ID> \
     --header "Authorization: Bearer <your token>" \
     --include

Then, the first line of the response output will contain the code, which is 200 (a successful request) in the following output:

HTTP/1.1 200 OK
<...> 

{"created_by": "f90e086b...","last_access_at": "2020-05-22T10:13:28+00:00","tenant_id": "e5afb5e8...", ...}

HTTP status codes

Here is the summary of the response codes returned by the API, along with their descriptions. The API reference provides the list of error codes and their detailed descriptions for each endpoint.

Code

Description

20x

A request to an endpoint has been successful and the response body may contain a JSON object with the results.

400

A request to an endpoint has failed and the response body contains a JSON object with the error details.

401

Cannot process a request to an endpoint because the token specified in the Authorization header is expired or invalid.

403

Cannot process a request to an endpoint because your account has no right to access this endpoint. For example, the account does not own a tenant being accessed.

404

A request to a non-existing endpoint or no requested data is found in the service.

405

A request uses a method that is not supported by the endpoint.

409

Another object of the same type already exists.

415

A request uses a format that is not supported by the endpoint. This problem might occur when an incorrect or no Content-Type header was provided in a request.

50x

A service operation issue. In such cases, it is a good practice to retry the request twice with a 1-2 seconds interval. If the issue is not resolved after retrying, contact the company administrator or try again later.

Error codes

When an error occurs, the API may respond with a JSON object in the response body containing the information about the error that will look as follows:

HTTP/1.1 404 Not Found
<...> 

{"domain":"ResourceManagement","code":"ResourceNotFound","reason":"ResourceNotFound","context":{...}}

Value

Description

error.code

An API error code. This code and its description can be found in the table below.

error.reason

A short descriptive message with the error reason.

error.context

An object with additional information on the error.

error.domain

A service or service component where the error has occurred.

The following table provides the description of error codes returned by the API in the error.code key:

Code

Domain

Description

AccessDenied

Access

Access was denied.

UnauthorizedRequest

Access

Authorization failed.

AuthenticationTimeout

Access

Access token is already expired or invalid.

NotFound

General

Specified resource not found.

BadRequest

General

Request is malformed.

DataConflict

General

The request violates some data invariant and cannot be performed.

InternalServerError

General

Server encountered an unexpected condition that prevented it from fulfilling the request.

DependencyValidationError

General

Dependency validation error between subject policy and target policy.

MethodNotAllowed

General

Unsupported resource access method.

ValidationError

General

Validation failed.

UnsupportedTypeError

General

Object type is unsupported.

MultipleApplicationsWithPolicyTypes

PolicyManagement

Policy application failed due to conflict with other policy applications within the same context.

UnsupportedPolicyType

PolicyManagement

An unsupported policy type.

SchemaValidationError

PolicyManagement

Schema validation error.

NoApplicationsError

PolicyManagement

FailedEnabledInvariantError

PolicyManagement

ResourceNotFound

ResourceManagement

Could not find the resource with the ID.

NotLicensedError

Licensing

Global or context-dependent features not licensed for the policy for some reason.