Create an API key
Makes a key for a program to use, such as a deploy from CI. The key holds only the permissions you name, and reaches one project, some of its environments or a whole organisation. You can give a key only what you can do yourself, and a key made by another key never outlives it. The key is shown once, in this response.
/_luna/tokensAuthorizationBearer token · headerrequiredAn account key (la_…), an API key (lt_…) or a session token (ls_…). The scopes listed are the permissions the operation needs.
tokens:writeapplication/jsonnamestringA name to tell the key by.
scopesstring[]requiredThe permissions the key holds, such as deploy:write. At least one.
tenantsstring[]The tenants the key reaches, by full name. Naming an environment's default tenant also reaches the tenants added to that environment. Leave empty for all of them.
projectstring | nullThe project the key belongs to, as organisation/project.
orgstring | nullAn organisation, by its slug, for a key that reaches every project in it. Give this or project, not both.
environmentsstring[]The environments the key reaches, by name. Leave empty for all of the project's environments.
expiresIninteger<int64> | nullHow long the key works, in seconds from now. A key with no lifetime does not expire.
The new key.
idstringrequiredThe key's id, for revoking or rotating it.
tokenstringrequiredThe key. Send it as Authorization: Bearer <TOKEN>.
expiresMsinteger<int64> | nullWhen the key stops working, in milliseconds since the Unix epoch. Null when it does not expire.
The request failed. The status says how and error.message says why.
errorErrorDetailrequiredShow propertiesHide properties
codestring | nullA code for programs to branch on, when the error has one.
messagestringrequiredWhat went wrong, in a sentence a person can read.