Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content
API reference

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.

Parameters
NameInTypeRequiredDescription
limitqueryintegernoNumber of records to return (1-200)
cursorquerystringnoSealed pagination cursor from previous page
curl
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:

FieldTypeRequiredDescription
idstringyes
namestringyes
rolestring: read, member, adminyes
projectstring, nullableno
statusstring: active, revoked, expiredyes
created_atstring (date-time)yes
last_used_atstring (date-time), nullableno
{
  "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
}
Errors
StatusMeaning
401Unauthenticated (missing, invalid, or expired token)
403Forbidden (role_required, role_ceiling, project_scoped, forbidden, or a key that isn't a management key)
500Internal 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.

Parameters
NameInTypeRequiredDescription
Idempotency-KeyheaderstringnoUnique key for safe write retries within 24h
Request body
FieldTypeRequiredDescription
namestringyes
rolestring: read, member, adminyes
projectstring, nullableno
expires_atstring (date-time), nullablenoWhen the key stops working, an RFC 3339 time in the future. Left out, the key doesn't expire.
curl
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

FieldTypeRequiredDescription
idstringyes
namestringyes
keystringyes
rolestringyes
projectstring, nullableno
statusstringyes
created_atstring (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"
}
Errors
StatusMeaning
400Bad request (validation, invalid_cursor, out_of_bounds)
401Unauthenticated (missing, invalid, or expired token)
403Forbidden (role_required, role_ceiling, project_scoped, forbidden, or a key that isn't a management key)
500Internal 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.

Parameters
NameInTypeRequiredDescription
Idempotency-KeyheaderstringnoUnique key for safe write retries within 24h
key_idpathstringyes
curl
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

FieldTypeRequiredDescription
idstringyes
namestringyes
keystringyes
rolestringyes
projectstring, nullableno
statusstringyes
created_atstring (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"
}
Errors
StatusMeaning
401Unauthenticated (missing, invalid, or expired token)
403Forbidden (role_required, role_ceiling, project_scoped, forbidden, or a key that isn't a management key)
404Not found
500Internal 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.

Parameters
NameInTypeRequiredDescription
key_idpathstringyes
curl
curl -X DELETE "https://api.mubit.ai/api/v1/management-keys/$KEY_ID" \
  -H "Authorization: Bearer $MUBIT_MANAGEMENT_KEY"

Response 200: Management key revoked

FieldTypeRequiredDescription
idstringyes
statusstring: revokedyes
{
  "id": "mkey_987654",
  "status": "revoked"
}
Errors
StatusMeaning
401Unauthenticated (missing, invalid, or expired token)
403Forbidden (role_required, role_ceiling, project_scoped, forbidden, or a key that isn't a management key)
404Not found
500Internal server error