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

# Update API Key



## OpenAPI

````yaml PATCH /v1/api-keys/{key_uuid}
openapi: 3.1.0
info:
  title: Calseta
  description: SOC data platform for security agent consumption
  version: dev
servers: []
security: []
paths:
  /v1/api-keys/{key_uuid}:
    patch:
      tags:
        - api-keys
      summary: Update Api Key
      operationId: update_api_key_v1_api_keys__key_uuid__patch
      parameters:
        - name: key_uuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Key Uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/APIKeyUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataResponse_APIKeyResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    APIKeyUpdate:
      properties:
        scopes:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Scopes
          description: Replace scopes list
        allowed_sources:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed Sources
          description: Restrict to these sources (null = unrestricted)
        is_active:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Active
          description: Set to false to revoke
      type: object
      title: APIKeyUpdate
      description: PATCH /v1/api-keys/{uuid} — update mutable fields.
    DataResponse_APIKeyResponse_:
      properties:
        data:
          $ref: '#/components/schemas/APIKeyResponse'
        meta:
          additionalProperties: true
          type: object
          title: Meta
      type: object
      required:
        - data
      title: DataResponse[APIKeyResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    APIKeyResponse:
      properties:
        uuid:
          type: string
          format: uuid
          title: Uuid
        name:
          type: string
          title: Name
        key_prefix:
          type: string
          title: Key Prefix
        scopes:
          items:
            type: string
          type: array
          title: Scopes
        key_type:
          type: string
          title: Key Type
        is_active:
          type: boolean
          title: Is Active
        created_at:
          type: string
          format: date-time
          title: Created At
        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
        allowed_sources:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed Sources
      type: object
      required:
        - uuid
        - name
        - key_prefix
        - scopes
        - key_type
        - is_active
        - created_at
        - expires_at
        - last_used_at
        - allowed_sources
      title: APIKeyResponse
      description: All endpoints other than creation — full key is never included.
    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

````