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

# Regenerate API Key

> Regenerates a new API key for the current workspace.

Regenerate the current workspace API key. This immediately invalidates the previous key.

## Before calling

* Coordinate a deployment that updates every backend service using the old key.
* Confirm that no client-side code depends on the workspace key.
* Make sure the caller has permission to manage API keys.

## Rollout pattern

1. Regenerate the key from a secure admin backend or the dashboard.
2. Store the new key in your secret manager.
3. Redeploy services that call Ringg APIs.
4. Verify with `GET /workspace`.

<Warning>
  Do not regenerate the key from a browser-only integration. API keys are workspace secrets.
</Warning>


## OpenAPI

````yaml patch /workspace/api-key
openapi: 3.0.0
info:
  title: Ringg AI API Documentation
  description: >-
    This is the documentation for the Ringg AI APIs. The Ringg AI API follows
    RESTful principles, making it intuitive and easy to integrate with your
    applications. All API requests should be made to the base URL. The API
    accepts and returns data in JSON format. Ensure your requests include the
    appropriate Content-Type header for POST and PATCH requests.
  version: 2.0.0
servers:
  - url: https://prod-api.ringg.ai/ca/api/v0
security: []
tags:
  - name: workspace
    description: Endpoints for managing your workspace.
  - name: agent
    description: Endpoints for managing assistants (agents).
  - name: calling
    description: Endpoints for making and managing calls.
  - name: campaign
    description: Endpoints for managing campaigns.
  - name: analytics
    description: Endpoints for accessing call analytics and performance metrics.
  - name: termination
    description: Endpoints for terminating active calls using different methods.
  - name: knowledgebase
    description: Endpoints for managing knowledge bases.
paths:
  /workspace/api-key:
    patch:
      tags:
        - workspace
      summary: Regenerate API Key
      description: Regenerates a new API key for the current workspace.
      operationId: regenerateApiKey
      parameters:
        - name: X-API-KEY
          in: header
          description: (Required) Your current Ringg AI API key.
          required: true
          schema:
            type: string
            example: 7251cb4b-3373-43a4-844c-b27a1d45e0c9
      responses:
        '200':
          description: 'Successful Response: New API key generated.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  new_api_key:
                    type: string
                    example: e89b12d3-a456-426c-8001-f05de02b54b4
        '401':
          description: Unauthorized - Invalid or missing API key.
        '500':
          description: Internal Server Error - Something went wrong on our end.

````