API overview
The AYNA API is a JSON REST API over HTTPS. It covers the same records as the app: aircraft, fleets, parts, maintenance, pilots, crew, missions, flights, checklists, rules, records, services, leads and your organization.
https://app.ayna.com/api/v1/Authenticate
Section titled “Authenticate”Send a bearer token on every request:
curl https://app.ayna.com/api/v1/aircraft/ \ -H "Authorization: Bearer ak_your_api_key"The token can be an API key, a short-lived access token or an OAuth token. See Authentication for how to get each one, and Connect an app to a pilot for apps a pilot signs into.
Responses
Section titled “Responses”Successful responses wrap the result in data:
{ "success": true, "data": { "id": "a3f9c1d2-...", "name": "Hawk-2" }}See Errors for what failures look like.
Lists and paging
Section titled “Lists and paging”List endpoints take limit and offset and return the page with its total:
curl "https://app.ayna.com/api/v1/flights/?limit=50&offset=100" \ -H "Authorization: Bearer $AYNA_TOKEN"{ "success": true, "data": { "flights": [], "total": 312, "limit": 50, "offset": 100 }}Most lists also take filters, such as aircraft_id, pilot_id or status. The API reference lists them per endpoint.
Naming
Section titled “Naming”- Aircraft, not drones. Use the
/aircraft/paths andaircraft_idfields. Older integrations may senddrone_idor call/drones/; both still work as aliases. - An aircraft’s
idis its MAVLink hardware ID. Aircraft are identified by the ID the autopilot reports, so a ground station can name the aircraft it is connected to without looking anything up. The/aircraft/{id}paths and flight start use it. Each aircraft also has auuid, whichPOST /maintenance/takes asaircraft_id. Other records use UUIDs. - Times are ISO 8601 in UTC. Distances and altitudes are in meters, speeds in meters per second.
Who made the change
Section titled “Who made the change”Every write is recorded in the organization’s audit log with the actor behind the token: the user who owns the key, the pilot an app was paired with, or the user and app for an OAuth connection.