Errors
AYNA uses standard HTTP status codes. A 2xx means the call worked; anything else carries a JSON body saying why.
Status codes
Section titled “Status codes”| Status | Meaning | Common causes |
|---|---|---|
400 |
Bad request | A required field is missing or a value isn’t allowed |
401 |
Not authenticated | No Authorization header, or the key or token is unknown, expired or revoked |
403 |
Not allowed | An OAuth connection that is View only tried to change something, or called an endpoint AI apps can’t use |
404 |
Not found | The record doesn’t exist, or belongs to another organization |
410 |
Gone | A device login expired before the pilot approved it |
422 |
Invalid body | The JSON doesn’t match the request schema |
5xx |
Server error | Retry with backoff; if it persists, contact support |
A record in another organization returns 404, never 403, so a token can’t learn which IDs exist elsewhere.
Error bodies
Section titled “Error bodies”Most errors return a detail message:
{ "detail": "Maintenance record not found" }A 401 from a missing or bad token:
{ "success": false, "error": "Invalid or expired credentials", "error_code": "UNAUTHORIZED"}A 422 lists each field that failed:
{ "detail": [ { "type": "missing", "loc": ["body", "payload", "takeoff_latitude"], "msg": "Field required" } ]}A 403 for an OAuth connection:
{ "error": "Forbidden", "message": "This connection is read-only. Reconnect the app and allow changes to make edits."}Handling errors
Section titled “Handling errors”- On
401with an access token, refresh it and retry once. If the refresh fails, the key was revoked: pair the app again. - Don’t retry
400,403,404or422unchanged. Fix the request first. - Retry
5xxwith exponential backoff.