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

# Update an API key

> Rename an active API key.



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public patch /v1/api-keys/{apiKeyId}
openapi: 3.1.0
info:
  title: Tembo Public API
  description: Public API Endpoints for Tembo
  version: 1.0.0
servers:
  - url: https://api.tembo.io
    description: Tembo API
  - url: https://{deployment-origin}/api/public-api
    description: Self-hosted Tembo
    variables:
      deployment-origin:
        default: tembo.example.com
        description: Hostname of your self-hosted Tembo deployment
security: []
paths:
  /v1/api-keys/{apiKeyId}:
    patch:
      tags:
        - API Keys
      summary: Update an API key
      description: Rename an active API key.
      operationId: updateApiKey
      parameters:
        - in: path
          name: apiKeyId
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
              required:
                - name
              additionalProperties: false
      responses:
        '200':
          description: Update an API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  createdAt:
                    type: string
                    format: date-time
                  id:
                    type: string
                    format: uuid
                  name:
                    type:
                      - string
                      - 'null'
                  updatedAt:
                    type: string
                    format: date-time
                  userId:
                    type:
                      - string
                      - 'null'
                  tokenPreview:
                    type: string
                required:
                  - createdAt
                  - id
                  - name
                  - updatedAt
                  - userId
                  - tokenPreview
                additionalProperties: false
        '400':
          description: Validation error or missing resource scope
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: API key not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '500':
          description: API key operation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````