Management keys
Management keys sign management API calls. Only a key of role admin manages them. A new or rotated key's secret is in the answer once, and never again.
All paths are under https://api.mubit.ai, with a management key in Authorization: Bearer. Management API covers keys, roles, pagination, retries and errors. The samples read the key from MUBIT_MANAGEMENT_KEY.
List management keys
GET /api/v1/management-keys
Lists the organization's management keys, newest first, up to limit. The secrets are never returned.
Role: admin.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer | no | Number of records to return (1-200) |
cursor | query | string | no | Sealed pagination cursor from previous page |
curl "https://api.mubit.ai/api/v1/management-keys" \
-H "Authorization: Bearer $MUBIT_MANAGEMENT_KEY"Response 200: List of management keys
Each item of data:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
name | string | yes | |
role | string: read, member, admin | yes | |
project | string, nullable | no | |
status | string: active, revoked, expired | yes | |
created_at | string (date-time) | yes | |
last_used_at | string (date-time), nullable | no |
{
"data": [
{
"id": "mkey_012345",
"name": "CI Runner Key",
"role": "member",
"project": "prj_ci",
"status": "active",
"created_at": "2026-10-10T00:00:00Z",
"last_used_at": "2026-10-25T18:22:00Z"
}
],
"next_cursor": null
}| Status | Meaning |
|---|---|
401 | Unauthenticated (missing, invalid, or expired token) |
403 | Forbidden (role_required, role_ceiling, project_scoped, forbidden, or a key that isn't a management key) |
500 | Internal server error |
Create management key
POST /api/v1/management-keys
Creates a management key. The answer holds the key's secret in key, once: store it then. The role can't be higher than the role of the key that creates it (403 role_ceiling). With project, the key reaches only that project. With expires_at (an RFC 3339 time in the future), the key stops working then.
Role: admin.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | no | Unique key for safe write retries within 24h |
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | |
role | string: read, member, admin | yes | |
project | string, nullable | no | |
expires_at | string (date-time), nullable | no | When the key stops working, an RFC 3339 time in the future. Left out, the key doesn't expire. |
curl -X POST "https://api.mubit.ai/api/v1/management-keys" \
-H "Authorization: Bearer $MUBIT_MANAGEMENT_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Deployment Agent","role":"admin","project":null}'Response 201: Management key created
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
name | string | yes | |
key | string | yes | |
role | string | yes | |
project | string, nullable | no | |
status | string | yes | |
created_at | string (date-time) | yes |
{
"id": "mkey_987654",
"name": "Deployment Agent",
"key": "mwm_inst_987654_secrettoken0123456789",
"role": "admin",
"project": null,
"status": "active",
"created_at": "2026-10-26T12:00:00Z"
}| Status | Meaning |
|---|---|
400 | Bad request (validation, invalid_cursor, out_of_bounds) |
401 | Unauthenticated (missing, invalid, or expired token) |
403 | Forbidden (role_required, role_ceiling, project_scoped, forbidden, or a key that isn't a management key) |
500 | Internal server error |
Rotate management key
POST /api/v1/management-keys/{key_id}/rotate
Gives a management key a new secret, in key, once. The old secret stops working within a minute. A key can rotate itself and the keys made with it, never a key of a higher role (403 role_ceiling) or another key (403 forbidden). A revoked key can't be rotated (409 state_conflict).
Role: admin.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | no | Unique key for safe write retries within 24h |
key_id | path | string | yes |
curl -X POST "https://api.mubit.ai/api/v1/management-keys/$KEY_ID/rotate" \
-H "Authorization: Bearer $MUBIT_MANAGEMENT_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY"Response 200: Rotated management key
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
name | string | yes | |
key | string | yes | |
role | string | yes | |
project | string, nullable | no | |
status | string | yes | |
created_at | string (date-time) | yes |
{
"id": "mkey_987654",
"name": "Deployment Agent",
"key": "mwm_inst_987654_newsecrettoken9876543",
"role": "admin",
"project": null,
"status": "active",
"created_at": "2026-10-26T12:00:00Z"
}| Status | Meaning |
|---|---|
401 | Unauthenticated (missing, invalid, or expired token) |
403 | Forbidden (role_required, role_ceiling, project_scoped, forbidden, or a key that isn't a management key) |
404 | Not found |
500 | Internal server error |
Revoke management key
DELETE /api/v1/management-keys/{key_id}
Revokes a management key. It stops working within a minute, and can't be used again.
Role: admin.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
key_id | path | string | yes |
curl -X DELETE "https://api.mubit.ai/api/v1/management-keys/$KEY_ID" \
-H "Authorization: Bearer $MUBIT_MANAGEMENT_KEY"Response 200: Management key revoked
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
status | string: revoked | yes |
{
"id": "mkey_987654",
"status": "revoked"
}| Status | Meaning |
|---|---|
401 | Unauthenticated (missing, invalid, or expired token) |
403 | Forbidden (role_required, role_ceiling, project_scoped, forbidden, or a key that isn't a management key) |
404 | Not found |
500 | Internal server error |