Skip to content

Create an API key

POST
/api-keys
curl --request POST \
--url https://api.global.stillbox.example/v1/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "access": "read", "actions": [ "example" ], "sandbox_ids": [ "example" ], "expires_at": "2026-04-15T12:00:00Z", "service_user_id": "example" }'

The key is in the response only; it can’t be shown again.

Media typeapplication/json
object
name
required
string
<= 100 characters
access

What a key may do, never more than the role behind it allows. read: every read, no terminals. use: also work in existing sandboxes (commands, terminals, files, checkpoints, schedules, the agent). create: also make and remove sandboxes and their parts. full: everything, including organization settings. custom: only actions.

string
Allowed values: read use create full custom
actions

For custom access, the operation IDs the key may call (see listKeyActions).

Array<string>
sandbox_ids

Limit the key to these sandboxes. Such a key can’t use organization-wide operations.

Array<string>
<= 100 items
expires_at

When the key stops working.

string format: date-time
service_user_id

Make the key for a service user instead of yourself (owners only).

string

The new key

Media typeapplication/json
object
id
required
string
name
required
string
key
required

The whole key. Store it now; it is never shown again.

string

Example generated

{
"id": "example",
"name": "example",
"key": "example"
}

The request is invalid

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}

The API key is missing or invalid

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}