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

> ## Agent Instructions
> Flowsign is one word with a lowercase s.
> The REST API base URL is https://my.flowsign.app and every endpoint lives under /api/v1.
> When answering API questions, cite the HTTP method and endpoint path.
> API access needs the Enterprise plan and an API key with the API access permission.

# Rotate a webhook signing secret

> Replaces the endpoint's signing secret. The previous secret keeps verifying for 24 hours, so a receiver can switch without dropping deliveries; rotating again inside that window retires the older one at once. The new `secret` is returned exactly once. Requires canManageWebhooks.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/webhooks/{endpointId}/rotate-secret
openapi: 3.0.3
info:
  title: Flowsign API
  version: 1.0.0
  description: >-
    Public v1 API for Flowsign. Every endpoint is authenticated with a Bearer
    API key (prefix `fsk_`). Errors use `{ error, details? }`; success responses
    wrap payload data as `{ data }`.


    An organisation is divided into workspaces. A key is issued for one
    workspace and acts there on every request (see `GET /api/v1/workspaces`);
    `X-Workspace-Id` is optional and may only name that workspace. Packages,
    templates, contacts and members are scoped to the key's workspace.
servers:
  - url: https://my.flowsign.app
    description: Production
security:
  - ApiKey: []
paths:
  /api/v1/webhooks/{endpointId}/rotate-secret:
    post:
      tags:
        - Webhooks
      summary: Rotate a webhook signing secret
      description: >-
        Replaces the endpoint's signing secret. The previous secret keeps
        verifying for 24 hours, so a receiver can switch without dropping
        deliveries; rotating again inside that window retires the older one at
        once. The new `secret` is returned exactly once. Requires
        canManageWebhooks.
      operationId: postWebhooksByEndpointIdRotate-secret
      parameters:
        - schema:
            type: string
          required: true
          name: endpointId
          in: path
        - schema:
            type: string
            description: >-
              The workspace the key was issued for, as returned by `GET
              /api/v1/workspaces`. Optional: omitting it acts in the key's
              workspace, and any other id is rejected with 401.
          required: false
          name: x-workspace-id
          in: header
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Webhook endpoint id.
                        example: cmg1h7t2k0003v8p9d4q6xw2e
                      secret:
                        type: string
                        description: >-
                          The new signing secret, returned only in this
                          response: `whsec_` followed by 64 hex characters.
                        example: >-
                          whsec_4f7a1c9e2b8d6f3a5c0e7b9d1f4a6c8e2b5d7f9a1c3e5b7d9f1a3c5e7b9d1f3a
                      secretRotatingUntil:
                        type: string
                        description: >-
                          Until when the previous secret is still honoured (ISO
                          8601), 24 hours from now. Until then every delivery
                          carries a `v1=` signature for each secret,
                          comma-separated.
                        example: '2026-09-15T02:15:30.000Z'
                    required:
                      - id
                      - secret
                      - secretRotatingUntil
                required:
                  - data
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Caller's plan does not include this feature (publicApi / webhooks)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: API key present but caller lacks the required permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No webhook endpoint with that id in the caller's workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Request failed schema validation; details keyed by field
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded; see `Retry-After`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: What went wrong, in plain words.
          example: 'Missing permission: canSendPackages'
        details:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: >-
            Validation problems keyed by field path. Present only on 422
            responses.
          example:
            recipients.0.email:
              - Invalid email
      required:
        - error
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: fsk_*

````