Skip to content

Mint an operator API key (Admin/Owner session only)

POST
/operator-keys
curl --request POST \
--url https://quikstik-core.fly.dev/operator-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "label": "example", "scopes": [ "bookings.read" ] }'

Session-only and Admin/Owner-only (tenant.administer): an operator key cannot mint keys. The raw key appears exactly once, in this response; only its digest persists. The key acts as the minting actor — revoking that actor’s membership kills the key.

Media typeapplication/json
object
label
required

Operator-facing name for the grant (audited; the key itself is never stored).

string
>= 1 characters
scopes
required

The granted scopes (the operator read + write vocabularies; fail-closed, unknown → 422). Write scopes are underwritten only by an Admin/Owner membership. policies.write lets the key PUT/DELETE /policies/{scope_kind}/{scope_ref}; the booking re-resolve stays session-only.

Array<string>
>= 1 items
Allowed values: bookings.read manifest.read participants.read capacity.read conditions.read bookings.write participants.write proposals.write conditions.write policies.write

Key minted; the raw key is shown exactly once

Media typeapplication/json
object
operator_key_id
required
string format: uuid
key
required

The raw sk_op_… key. Shown exactly once; only its SHA-256 digest persists.

string
scopes
required
Array<string>
label
required
string

Example generated

{
"operator_key_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"key": "example",
"scopes": [
"example"
],
"label": "example"
}

Malformed body

Media typeapplication/json
object
reason
required
string

Example generated

{
"reason": "example"
}

No or invalid session

Session actor is not Admin/Owner in the tenant

Unknown scope token (the grantable vocabulary is fail-closed)

Media typeapplication/json
object
reason
required
string

Example generated

{
"reason": "example"
}

No durable backend is wired for this operation (fail-closed)

Media typeapplication/json
object
reason
required

Stable, machine-readable reason code (e.g. “sold_out”, “processor_not_configured”, “rail_refused”).

string

Example

{
"reason": "sold_out"
}