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

# Rotate a signing secret

> Replaces the endpoint's signing secret and returns the new one. Needs the Business plan or above. An endpoint made by an integration (`source: subscription`) is not found here.

Every request is signed with the new secret and, for 24 hours, with the old one too, so a receiver can switch without dropping events. Rotating again inside that window replaces the older secret. Send `{ "immediate": true }` to stop the old secret at once, for example when it has leaked: requests signed with it no longer verify, so the receiver must switch immediately.

This operation and Create a webhook endpoint are the only ones whose responses contain a signing secret. The body may be left out.



## OpenAPI

````yaml /openapi.json post /v1/webhooks/{id}/rotate-secret
openapi: 3.1.0
info:
  title: Lora API
  version: 1.0.0
  description: >-
    Lora REST API for managing workspace shortcuts, folders, tags, webhook
    endpoints, and QR codes.


    ## Versioning

    All stable endpoints are prefixed with `/v1/`. Breaking changes ship under a
    new path prefix (for example `/v2/`).

    Non-breaking additions (new optional fields, new endpoints) may land in the
    current version.

    Deprecated endpoints are announced in the [developer
    docs](https://uselora.dev/essentials/versioning) before removal.


    ## Authentication

    Send `Authorization: Bearer <api_key>` on every request except `GET /v1/qr`,
    which also accepts anonymous callers. API keys are workspace-scoped and
    carry named scopes (for example `shortcuts.write`); each scoped operation's
    `security` requirement lists the one scope it needs (`GET /v1/qr` needs
    none), so request a key with only those.


    ## Errors

    4xx and 5xx responses use a typed JSON envelope: `{ error, code?, requestId,
    traceId?, fieldErrors?, required_scope?, current_plan?, required_capability?
    }`.

    See components `ErrorResponse`, `ErrorWithFieldErrors`,
    `PaymentRequiredError`, `ForbiddenError`, `PayloadTooLargeError`, and
    `InternalError`.


    ## Rate limits

    Successful responses include `RateLimit-Limit`, `RateLimit-Remaining`, and
    `RateLimit-Reset` (IETF RateLimit fields).

    429 responses include `Retry-After` (seconds). Authenticated callers are
    bucketed per API key; anonymous QR endpoints are bucketed per IP.


    ## Discovery

    - OpenAPI spec: `GET https://api.uselora.com/openapi.json` (also `GET
    https://api.uselora.com/`)

    - RFC 9727 catalog: `GET https://www.uselora.com/.well-known/api-catalog`

    - MCP manifest: `GET https://www.uselora.com/.well-known/mcp` (server card
    at `/.well-known/mcp/server-card.json`)

    - MCP Streamable HTTP endpoint: `POST https://api.uselora.com/mcp`
servers:
  - url: https://api.uselora.com
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/webhooks/{id}/rotate-secret:
    post:
      tags:
        - Webhooks
      summary: Rotate a signing secret
      description: >-
        Replaces the endpoint's signing secret and returns the new one. Needs
        the Business plan or above. An endpoint made by an integration (`source:
        subscription`) is not found here.


        Every request is signed with the new secret and, for 24 hours, with the
        old one too, so a receiver can switch without dropping events. Rotating
        again inside that window replaces the older secret. Send `{ "immediate":
        true }` to stop the old secret at once, for example when it has leaked:
        requests signed with it no longer verify, so the receiver must switch
        immediately.


        This operation and Create a webhook endpoint are the only ones whose
        responses contain a signing secret. The body may be left out.
      operationId: rotateWebhookSecret
      parameters:
        - description: The endpoint's unique ID, `wh_` and a UUID.
          in: path
          name: id
          required: true
          schema:
            example: wh_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f
            pattern: ^wh_[0-9a-f-]{36}$
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RotateWebhookSecretRequest'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RotatedWebhookSecret'
          description: The new signing secret.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithFieldErrors'
          description: The body failed validation or was not valid JSON.
          headers:
            X-Lora-Request-Id:
              description: >-
                Request correlation identifier. Matches the `requestId` field in
                the JSON error body.
              schema:
                type: string
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Missing, malformed, unknown or revoked API key. A key that was
            disabled by a downgrade answers with `apikey_disabled`.
          headers:
            X-Lora-Request-Id:
              description: >-
                Request correlation identifier. Matches the `requestId` field in
                the JSON error body.
              schema:
                type: string
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRequiredError'
          description: >-
            The workspace plan does not include webhooks
            (`plan_requires_upgrade`: Business and above).
          headers:
            X-Lora-Request-Id:
              description: >-
                Request correlation identifier. Matches the `requestId` field in
                the JSON error body.
              schema:
                type: string
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
          description: >-
            The key lacks the required scope (`insufficient_scope`, with
            `required_scope`), its owner is no longer an owner or admin of the
            workspace (`insufficient_role`), or its owner is no longer a member
            of the workspace (`no_permission`).
          headers:
            X-Lora-Request-Id:
              description: >-
                Request correlation identifier. Matches the `requestId` field in
                the JSON error body.
              schema:
                type: string
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Lora found no endpoint in this workspace.
          headers:
            X-Lora-Request-Id:
              description: >-
                Request correlation identifier. Matches the `requestId` field in
                the JSON error body.
              schema:
                type: string
        '413':
          description: >-
            The request body exceeded the size limit. The body is rejected
            before being parsed, so no partial write occurred; retrying with a
            smaller payload will succeed.
          headers:
            X-Lora-Request-Id:
              description: >-
                Request correlation identifier. Matches the `requestId` field in
                the JSON error body.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayloadTooLargeError'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Rate limit exceeded. Wait `Retry-After` seconds before retrying.
          headers:
            Retry-After:
              description: Seconds until the rate-limit window resets.
              schema:
                type: integer
                minimum: 1
            X-Lora-Request-Id:
              description: >-
                Request correlation identifier. Matches the `requestId` field in
                the JSON error body.
              schema:
                type: string
        '500':
          description: >-
            An unexpected failure on the server. The body is `{ error:
            <message>, code: "internal_error", requestId: <id> }`, plus
            `traceId` when available. Retry idempotent operations with
            exponential backoff. A write may already have applied; reconcile its
            state before retrying.
          headers:
            X-Lora-Request-Id:
              description: >-
                Request correlation identifier. Matches the `requestId` field in
                the JSON error body.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
      security:
        - bearerAuth:
            - webhooks.write
components:
  schemas:
    RotateWebhookSecretRequest:
      type: object
      properties:
        immediate:
          default: false
          description: >-
            Stop the old secret at once instead of after 24 hours. Use it when
            the old secret is compromised: requests signed with it no longer
            verify, so the receiver must switch immediately.
          type: boolean
      additionalProperties: false
      description: Options for rotating a signing secret. The body may be left out.
    RotatedWebhookSecret:
      type: object
      properties:
        id:
          type: string
          pattern: ^wh_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          description: The endpoint's unique ID.
          examples:
            - wh_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f
        previousSecretExpiresAt:
          description: >-
            When the replaced secret stops signing, ISO 8601: 24 hours from now,
            or null for an immediate rotation. Rotating again before then
            replaces the older secret.
          type:
            - string
            - 'null'
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
        secret:
          type: string
          description: >-
            The signing secret, `whsec_` and base64. Shown here once and never
            again: store it now. Verify requests with it using any Standard
            Webhooks library.
          examples:
            - whsec_your_signing_secret
      required:
        - id
        - previousSecretExpiresAt
        - secret
      additionalProperties: false
      description: >-
        The new signing secret. Every request signs with the new secret, and
        with the old one too until `previousSecretExpiresAt`.
    ErrorWithFieldErrors:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
        fieldErrors:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            type: array
            items:
              type: string
        requestId:
          type: string
          description: >-
            Correlation identifier for support/debugging. Equals the
            `X-Lora-Request-Id` response header.
        traceId:
          description: >-
            Trace identifier when available for this request. 32-character
            lowercase hex string.
          type: string
          pattern: ^[0-9a-f]{32}$
      required:
        - error
        - requestId
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
        requestId:
          type: string
          description: >-
            Correlation identifier for support/debugging. Equals the
            `X-Lora-Request-Id` response header.
        traceId:
          description: >-
            Trace identifier when available for this request. 32-character
            lowercase hex string.
          type: string
          pattern: ^[0-9a-f]{32}$
      required:
        - error
        - requestId
      additionalProperties: false
    PaymentRequiredError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          enum:
            - plan_requires_upgrade
            - quota_exceeded
        requestId:
          type: string
          description: >-
            Correlation identifier for support/debugging. Equals the
            `X-Lora-Request-Id` response header.
        traceId:
          description: >-
            Trace identifier when available for this request. 32-character
            lowercase hex string.
          type: string
          pattern: ^[0-9a-f]{32}$
        current_plan:
          description: The workspace plan when the response includes it.
          type: string
        required_capability:
          description: The required plan capability when the response includes it.
          type: string
      required:
        - error
        - code
        - requestId
      additionalProperties: false
    ForbiddenError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
        requestId:
          type: string
          description: >-
            Correlation identifier for support/debugging. Equals the
            `X-Lora-Request-Id` response header.
        traceId:
          description: >-
            Trace identifier when available for this request. 32-character
            lowercase hex string.
          type: string
          pattern: ^[0-9a-f]{32}$
        required_scope:
          description: >-
            Set when `code` is `insufficient_scope`. The exact scope name the
            route required, e.g. `shortcuts.write`.
          type: string
      required:
        - error
        - requestId
      additionalProperties: false
    PayloadTooLargeError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          const: payload_too_large
        requestId:
          type: string
          description: >-
            Correlation identifier for support/debugging. Equals the
            `X-Lora-Request-Id` response header.
        traceId:
          description: >-
            Trace identifier when available for this request. 32-character
            lowercase hex string.
          type: string
          pattern: ^[0-9a-f]{32}$
      required:
        - error
        - code
        - requestId
      additionalProperties: false
    InternalError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          const: internal_error
        requestId:
          type: string
          description: >-
            Correlation identifier for support/debugging. Equals the
            `X-Lora-Request-Id` response header.
        traceId:
          description: >-
            Trace identifier when available for this request. 32-character
            lowercase hex string.
          type: string
          pattern: ^[0-9a-f]{32}$
      required:
        - error
        - code
        - requestId
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key (`lora_sk_…`) sent as `Authorization: Bearer
        <api_key>`. Each scoped operation names the scope it requires in its
        `security` requirement, for example `shortcuts.write`; a key without it
        receives `403` with `code: insufficient_scope`. `GET /v1/qr` also
        accepts anonymous requests and requires no scope.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.