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

# Update Api Key

> Update an API key's name, scopes, or active status.



## OpenAPI

````yaml /api-reference/openapi.json put /api/api-keys/{key_id}
openapi: 3.1.0
info:
  title: Blindsight API
  version: 0.1.0
servers: []
security: []
paths:
  /api/api-keys/{key_id}:
    put:
      tags:
        - api-keys
      summary: Update Api Key
      description: Update an API key's name, scopes, or active status.
      operationId: update_api_key_api_api_keys__key_id__put
      parameters:
        - name: key_id
          in: path
          required: true
          schema:
            type: integer
            title: Key Id
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
        - name: blindsight_session
          in: cookie
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Blindsight Session
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ApiKeyUpdateRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Name
        scopes:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Scopes
        is_active:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Active
      additionalProperties: false
      type: object
      title: ApiKeyUpdateRequest
      description: Request to update an API key.
    ApiKeyRead:
      properties:
        id:
          type: integer
          title: Id
        uuid:
          type: string
          title: Uuid
        name:
          type: string
          title: Name
        key_preview:
          type: string
          title: Key Preview
        scopes:
          items:
            type: string
          type: array
          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
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - uuid
        - name
        - key_preview
        - scopes
        - is_active
        - created_at
        - updated_at
      title: ApiKeyRead
      description: API key details (without the actual key).
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````