> ## 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.

# Revoke API Key

> Permanently revoke an API key so any future request using it returns 401 Unauthorized.

<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>

Permanently revokes an API key. Every API request that arrives with this key starts returning `401 Unauthorized` immediately, including in-flight requests that were authenticated with the key but had not yet been authorized. Revocation cannot be undone, DialNexa does not retain enough state to re-issue the same secret. To restore access, create a new key with [Create API Key](/docs/api-reference/api-keys/create) and update the consumer.

## When to use this

Revoke a key whenever you have reason to believe it is no longer trusted, no longer needed, or is being used by a system you want to disconnect. Typical cases:

* **Suspected leak**: a key appeared in a logged stack trace, a screenshot, or a public commit. Revoke first, then rotate downstream.
* **Decommissioning**: the integration or environment the key was created for is being retired.
* **Employee or vendor offboarding**: a person or third party who held the key no longer needs access.
* **Scheduled rotation**: your security policy requires periodic rotation, and the new key has already been deployed.

For a planned cutover, follow the [Key rotation](/docs/api-access/key-rotation) playbook: create a new key, deploy it everywhere, verify traffic on the new key, then revoke the old one. Skipping the verification step is the most common cause of an outage during rotation.

## Behavior

* Active calls already in progress are not interrupted; DialNexa terminates the session for the API key, not for in-flight call media.
* New requests with the revoked key immediately return `401 Unauthorized`.
* The key's audit trail (creation time, last-used time, revocation time) remains visible in [List API Keys](/docs/api-reference/api-keys/list).

## Path parameters

| Parameter | Description                                                                                              |
| --------- | -------------------------------------------------------------------------------------------------------- |
| `id`      | The API key ID, for example `abcgvvzzlrbnqy`. The ID is the short identifier, not the full secret value. |

## Errors

* `404 Not Found` is returned when the API key does not exist or has already been revoked.
* `403 Forbidden` is returned when the caller's key does not have permission to revoke other keys.

## Related endpoints

* [Create API Key](/docs/api-reference/api-keys/create): issue a replacement key before revoking the old one.
* [List API Keys](/docs/api-reference/api-keys/list): review which keys are active in your workspace.
* [Key rotation](/docs/api-access/key-rotation): recommended sequence for rotating keys with no downtime.


## OpenAPI

````yaml DELETE /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}:
    delete:
      tags:
        - API Keys
      summary: Delete an API key
      description: >-
        **Legacy endpoint - deprecated, scheduled for removal on July 31,
        2026.** Use the `/v1` version for new integrations. 
      operationId: ApiKeyController_deleteApiKey
      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
      responses:
        '200':
          description: API key deleted
          content:
            application/json:
              schema:
                example:
                  statusCode: 200
                  message: API key deleted successfully
                  data:
                    success: true
      deprecated: true
      security:
        - bearer: []
components:
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````