API keys

Create an API key

Mints a key for the key’s holder on this account. The answer carries the raw key in raw, once: it is stored only as a hash and no route returns it again. Needs a key with manage_keys on, and a member or owner role (a viewer mints from the dashboard).

A key cannot mint a key with manage_keys on (403): only the dashboard grants it. Nor can it mint one wider than itself. Without workspace_id a key confined to a workspace mints into that workspace, and naming any other scope, null included, is a 403. An account-wide key may name any workspace of the account (an unknown one is a 400) or none, for another account-wide key.

The body is optional. No body, or one of nothing but whitespace, mints an unnamed key exactly as {} does.

The account holds at most 1000 keys, whoever minted them; the next is a 400.

Requires the member role or higher.

post/api-keys

Request

  • Base URL: https://app.mandala.computer/api/v1
  • URL: https://app.mandala.computer/api/v1/api-keys
  • Auth: HTTP bearer

Request body

namestring nullable

A label, up to 60 characters; longer is cut; control, bidirectional and invisible formatting characters (such as U+200B and U+2060) are refused (400), while the joiners U+200C and U+200D and the variation selectors (such as U+FE0F) that emoji and some scripts need are allowed. Optional; null is the same as leaving it out.

workspace_idstring nullable

The workspace to confine the new key to, or leave it out. See above for a workspace-scoped key.

manage_keysboolean

Must be false or absent. true is refused: only the dashboard grants it.

Response

The key, with the raw key in raw.

idstring required

As on ApiKey.

namestring nullable required

As on ApiKey.

prefixstring required

As on ApiKey.

created_atstring required

RFC 3339 timestamp.

last_used_atstring nullable required

Always null: the key has not been used yet.

workspace_idstring nullable required

As on ApiKey.

workspace_namestring nullable required

As on ApiKey.

manage_keysboolean required

As on ApiKey. Always false for a key minted over the API.

minted_by_key_idstring nullable required

As on ApiKey. Always the id of the key that made this request.

rawstring required

The key: com_ and 48 hex characters. Shown here and never again — store it now. Send it as Authorization: Bearer <raw>.

Changes

No recorded changes to this operation across all 1 revision of this API.