Documentation
API keys
Admin API key CRUD + rotation. Wraps /api/v1/api-keys. Used to mint the sk_live_... keys you pass to Client(token=...) / SharkClient({ adminKey: ... }).
The full key value is shown exactly once at creation or rotation. Store it before continuing.
Setup
Or via the composer:
Create
| Param | Type | Required | Notes |
|---|---|---|---|
name | string | yes | Human-readable label |
scopes | string[] | no | Empty array means "no admin scopes" |
expires_at | ISO 8601 | no | Defaults to no expiry |
Response: { id, key, name, scopes, expires_at, created_at }. The key field is the bearer to pass to subsequent clients.
List
Returns metadata only — no raw key values.
Get
Rotate
The old key is invalidated immediately. Update your callers before destroying the old value.
Revoke
204 on success.
Scope matrix
Admin scopes follow a <resource>:<verb> pattern:
| Scope | What |
|---|---|
users:read / :write | List/CRUD users, set tier |
agents:read / :write | Register, revoke, rotate agents |
oauth:revoke | Bulk revoke by GLOB pattern |
vault:admin | List + disconnect vault connections |
vault:read | Used on agent tokens, not API keys |
webhooks:write | CRUD webhook subscriptions |
audit:read / :export | Query / export audit logs |
audit:purge | Delete old audit log entries |
rbac:write | Manage roles, permissions, role assignments |
organizations:write | Org CRUD + member + invitation |
apps:write | Application CRUD + secret rotation |
Pass an empty scopes list (or omit) to request "all admin scopes" — but production keys should be scoped tightly.
See also
- Programmatic admin onboarding — bootstrap the first key + register integrations
- Audit logs —
api_key.created/api_key.rotatedevents