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

# Regenerate API key

> Rotates THE API key for the calling scope — the product keeps ONE key per scope, not many. A number-scoped key rotates that number's default key; a tenant-scoped key rotates the tenant key. The old key is revoked and the new one (key field) is returned ONLY ONCE. Not available for per-number OAuth grants (403).



## OpenAPI

````yaml openapi.json POST /v1/api-keys/regenerate
openapi: 3.1.0
info:
  title: Pilot Status API
  version: 1.0.0
  license:
    name: Pilot Status Terms of Service
    url: https://pilotstatus.com.br/terms
  description: >-
    Public REST API for Pilot Status. Authenticate with the `x-api-key: ps_...`
    header (or `x-api-key-id`). Base URL: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/api-keys/regenerate:
    post:
      tags:
        - API Keys
      summary: Regenerate API key
      description: >-
        Rotates THE API key for the calling scope — the product keeps ONE key
        per scope, not many. A number-scoped key rotates that number's default
        key; a tenant-scoped key rotates the tenant key. The old key is revoked
        and the new one (key field) is returned ONLY ONCE. Not available for
        per-number OAuth grants (403).
      operationId: post_api-keys_regenerate
      responses:
        '201':
          description: Regenerate key
          content:
            application/json:
              example:
                id: key_03HZX...
                name: Default
                key: ps_THIS_IS_SHOWN_ONLY_ONCE
                keyPrefix: ps_abcd
                keyLast4: wxyz
                scope: number
                whatsappNumberId: num_01HZX...
                createdAt: '2026-06-28T10:00:00.000Z'
        '401':
          description: Missing or invalid `x-api-key` / `x-api-key-id` header
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Unauthorized
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Too many requests
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your ps_ API key
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: API key id (alternative to x-api-key)

````