> ## 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 one of the authenticated customer's API keys by numeric ID. Omitted fields leave the stored value unchanged. Use the id from GET /api-keys.



## OpenAPI

````yaml /api-reference/openapi.json put /api-keys/{id}
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://api.routeme.sh
    description: API server — health, chains, API keys, usage, and public submissions
  - url: https://lb.routeme.sh
    description: RPC router (primary load balancer)
  - url: https://lb2.routeme.sh
    description: RPC router (AWS backup load balancer)
security: []
tags:
  - name: RPC
    description: Forward JSON-RPC requests to the router.
  - name: Chains
    description: Discover supported chains.
  - name: Submissions
    description: Public chain and node listing requests (rate-limited per IP).
  - name: API Keys
    description: Manage your API keys for self-service access.
  - name: Usage
    description: View your usage and billing data.
  - name: Pricing
    description: >-
      Current RPC route and websocket notification prices (public,
      rate-limited).
  - name: Health
    description: Service health checks.
  - name: Provider
    description: >-
      Provider-scoped management endpoints for managing node plans, methods, and
      nodes. Authenticated with a management token whose customer is linked to a
      provider.
paths:
  /api-keys/{id}:
    servers:
      - url: https://api.routeme.sh
    put:
      tags:
        - API Keys
      summary: Update API key
      description: >-
        Partially updates one of the authenticated customer's API keys by
        numeric ID. Omitted fields leave the stored value unchanged. Use the id
        from GET /api-keys.
      operationId: updateApiKey
      parameters:
        - name: id
          in: path
          required: true
          description: >-
            Numeric API key ID (from GET /api-keys). Not the secret rm_ key
            string.
          schema:
            type: integer
          example: 1
      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 non-numeric id)
        '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-Api-Key
      description: >-
        Management token from the RouteMesh dashboard (Settings → Management
        Tokens). Required for customer API endpoints (/api-keys, /usage). Tokens
        are prefixed rmtm_ and scoped to your account. Authenticate by passing
        the token in the X-Api-Key header. Separate from RPC service keys (rm_),
        which authenticate dApp traffic to the routing layer.

````