Luna API
The HTTP API of a Luna deployment for developers: accounts, organisations, projects, environments, tenants, deploys, secrets, keys, data, telemetry, usage and billing. The luna CLI and the Console call this same API.
Authentication
Send a credential in the Authorization header as Bearer <TOKEN>. Three kinds work:
- An account key (
la_…) acts as your account, with the roles you hold when it is used. - An API key (
lt_…) holds the permissions it was made with, in one project or across one organisation. - A session token (
ls_…) is what logging in returns.
Each operation lists the permission it needs. A role is a fixed set of the same permissions. GET /_luna/permissions returns the full list.
Errors
A failed request answers with a 4xx or 5xx status and a JSON body of the form {"error": {"message": "…"}}.
https://{host}Account
Sign up, log in and manage the keys that act as your account.
- GETGet sign-in options
/_luna/auth/options - POSTSign up
/_luna/auth/signup - POSTLog in
/_luna/auth/login - POSTLog out
/_luna/auth/logout - GETGet the current account
/_luna/auth/me - PATCHRename the current account
/_luna/auth/me - GETList account keys
/_luna/auth/keys - POSTCreate an account key
/_luna/auth/keys - DELETERevoke an account key
/_luna/auth/keys/{id} - POSTStart a device login
/_luna/auth/device - POSTCollect a device login
/_luna/auth/device/token - POSTAccept an invitation by code
/_luna/auth/invites/accept - POSTAccept an invitation
/_luna/auth/invites/{id}/accept - POSTDecline an invitation
/_luna/auth/invites/{id}/decline - GETList notifications
/_luna/auth/notifications - POSTMark notifications as read
/_luna/auth/notifications/read
Organisations
Organisations own projects, members and billing.
- GETList organisations
/_luna/orgs - POSTCreate an organisation
/_luna/orgs - GETGet an organisation
/_luna/orgs/{org} - DELETEDelete an organisation
/_luna/orgs/{org} - PATCHUpdate an organisation
/_luna/orgs/{org} - GETRead the audit log
/_luna/orgs/{org}/audit
Members
The people in an organisation, their roles and their invitations.
- GETList members
/_luna/orgs/{org}/members - PUTChange a member's role
/_luna/orgs/{org}/members/{account} - DELETERemove a member
/_luna/orgs/{org}/members/{account} - GETList invitations
/_luna/orgs/{org}/invites - POSTInvite a member
/_luna/orgs/{org}/invites - DELETERevoke an invitation
/_luna/orgs/{org}/invites/{id} - POSTResend an invitation
/_luna/orgs/{org}/invites/{id}/resend
Projects
A project is one app. It holds the app’s environments.
- GETList projects
/_luna/orgs/{org}/projects - POSTCreate a project
/_luna/orgs/{org}/projects - GETGet a project
/_luna/orgs/{org}/projects/{project} - DELETEDelete a project
/_luna/orgs/{org}/projects/{project} - PATCHUpdate a project
/_luna/orgs/{org}/projects/{project} - GETResolve a project path
/_luna/resolve
Environments
An environment is one running copy of a project, such as production or staging.
- GETList environments
/_luna/orgs/{org}/projects/{project}/environments - POSTCreate an environment
/_luna/orgs/{org}/projects/{project}/environments - GETGet an environment
/_luna/orgs/{org}/projects/{project}/environments/{env} - DELETEDelete an environment
/_luna/orgs/{org}/projects/{project}/environments/{env} - POSTRetry a data copy
/_luna/orgs/{org}/projects/{project}/environments/{env}/copy
Tenants
Every environment has a default tenant. A platform adds one tenant per customer.
- GETList tenants
/_luna/tenants - POSTCreate a tenant
/_luna/tenants - GETGet a tenant
/_luna/tenants/{tenant} - PUTReplace a tenant's settings
/_luna/tenants/{tenant} - DELETEDelete a tenant
/_luna/tenants/{tenant} - POSTDeploy source files to a tenant
/_luna/tenants/{tenant}/deploy - POSTRestore lunas to an earlier moment
/_luna/tenants/{tenant}/restore - POSTFork a luna
/_luna/tenants/{tenant}/fork - POSTCopy every luna to another tenant
/_luna/tenants/{tenant}/fork-all - GETGet a tenant's OpenAPI document
/_luna/tenants/{tenant}/openapi.json
Deploys
Put code into an environment.
Secrets
Values an environment’s code reads at run time. A secret’s value is never read back.
- GETList secrets
/_luna/secrets/{tenant} - PUTSet a secret
/_luna/secrets/{tenant}/{name} - DELETEDelete a secret
/_luna/secrets/{tenant}/{name}
Domains
Your own domains for an environment’s HTTP routes, with certificates Luna gets and renews.
- GETList domains
/_luna/domains/{tenant} - POSTAdd a domain
/_luna/domains/{tenant} - DELETERemove a domain
/_luna/domains/{tenant}/{name} - POSTVerify a domain
/_luna/domains/{tenant}/{name}/verify - PUTUpload a certificate
/_luna/domains/{tenant}/{name}/certificate
App keys
The keys an app’s clients and servers call it with.
- GETList app keys
/_luna/tenants/{tenant}/keys - POSTCreate an app key
/_luna/tenants/{tenant}/keys - DELETERevoke an app key
/_luna/tenants/{tenant}/keys/{id} - PATCHUpdate an app key
/_luna/tenants/{tenant}/keys/{id} - POSTRotate an app key
/_luna/tenants/{tenant}/keys/{id}/rotate
API keys
Scoped keys for scripts and CI that call this API.
- GETList API keys
/_luna/tokens - POSTCreate an API key
/_luna/tokens - DELETERevoke an API key
/_luna/tokens/{id} - POSTRotate an API key
/_luna/tokens/{id}/rotate
Data
Browse and edit what an environment’s lunas hold: tables, files and indexes.
- GETList the lunas of a type
/_luna/tenants/{tenant}/lunas/{type} - POSTLet a quarantined luna run again
/_luna/tenants/{tenant}/lunas/{type}/release - GETList the rows of a table
/_luna/tenants/{tenant}/data/{type}/{table} - POSTAdd a row
/_luna/tenants/{tenant}/data/{type}/{table} - DELETEDelete a row
/_luna/tenants/{tenant}/data/{type}/{table}/{rowid} - PATCHChange a value in a row
/_luna/tenants/{tenant}/data/{type}/{table}/{rowid} - GETList the files in a folder
/_luna/tenants/{tenant}/files/{type}/{bucket} - DELETEDelete a file
/_luna/tenants/{tenant}/files/{type}/{bucket} - POSTSign a URL for a file
/_luna/tenants/{tenant}/files/{type}/{bucket}/sign - GETRead an index
/_luna/tenants/{tenant}/indexes/{index} - GETList the sandboxes
/_luna/tenants/{tenant}/sandboxes - DELETEDelete a sandbox
/_luna/tenants/{tenant}/sandboxes/{type}/{name} - POSTStop a sandbox
/_luna/tenants/{tenant}/sandboxes/{type}/{name}/stop
Telemetry
Logs, traces and metrics of an environment.
- GETQuery logs
/_luna/telemetry/{tenant}/logs - GETTail logs
/_luna/telemetry/{tenant}/logs/tail - GETQuery traces
/_luna/telemetry/{tenant}/traces - GETQuery metrics
/_luna/telemetry/{tenant}/metrics
Usage
What a tenant, a project or an organisation has used.
- GETGet usage and its cost
/_luna/usage - GETGet a tenant's usage
/_luna/tenants/{tenant}/usage - GETGet an organisation's usage
/_luna/orgs/{org}/usage
Billing
An organisation’s plan, spending limits and payment details.
- GETGet the billing summary
/_luna/orgs/{org}/billing - PUTSet spending limits
/_luna/orgs/{org}/billing/limits - GETGet what is in use now
/_luna/orgs/{org}/billing/in-use - GETGet a month's bill
/_luna/orgs/{org}/billing/usage - POSTStart a checkout
/_luna/orgs/{org}/billing/checkout - POSTOpen the billing portal
/_luna/orgs/{org}/billing/portal - GETGet the payment details
/_luna/orgs/{org}/billing/details - GETList the plans
/_luna/orgs/{org}/plans - POSTChoose a plan
/_luna/orgs/{org}/billing/plan
General
The permission catalog and this document.