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

# Update API key

> Partially updates an API key. Omitted fields (not included in body) leave the stored value unchanged.



## OpenAPI

````yaml /api-reference/openapi.json put /api-keys/{apiKey}
openapi: 3.0.0
info:
  title: RouteMesh API
  version: 1.0.0
  description: >-
    HTTP API for routing JSON-RPC requests across providers, managing API keys,
    and viewing usage.
  license:
    name: Proprietary
    url: https://routeme.sh
servers:
  - url: https://lb.routeme.sh
    description: Primary API endpoint
  - url: https://lb2.routeme.sh
    description: AWS DNS load balancer (backup)
security: []
tags:
  - name: RPC
    description: Forward JSON-RPC requests to the router.
  - name: Chains
    description: Discover supported chains.
  - name: API Keys
    description: Manage your API keys for self-service access.
  - name: Usage
    description: View your usage and billing data.
  - name: Health
    description: Service health checks.
paths:
  /api-keys/{apiKey}:
    put:
      tags:
        - API Keys
      summary: Update API key
      description: >-
        Partially updates an API key. Omitted fields (not included in body)
        leave the stored value unchanged.
      operationId: updateApiKey
      parameters:
        - name: apiKey
          in: path
          required: true
          description: The API key string (not the numeric ID).
          schema:
            type: string
          example: rm_abc123def456...
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyUpdateRequest'
      responses:
        '200':
          description: API key updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyResponse'
        '400':
          description: Bad request (invalid domains or missing API key)
        '401':
          description: Unauthorized
        '404':
          description: API key not found
        '500':
          description: Internal server error
      security:
        - MgmtKeyAuth: []
components:
  schemas:
    ApiKeyUpdateRequest:
      type: object
      properties:
        allowed_domains:
          type: array
          items:
            type: string
          description: Replace allowed domains list. Omit to keep current value.
          nullable: true
        name:
          type: string
          description: Update friendly name. Omit to keep current value.
          nullable: true
        active:
          type: boolean
          description: Activate or deactivate the key. Omit to keep current value.
          nullable: true
      additionalProperties: false
    ApiKeyResponse:
      type: object
      properties:
        id:
          type: integer
          description: Internal key ID (for filtering /usage).
        name:
          type: string
          nullable: true
          description: Friendly name.
        active:
          type: boolean
          description: Whether the key is active.
        allowed_domains:
          type: array
          items:
            type: string
          description: Allowed domains.
        routing_strategy:
          type: string
          enum:
            - economy
            - performance
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - name
        - active
        - allowed_domains
        - routing_strategy
        - created_at
        - updated_at
      additionalProperties: false
  securitySchemes:
    MgmtKeyAuth:
      type: apiKey
      in: header
      name: X-Mgmt-Key
      description: >-
        Management API key from the RouteMesh dashboard. Required for customer
        API endpoints (/api-keys, /usage). Each request also carries the
        customer's RPC API key in the URL path for the RPC endpoint.

````