Tokens

API tokens and agent enrollment tokens.

All paths are relative to the base path /api/v1 (same origin as the UI). Authentication, roles, pagination and the error format are described in the overview; the types are on the page Data types.

OperationRequestPermission
List API tokens (without secrets)GET /tokenstokens:manage (admin)
Create an API token (the secret is returned only once)POST /tokenstokens:manage (admin)
Revoke an API tokenDELETE /tokens/{id}tokens:manage (admin)
List agent enrollment tokens (without secrets)GET /enrollment-tokensenrollment:manage (admin)
Create an enrollment token for supervisors/myriarch-updaters (secret returned once)POST /enrollment-tokensenrollment:manage (admin)
Revoke an enrollment token (connected agents are not disconnected; reconnects fail)DELETE /enrollment-tokens/{id}enrollment:manage (admin)

List API tokens (without secrets)

GET /api/v1/tokens

Operation listApiTokens. Permission tokens:manage (lowest role: admin).

Responses

StatusDescriptionContent typeType
200API tokensapplication/jsonAPITokenList
401Not authenticated (code unauthorized)application/problem+jsonProblem

Create an API token (the secret is returned only once)

POST /api/v1/tokens

Operation createApiToken. Permission tokens:manage (lowest role: admin).

Parameters

NameInTypeRequiredDescription
X-CSRF-TokenheaderstringnoRequired for cookie-authenticated mutating requests (value of cookie myriarch_csrf).

Request body

Content type application/json, required. Type: CreateAPITokenRequest.

{
  "name": "string",
  "role": "viewer",
  "expiresAt": "2026-01-01T00:00:00Z"
}

Responses

StatusDescriptionContent typeType
201Createdapplication/jsonCreatedAPIToken
422Validation failed (code validation_failed, details in issues)application/problem+jsonProblem

Revoke an API token

DELETE /api/v1/tokens/{id}

Operation revokeApiToken. Permission tokens:manage (lowest role: admin).

Parameters

NameInTypeRequiredDescription
idpathstringyesFormat uuid.
X-CSRF-TokenheaderstringnoRequired for cookie-authenticated mutating requests (value of cookie myriarch_csrf).

Responses

StatusDescriptionContent typeType
204Revoked--
404Not found (code not_found)application/problem+jsonProblem

List agent enrollment tokens (without secrets)

GET /api/v1/enrollment-tokens

Operation listEnrollmentTokens. Permission enrollment:manage (lowest role: admin).

Responses

StatusDescriptionContent typeType
200Enrollment tokensapplication/jsonEnrollmentTokenList
401Not authenticated (code unauthorized)application/problem+jsonProblem

Create an enrollment token for supervisors/myriarch-updaters (secret returned once)

POST /api/v1/enrollment-tokens

Operation createEnrollmentToken. Permission enrollment:manage (lowest role: admin).

Parameters

NameInTypeRequiredDescription
X-CSRF-TokenheaderstringnoRequired for cookie-authenticated mutating requests (value of cookie myriarch_csrf).

Request body

Content type application/json, required. Type: CreateEnrollmentTokenRequest.

{
  "name": "string",
  "labels": {
    "key": "string"
  },
  "expiresAt": "2026-01-01T00:00:00Z"
}

Responses

StatusDescriptionContent typeType
201Createdapplication/jsonCreatedEnrollmentToken
422Validation failed (code validation_failed, details in issues)application/problem+jsonProblem

Revoke an enrollment token (connected agents are not disconnected; reconnects fail)

DELETE /api/v1/enrollment-tokens/{id}

Operation revokeEnrollmentToken. Permission enrollment:manage (lowest role: admin).

Parameters

NameInTypeRequiredDescription
idpathstringyesFormat uuid.
X-CSRF-TokenheaderstringnoRequired for cookie-authenticated mutating requests (value of cookie myriarch_csrf).

Responses

StatusDescriptionContent typeType
204Revoked--
404Not found (code not_found)application/problem+jsonProblem