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

# Rotate an event destination bearer secret



## OpenAPI

````yaml https://api.prets.io/v1/openapi.json post /v1/events/destinations/{destinationId}/bearer-secret
openapi: 3.1.0
info:
  title: Prets API
  version: 1.0.0
servers:
  - url: https://api.prets.app
security:
  - bearerAuth: []
paths:
  /v1/events/destinations/{destinationId}/bearer-secret:
    post:
      summary: Rotate an event destination bearer secret
      parameters:
        - schema:
            type: string
            pattern: ^whk_[0-9A-HJKMNP-TV-Z]{26}$
          required: true
          name: destinationId
          in: path
      responses:
        '200':
          description: >-
            New bearer secret minted. Returned cleartext exactly once; the
            previous secret stops working immediately.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RotateBearerSecretResponse'
        '401':
          description: Unauthorized
        '404':
          description: Not found
      security:
        - bearerAuth: []
components:
  schemas:
    RotateBearerSecretResponse:
      type: object
      properties:
        destinationId:
          type: string
          pattern: ^whk_[0-9A-HJKMNP-TV-Z]{26}$
        bearerSecret:
          type: string
          pattern: ^whsec_[A-Za-z0-9_-]{43}$
          description: >-
            Bearer secret returned cleartext exactly once when minted. Sent on
            every delivery as `Authorization: Bearer {secret}`. Cannot be
            retrieved later.
          example: whsec_3XvK2nQ8mB7pR1sT4uW6yZ0aE5gH9jLcV2bN1xM4qP8
        rotatedAt:
          type: string
          format: date-time
      required:
        - destinationId
        - bearerSecret
        - rotatedAt
      x-stability: experimental
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````