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

# Toggle My Api Key Active

> Enable or disable one of the user's own API keys.



## OpenAPI

````yaml /openapi.json patch /api/me/api-keys/{key_id}/active
openapi: 3.1.0
info:
  title: FIM One API
  description: >-
    All-in-one agent platform for Global × China enterprises — programmatic
    access to agents, conversations, knowledge bases, and more.
  version: 0.8.9
servers:
  - url: https://your-domain.com
    description: Your FIM One instance
security:
  - BearerAuth: []
paths:
  /api/me/api-keys/{key_id}/active:
    patch:
      tags:
        - user-settings
      summary: Toggle My Api Key Active
      description: Enable or disable one of the user's own API keys.
      operationId: toggle_my_api_key_active_api_me_api_keys__key_id__active_patch
      parameters:
        - name: key_id
          in: path
          required: true
          schema:
            type: string
            title: Key Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserApiKeyToggleRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserApiKeyInfo'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UserApiKeyToggleRequest:
      properties:
        is_active:
          type: boolean
          title: Is Active
      type: object
      required:
        - is_active
      title: UserApiKeyToggleRequest
    UserApiKeyInfo:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        key_prefix:
          type: string
          title: Key Prefix
        scopes:
          anyOf:
            - type: string
            - type: 'null'
          title: Scopes
        is_active:
          type: boolean
          title: Is Active
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        last_used_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Used At
        total_requests:
          type: integer
          title: Total Requests
          default: 0
        created_at:
          type: string
          title: Created At
      type: object
      required:
        - id
        - name
        - key_prefix
        - is_active
        - created_at
      title: UserApiKeyInfo
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API Key (fim_xxx) or JWT token

````