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

# Set Token Enabled

> Enable or disable a token.

Disabling is the reversible way to cut off a leaked token; the service
invalidates the auth caches so it stops working immediately rather than
waiting out a TTL.



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json patch /api/admin/tokens/{token_id}
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/admin/tokens/{token_id}:
    patch:
      tags:
        - admin-tokens
      summary: Set Token Enabled
      description: |-
        Enable or disable a token.

        Disabling is the reversible way to cut off a leaked token; the service
        invalidates the auth caches so it stops working immediately rather than
        waiting out a TTL.
      operationId: set_token_enabled_api_admin_tokens__token_id__patch
      parameters:
        - name: token_id
          in: path
          required: true
          schema:
            type: string
            title: Token Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTokenRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse_AdminActionStatus_'
        '401':
          description: Authorization failed
        '403':
          description: Insufficient permissions
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    UpdateTokenRequest:
      properties:
        isEnabled:
          type: boolean
          title: Isenabled
      additionalProperties: false
      type: object
      required:
        - isEnabled
      title: UpdateTokenRequest
      description: >-
        Enable or disable a token. Scope and limit changes are out of scope
        here:

        the admin UI only offers enable/disable/delete.
    GenericResponse_AdminActionStatus_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/AdminActionStatus'
            - type: 'null'
          description: Response data
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Response status
      type: object
      title: GenericResponse[AdminActionStatus]
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    AdminActionStatus:
      properties:
        id:
          type: string
          title: Id
        status:
          type: string
          title: Status
      type: object
      required:
        - id
        - status
      title: AdminActionStatus
      description: Result of a mutating admin action on a single resource.
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````