Skip to content

Create an API key

POST/v1/api-keys

Creates a personal API key. The full token appears only in this response. Store it securely, because it cannot be retrieved again.

Keys expire after 365 days by default. Set expires_in_days to choose a lifetime (capped at 730 days), or set never_expires to true. Do not send both.

Authentication

Send your API key as Authorization: Bearer <token>.

Request body

namestringRequired

Label for the key. Must be unique among your keys.

expires_in_daysinteger

Days until the key expires. Defaults to 365. Values above 730 are capped at 730.

min 1 · max 730

never_expiresboolean

Create a key that never expires. Cannot be combined with expires_in_days.

Default false

scopestring

What the key is for. cli covers the CLI and REST API. mcp is for the Rumpty MCP server.

Default cliOne ofclimcp

permissionsarray of strings

Permissions this key may use, capped by your role in each workspace. Omit it to grant the default set (workspace.read, resource.write, runtime.connect, secrets.read, secrets.manage). Keys that already exist keep that same default until you replace them.

One ofworkspace.readresource.writeruntime.connectsecrets.readsecrets.managemembers.manageaudit.readbilling.readbilling.manageworkspace.manageworkspace.transferworkspace.delete

Response

201

The key was created. The response includes the one-time token.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
uidstringRequired

Unique identifier of the key.

namestringRequired

Label you gave the key.

prefixstringRequired

First 8 characters of the token's identifier, used to recognise the key.

scopesarray of stringsRequired

What the key can be used for.

One ofclimcp

permissionsarray of stringsRequired

Permissions the key may use. A request also needs your role in that workspace to grant the same permission. A key with no stored list uses the default set.

One ofworkspace.readresource.writeruntime.connectsecrets.readsecrets.managemembers.manageaudit.readbilling.readbilling.manageworkspace.manageworkspace.transferworkspace.delete

never_expiresboolean

Present and true when the key has no expiry.

expires_atstring (date-time)

When the key expires (RFC 3339, UTC). Omitted for keys that never expire.

created_atstring (date-time)Required

When the key was created.

last_used_atstring (date-time)

When the key last authenticated a request. Omitted if it has never been used.

tokenstringRequired

The full secret token. Shown only once.

Errors

StatusMeaning
400Validation failed: name is missing or already used, scope is not cli or mcp, permissions contains an unknown value, or both never_expires and expires_in_days were sent.
401The API key is missing, invalid, expired or revoked.

Errors use the standard error format.