Mint an operator API key (Admin/Owner session only)
const url = 'https://quikstik-core.fly.dev/operator-keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"label":"example","scopes":["bookings.read"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Operator-facing name for the grant (audited; the key itself is never stored).
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.
Responses
Section titled “Responses”Key minted; the raw key is shown exactly once
object
The raw sk_op_… key. Shown exactly once; only its SHA-256 digest persists.
Example generated
{ "operator_key_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "key": "example", "scopes": [ "example" ], "label": "example"}Malformed body
object
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)
object
Example generated
{ "reason": "example"}No durable backend is wired for this operation (fail-closed)
object
Stable, machine-readable reason code (e.g. “sold_out”, “processor_not_configured”, “rail_refused”).
Example
{ "reason": "sold_out"}