API overview
The Legion API's base URL, conventions, and your first request.
Everything you do in the app, from renting to listing a host, you can do through the Legion API.
Base URL
https://api.legion.ambient.xyz/v1Every request is HTTPS and carries an API key. See Authentication.
Your first request
Check your key with getMe. It returns who the key acts as, your organization, your role and your permissions, and credential: the key's scope (full or agent) and whether it has provider_. The permissions are your role's; credential says what this key may call.
curl -s "https://api.legion.ambient.xyz/v1/me" \
-H "Authorization: Bearer $LEGION_API_KEY"Conventions
JSON. Requests and responses are JSON. Errors are
application/. See Errors.problem+json Times are RFC 3339, in UTC.
Money is an integer number of minor units (cents) with an ISO 4217 currency code, for example
{"amount_for $2.10. Money is never a float.minor": 210, "currency": "USD"} Lists use cursor pagination. See Pagination.
Retries. Operations that create rentals or move money take an
Idempotency-Key. See Idempotency.Request IDs. Every response carries an
X-Request-Idheader. Quote it when you contact support.Other organizations. A resource that belongs to another organization answers
404, as if it didn't exist.
Reference
The API reference lists every operation with its parameters, responses, errors and a curl sample. Download the OpenAPI document as JSON or YAML to import into your tools.
The public market API needs no key.