Return Codes and Error Response Format

The API returns an error response code if something has gone wrong with the request.

The following tables provide the basic components of an error message and the meaning of the various codes.

Basic Parts of an Error Message

Error Message Components

Property Name Type Description
message String A message providing additional details about the error.
code String The HTTP return code. The response will return this code, but you can also obtain this code from the resource.
uri String The URI that made the request that generated the error.

Common Return Codes and Their Meaning

Codes and Meaning

Code Meaning
200 "OK" - The response for almost all successful GET requests, and most PUT requests.
201 "Created" - The response for a POST if the resource requested was created.
204 No Content - This will only occur after the deletion of a resource.
400 "Bad Request" - Occurs when the parameters or body required in the method were not correctly provided. This includes missing headers (such as ContentType=application/json) on a POST and PUT.
401 "Not Authorized" - Occurs If the token is invalid (not expired) or has not been provided. This can also occur if the user does not have an Admin role on the account that is associated with the API key. In addition, providing incorrect credentials on the POST /token will generate this error.
404- "Not Found" - Occurs If the item requested or any resource identified in the URI does not exist in the Cloudpath account.
406 - "Not Acceptable" - Occurs if the token has expired. This error is possible on any endpoint, except the POST on /token.
409- "Conflict" - Occurs when the request itself is valid, but the data in the request causes a conflict with existing data. An common example is if the name is not unique.
415 "Unsupported Media Type" - the REST v2 APIs support only JSON.
4***, 500, 503 Several other errors might occur. The error response should provide additional details as to the issue.