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

# Rename API Key

> Update the display name of an existing API key without changing its secret value or capabilities.

<Warning>
  **Legacy endpoint - deprecated.** Unversioned endpoints are scheduled for removal on **July 31, 2026**. A public v1 replacement is not currently listed in the v1 reference. This endpoint remains available for existing integrations until then.
</Warning>

Updates the display name of an existing API key. The secret value is not regenerated and the key's permissions are unchanged, only the human-readable label is updated. Use this when teams, environments, or downstream services are renamed and you want the key list to keep showing the right context at a glance.

## When to use this

API keys are typically named for the system or environment that owns them (for example `Production Server`, `Staging Worker`, `Acme CRM Integration`). Rename a key when:

* A consumer service is renamed and the existing label no longer matches.
* Ownership moves between teams and the new owner needs the key list to reflect the handover.
* A key was created with a placeholder name (`temp`, `test`) and should be relabelled before going to production.

If you want to rotate the secret instead of just the label, you must create a new key with [Create API Key](/docs/api-reference/api-keys/create), update all consumers, then revoke the old one with [Revoke API Key](/docs/api-reference/api-keys/revoke).

## Behavior

* The `id` and secret value are unchanged.
* The `last_used_at` timestamp is unaffected.
* The key remains active throughout the rename.

## Path parameters

| Parameter | Description                                   |
| --------- | --------------------------------------------- |
| `id`      | The API key ID, for example `abcgvvzzlrbnqy`. |

## Errors

* `404 Not Found` is returned when the API key does not exist or has been revoked.
* `400 Bad Request` is returned when the `name` field is missing or empty.

## Related endpoints

* [List API Keys](/docs/api-reference/api-keys/list): confirm the renamed key in your portfolio.
* [Create API Key](/docs/api-reference/api-keys/create): issue a new key when you need to rotate the secret.
* [Revoke API Key](/docs/api-reference/api-keys/revoke): permanently retire a key.


## OpenAPI

````yaml PATCH /api-keys/{id}
openapi: 3.0.0
info:
  title: DialNexa API
  description: >-
    Public REST API for the DialNexa voice AI platform. Versioned endpoints are
    under /v1; unversioned endpoints are legacy and deprecated.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: API Keys
  - name: Agent Functions
  - name: Agents V1
  - name: Agents2
  - name: Batch Calls
  - name: Batch Calls V1
  - name: Call Logs
  - name: Calls
  - name: Calls V1
  - name: Campaign Leads
  - name: Campaigns
  - name: External Webhooks
  - name: Knowledge Base
  - name: Knowledge Base V1
  - name: LLMs
  - name: LLMs V1
  - name: Languages
  - name: Languages V1
  - name: Organization Phone Numbers
  - name: Organization Phone Numbers V1
  - name: Phone Number Pricing
  - name: Phone Number Pricing V1
  - name: Transcribers
  - name: Transcribers V1
  - name: User Webhooks
  - name: User Webhooks V1
  - name: V1
  - name: Voices
  - name: Voices V1
  - name: Webcall
  - name: Workflow Leads
  - name: Workflow Leads V1
  - name: Workflows
  - name: Workflows V1
paths:
  /api-keys/{id}:
    patch:
      tags:
        - API Keys
      summary: Update the name of an API key
      description: >-
        **Legacy endpoint - deprecated, scheduled for removal on July 31,
        2026.** Use the `/v1` version for new integrations. 
      operationId: ApiKeyController_updateApiKeyName
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: x-organization-id
          in: header
          description: RSA encrypted organization ID (base64 format)
          required: true
          schema:
            type: string
            example: BASE64_ENCRYPTED_ORG_ID_HERE
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateApiKeyNameDto'
      responses:
        '200':
          description: API key name updated
          content:
            application/json:
              schema:
                example:
                  statusCode: 200
                  message: API key name updated successfully
                  data:
                    success: true
      deprecated: true
      security:
        - bearer: []
components:
  schemas:
    UpdateApiKeyNameDto:
      type: object
      properties:
        name:
          type: string
          example: CI Pipeline Key
          description: New label for the API key
      required:
        - name
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````