> ## Documentation Index
> Fetch the complete documentation index at: https://levers9.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Toggle token



## OpenAPI

````yaml /api-reference/openapi/controlplane.openapi.json post /tokens/{tokenId}/toggle
openapi: 3.0.0
info:
  title: levers9 controlplane API
  version: 1.0.0
  description: >-
    REST view of the levers9 controlplane gRPC service, served by the
    controlplane on port 1994. Authenticate with `Authorization: Bearer
    <token>`.
servers:
  - url: https://levers9.uselevers.com
    description: local controlplane
  - url: https://api.uselevers.com
    description: hosted
security:
  - bearer: []
tags:
  - name: ControlPlaneService
paths:
  /tokens/{tokenId}/toggle:
    post:
      tags:
        - ControlPlaneService
      summary: Toggle token
      operationId: ControlPlaneService_ToggleToken
      parameters:
        - name: tokenId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controlplaneToggleTokenResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
components:
  schemas:
    controlplaneToggleTokenResponse:
      type: object
      properties:
        ok:
          type: boolean
        errMsg:
          type: string
        token:
          $ref: '#/components/schemas/controlplaneToken'
    rpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
    controlplaneToken:
      type: object
      properties:
        tokenId:
          type: string
        key:
          type: string
          description: >-
            The token itself. Only CreateToken fills it, once; lists and toggles
            leave it empty and give keyHint.
        keyHint:
          type: string
          description: >-
            Enough of the key to recognise it, never enough to use it: its first
            six and last four characters.
        active:
          type: boolean
        reusable:
          type: boolean
        workspaceId:
          type: integer
          format: int64
        tokenType:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    protobufAny:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties: {}
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.