Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview

List API keys

Returns the API keys you manage, without the keys themselves. Each one says what it can do, what it reaches and when it was last used.

GET/_luna/tokens
Authorization
AuthorizationBearer token · headerrequired

An account key (la_…), an API key (lt_…) or a session token (ls_…). The scopes listed are the permissions the operation needs.

Scopes:tokens:write
Responses
200

The keys.

tokensTokenItem[]required

The API keys you manage.

Show properties
Array of TokenItem
idstringrequired

The key's id, for revoking or rotating it.

namestringrequired
scopesstring[]required

The permissions the key holds.

tenantsstring[]required

The tenants the key reaches. Empty means all of them.

createdMsinteger<int64>required

When the key was made, in milliseconds since the Unix epoch.

min 0
projectstring | null

The id of the project the key belongs to.

rootstring | null

The project's production tenant, which every tenant of the project is named after.

orgstring | null

The id of the organisation the key belongs to.

environmentsstring[] | null

The environments the key reaches. Left out when it reaches all of them.

expiresMsinteger<int64> | null

When the key stops working, in milliseconds since the Unix epoch. Left out when it does not expire.

min 0
createdBystring | null

Who made the key.

lastUsedMsinteger<int64> | null

When the key was last used, in milliseconds since the Unix epoch. Null when it has not been used.

min 0
default

The request failed. The status says how and error.message says why.

errorErrorDetailrequired
Show properties
codestring | null

A code for programs to branch on, when the error has one.

messagestringrequired

What went wrong, in a sentence a person can read.

Try it
Server
Authorization
Request
curl -X GET 'https://luna.example.com/_luna/tokens' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "tokens": [
    {
      "id": "string",
      "name": "string",
      "scopes": [
        "string"
      ],
      "tenants": [
        "string"
      ],
      "createdMs": 0,
      "project": "string",
      "root": "string",
      "org": "string",
      "environments": [
        "string"
      ],
      "expiresMs": 0,
      "createdBy": "string",
      "lastUsedMs": 0
    }
  ]
}

Was this page helpful?