v1

latestOpenAPI 3.0.32026-07-22238629559.2 KB
TokenService

Delete tokens

Delete all tokens matching the given filters

delete/api/tokens/v1/deployments/{deploymentId}/tokens

Path parameters

deploymentIdinteger required

The unique numerical identifier for the deployment.

Example:1111

Query parameters

purpose'TOKEN_PURPOSE_UNSPECIFIED' | 'TOKEN_PURPOSE_NONE' | 'TOKEN_PURPOSE_SMS' | 'TOKEN_PURPOSE_SCRAT' | 'TOKEN_PURPOSE_CLICK_TO_FIX' | 'TOKEN_PURPOSE_AI_SCAN' | 'TOKEN_PURPOSE_CLI' | 'TOKEN_PURPOSE_API' enum

Which tokens to delete. Must be TOKEN_PURPOSE_CLI or TOKEN_PURPOSE_API. Required.

Example:TOKEN_PURPOSE_CLI

Required. Only CLI and API tokens can be bulk-deleted through this RPC, so the value must be TOKEN_PURPOSE_CLI or TOKEN_PURPOSE_API. Other purposes (service tokens, etc.) are intentionally not deletable here.

roleFilter'TOKEN_ROLE_UNSPECIFIED' | 'TOKEN_ROLE_AGENT_CLI' | 'TOKEN_ROLE_WEBAPI' | 'TOKEN_ROLE_MEMBER' enum

Only delete tokens with this role, such as TOKEN_ROLE_MEMBER. Required when purpose is TOKEN_PURPOSE_API; must not be set for TOKEN_PURPOSE_CLI.

Example:TOKEN_ROLE_MEMBER

Required when purpose is TOKEN_PURPOSE_API (API tokens span multiple roles, so the caller must pick one); must not be set for TOKEN_PURPOSE_CLI, which is role-uniform.

Response

OK

deletedCountinteger

The number of tokens that were deleted.

Example response

{
  "deletedCount": 5
}