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

# Rotate API Key Secret

> Rotate the secret for an API key.

Generates a new secret (password) for this API key.
Requires the `update:api_credentials` permission, available to users with a `member` or `owner` role in the organization that owns the application.

Returns:
    The API key with new secret and timestamp.

Security Note:
    The new API secret is only returned once and cannot be retrieved later.
    Store it securely immediately.



## OpenAPI

````yaml POST /api-keys/{api_key}/rotate-secret
openapi: 3.1.0
info:
  title: Unomiq Management API
  description: >-

    API for managing settings for organizations, applications and API keys.


    ## Authentication


    All API endpoints require authentication via JWT token in the Authorization
    header:


    ```

    Authorization: Bearer <your_jwt_token>

    ```
        
  version: 1.0.0
servers:
  - url: https://management-api.unomiq.com
    description: Production
security: []
paths:
  /api-keys/{api_key}/rotate-secret:
    post:
      tags:
        - api-keys
      summary: Rotate Api Key Secret
      description: >-
        Rotate the secret for an API key.


        Generates a new secret (password) for this API key.

        Requires the `update:api_credentials` permission, available to users
        with a `member` or `owner` role in the organization that owns the
        application.


        Returns:
            The API key with new secret and timestamp.

        Security Note:
            The new API secret is only returned once and cannot be retrieved later.
            Store it securely immediately.
      operationId: rotate_api_key_secret_api_keys__api_key__rotate_secret_post
      parameters:
        - name: api_key
          in: path
          required: true
          schema:
            type: string
            title: Api Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyRotateSecretResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ApiKeyRotateSecretResponse:
      properties:
        api_key:
          type: string
          title: Api Key
        api_secret:
          type: string
          title: Api Secret
        rotated_at:
          type: string
          title: Rotated At
      type: object
      required:
        - api_key
        - api_secret
        - rotated_at
      title: ApiKeyRotateSecretResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````