Skip to main content

Error Model

Overview

The Amove API uses a non-standard HTTP status code for application-level validation errors: 499. This cleanly separates application errors from infrastructure errors.

StatusMeaning
200 OKRequest succeeded. Response body contains the result (when any).
401 UnauthorizedAuthentication failed or is missing. From the Authentication API, this also indicates invalid credentials.
499Application-level validation error. Response body contains a ValidationProblemDetails object with a specific error code.
500 Internal Server ErrorAn unexpected server error occurred. No body is returned.

Note: the API does not use the standard 400 / 403 / 404 codes — application-level problems are always surfaced through 499 regardless of their nature.

HTTP 499 Response Body

Every 499 response includes a JSON body following ASP.NET Core's ValidationProblemDetails:

{
"type": "DUPLICATE",
"status": 499,
"errors": {
"DUPLICATE": [
"A resource with the same name already exists."
]
}
}
  • type — the application error code.
  • status — always 499.
  • errors — dictionary with a single entry whose key equals type and whose value is a string array of messages.

The response also includes an error-code HTTP response header duplicating the value in type, which is convenient for clients that want to branch on the error without parsing the body.

Error Codes

CodeMeaning
DEFAULTGeneric validation error
AUTHAuthentication failure (bad credentials, user not found, etc.)
INACTIVE_USERUser account is not active
TOKENToken is invalid, expired, or already used
SESSIONSession is invalid or expired
SESSION_MAXOUTToo many concurrent sessions for this user
SECURITYSecurity policy rejected the request
ACCESSAccess denied to the requested resource
NOT_FOUNDResource not found
COGNITOUpstream identity provider returned an error
TOTPMFA (time-based one-time password) challenge failed
TRANSFERTransfer operation failed
TRANSFER_C2CCloud-to-cloud transfer dispatcher error
SYNCSync operation failed
COSTBilling or cost calculation error
DUPLICATEA resource with the same unique field already exists
PENDINGOperation is pending and cannot be completed yet
DB_DELETEDatabase delete failed
DB_INSERTDatabase insert failed
DB_UPDATEDatabase update failed
DOWNLOAD_OBJECTObject download failed
INVALID_EMAILEmail address is invalid
INTERNAL_ERRORInternal server error surfaced as a validation error
CHECKSUM_MISMATCHFile checksum verification failed
FILESYSTEM_ACCESSLocal filesystem access denied
BUCKET_LOGGING_SETBucket logging could not be enabled
BUCKET_LOGGING_DISABLEDBucket logging is disabled
DISPOSEDUnderlying resource has been disposed

Handling errors in client code

Python
import requests

response = requests.get(
"https://api.amove.io/api/v1/user/userinfo",
headers={"Authorization": "Bearer YOUR_JWT"},
)

if response.status_code == 200:
print(response.json())
elif response.status_code == 499:
body = response.json()
code = body["type"]
message = body["errors"][code][0]
print(f"Application error {code}: {message}")
elif response.status_code == 401:
print("Authentication required; refresh your JWT.")
elif response.status_code == 500:
print("Server error; try again later.")
else:
print(f"Unexpected HTTP {response.status_code}")
JavaScript
const res = await fetch("https://api.amove.io/api/v1/user/userinfo", {
headers: { "Authorization": "Bearer YOUR_JWT" }
});

if (res.status === 200) {
console.log(await res.json());
} else if (res.status === 499) {
const body = await res.json();
const code = body.type;
const message = body.errors[code][0];
console.log(`Application error ${code}: ${message}`);
} else if (res.status === 401) {
console.log("Authentication required.");
} else if (res.status === 500) {
console.log("Server error; try again later.");
} else {
console.log(`Unexpected HTTP ${res.status}`);
}
C#
using System.Net.Http;
using System.Text.Json;

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "YOUR_JWT");

var res = await client.GetAsync("https://api.amove.io/api/v1/user/userinfo");

if ((int)res.StatusCode == 499)
{
var body = await res.Content.ReadFromJsonAsync<JsonElement>();
string code = body.GetProperty("type").GetString();
string message = body.GetProperty("errors").GetProperty(code)[0].GetString();
Console.WriteLine($"Application error {code}: {message}");
}
else if (res.IsSuccessStatusCode)
{
Console.WriteLine(await res.Content.ReadAsStringAsync());
}
else
{
Console.WriteLine($"HTTP {(int)res.StatusCode}");
}