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

# Update a specific API key



## OpenAPI

````yaml patch /v1/api-keys/{key_name}
openapi: 3.0.0
info:
  title: API Keys Management API
  version: 1.0.0
  description: API for managing API keys for user authentication
servers: []
security: []
paths:
  /v1/api-keys/{key_name}:
    patch:
      tags:
        - API Keys
      summary: Update a specific API key
      parameters:
        - in: path
          name: key_name
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyUpdate'
      responses:
        '200':
          description: API key updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ApiKeyUpdate:
      type: object
      properties:
        name:
          type: string
          description: The new name for the API key
        expires_at:
          type: string
          format: date-time
          description: The new expiration date and time for the API key
    ApiKeyResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        last_used_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        status:
          type: string
          enum:
            - ACTIVE
            - EXPIRED
            - REVOKED
        name:
          type: string
        prefix:
          type: string
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
        message:
          type: string
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````