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

# Rotate Webhook Secret

> Generates a new webhook secret. The old secret remains valid for 24 hours to allow seamless migration.



## OpenAPI

````yaml POST /api/v1/mgt/workspaces/{workspaceId}/webhook-subscriptions/{subscriptionId}/rotate-secret
openapi: 3.1.0
info:
  title: Xenia Team API - Rotate Webhook Secret
  version: 1.0.0
  description: Rotate the webhook subscription secret with a 24-hour grace period.
servers:
  - url: https://api.xenia.team
security: []
paths:
  /api/v1/mgt/workspaces/{workspaceId}/webhook-subscriptions/{subscriptionId}/rotate-secret:
    post:
      tags:
        - Webhooks
      summary: Rotate Webhook Secret
      description: >-
        Generates a new webhook secret. The old secret remains valid for 24
        hours to allow seamless migration.
      parameters:
        - name: workspaceId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Workspace ID
        - name: subscriptionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Subscription ID
      responses:
        '200':
          description: Secret rotated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                  code:
                    type: integer
                  data:
                    type: object
                    properties:
                      secret:
                        type: string
                        description: New 64-character hex secret
                      previousSecretValidUntil:
                        type: string
                        format: date-time
                        description: When the old secret expires
              example:
                status: true
                code: 200
                data:
                  secret: >-
                    new_secret_64_character_hex_string_here_1234567890abcdef12345678
                  previousSecretValidUntil: '2024-12-24T10:00:00Z'
        '401':
          description: Unauthorized
        '404':
          description: Subscription not found
      security:
        - clientKey: []
          clientSecret: []
components:
  securitySchemes:
    clientKey:
      type: apiKey
      in: header
      name: x-client-key
    clientSecret:
      type: apiKey
      in: header
      name: x-client-secret

````