Skip to content

Authentication

View as Markdown

Aerandil authenticates with OAuth 2.1 client_credentials. A service account exchanges its client_id / client_secret for a short-lived bearer token, then sends that token on every request.

Terminal window
curl -X POST https://api.aerandil.com/oauth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d grant_type=client_credentials \
-d client_id="$AERANDIL_CLIENT_ID" \
-d client_secret="$AERANDIL_CLIENT_SECRET" \
-d scope="objects:read actions:hospitality.action.apply_payment:apply"

The response carries an access_token. Send it as a bearer token:

Terminal window
curl https://api.aerandil.com/v1/object-types/hospitality.folio/objects/$ID \
-H "Authorization: Bearer $ACCESS_TOKEN"

Aerandil grants are fine-grained. There are two families.

Coarse capabilities over reads and platform surfaces:

ScopeGrants
objects:readRead objects, links, types, and events.
events:readRead the event log and subscribe to the live event stream.
analytics:readRead conformed metrics over their maintained rollups.
functions:invokeInvoke registered functions (or use a per-function scope).
webhooks:read / webhooks:writeRead or manage webhook subscriptions.
erasure:writeForce a GDPR Article 17 hard-delete of a record.
tenant_admin:writeOperator-privileged, whole-tenant lifecycle.

Writes are actions, and each action is separately authorized. Two forms:

  • actions:apply — a catch-all that authorizes every registered action.
  • actions:{api_name}:apply — authorizes one action, e.g. actions:hospitality.action.apply_payment:apply.

Neither subsumes the other: a token presenting a per-action scope can apply that action; a token presenting actions:apply can apply any. Prefer per-action scopes for service accounts and reserve the catch-all for trusted first-party callers — issue the narrowest grant that does the job.

If your service receives webhooks from Aerandil rather than calling the API, it verifies the aerandil_webhook_signature on each delivery instead of presenting a bearer token. That signature scheme is documented with the webhook payloads in the API reference.