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

# Rotate the webhook signing secret

> Replaces the secret. For the next 24 hours every webhook carries two signatures, one per secret, so you can switch your receiver without missing an event.




## OpenAPI

````yaml openapi/tool-api.yaml POST /api/tool-webhooks/secret/rotate
openapi: 3.1.0
info:
  title: Connie Tool API
  version: 1.0.0
  description: >
    Run supported tools in your Connie workspace from your own code: find a
    tool, read its inputs and price, run it, and get the result back in the
    response, by polling, or by webhook. Requests use a workspace API key
    (`sk_…`) and the workspace's credits. See
    https://docs.connie.ai/developers/tool-api.
servers:
  - url: https://conigma-tool-server-production.up.railway.app
security:
  - bearerKey: []
tags:
  - name: Tools
    description: Find a tool and read its exact inputs, availability and price.
  - name: Operations
    description: Run a tool, and read the outcome of a run.
  - name: Webhooks
    description: The secret that signs completion webhooks.
paths:
  /api/tool-webhooks/secret/rotate:
    post:
      tags:
        - Webhooks
      summary: Rotate the webhook signing secret
      description: >
        Replaces the secret. For the next 24 hours every webhook carries two
        signatures, one per secret, so you can switch your receiver without
        missing an event.
      operationId: rotateWebhookSecret
      responses:
        '200':
          description: The new secret, and until when the old one still signs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSecret'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          description: >-
            `rotation_conflict`: another request rotated the secret at the same
            moment. Read it again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    WebhookSecret:
      type: object
      required:
        - secret
      properties:
        secret:
          type: string
          example: whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw
        previousSecretValidUntil:
          type: string
          format: date-time
          description: After a rotation, until when the previous secret still signs.
    Operation:
      type: object
      required:
        - status
        - ok
      properties:
        invocationId:
          type: string
          format: uuid
          description: The operation's id. Keep it.
        toolId:
          type: string
        status:
          type: string
          enum:
            - completed
            - in_progress
            - not_executed
            - unknown_outcome
          description: >
            `completed`: the tool ran (`ok` says whether it succeeded).
            `in_progress`: still running. `not_executed`: nothing ran and
            nothing was charged. `unknown_outcome`: the tool may have run; do
            not run it again automatically.
        ok:
          type: boolean
        result:
          description: The tool's output, when `ok` is true and it is under 1 MiB.
        resultRef:
          type: object
          description: >-
            Present instead of `result` when the output is over 1 MiB. Fetch it
            with `?result=full`.
          properties:
            invocationId:
              type: string
              format: uuid
        error:
          $ref: '#/components/schemas/Error'
        billing:
          $ref: '#/components/schemas/BillingReceipt'
        replayed:
          type: boolean
          description: >-
            `true` when this answer repeats an earlier request with the same
            key.
        chargedThisRequest:
          type: number
          description: Credits charged by this request; 0 on a replay.
        recovery:
          type: object
          description: >-
            For media generation only: how to recover the result of an
            `unknown_outcome`.
          properties:
            toolId:
              type: string
              enum:
                - get-generation
            input:
              type: object
              properties:
                recoveryId:
                  type: string
    Error:
      type: object
      required:
        - code
        - message
        - retryable
      properties:
        code:
          type: string
          description: Stable, for your code. See Errors and limits for the list.
          example: insufficient_credits
        message:
          type: string
          description: Written for a person; safe to show as is.
        retryable:
          type: boolean
          description: >-
            `true`: sending the same request again (same key) may succeed.
            `false`: stop automatic retries and follow the message. Check this
            field even for HTTP 503 with Retry-After.
    BillingReceipt:
      type: object
      required:
        - chargedCredits
        - items
      properties:
        chargedCredits:
          type: number
          description: Credits this call cost in all.
        items:
          type: array
          items:
            $ref: '#/components/schemas/BillingItem'
        lowBalance:
          type: object
          properties:
            balance:
              type: number
            message:
              type: string
            nextStep:
              type: string
            url:
              type: string
    BillingItem:
      type: object
      required:
        - toolId
        - summary
        - chargedCredits
        - status
      properties:
        toolId:
          type: string
        summary:
          type: string
        chargedCredits:
          type: number
        status:
          type: string
          enum:
            - charged
            - not_charged
            - refunded
        externalBilling:
          type: string
          enum:
            - may_apply
          description: Present when a connected app may also bill you on its own side.
        heldCredits:
          type: number
          description: >-
            Credits held for a job that has not settled yet; the unused part is
            returned.
  responses:
    Unauthorized:
      description: >-
        The API key is missing, invalid, revoked or expired
        (`authentication_required`), or the credential is not an explicit
        workspace or scoped API key (`api_key_required`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Operation'
    Forbidden:
      description: >
        The key can't do this: `permission_required` (the key lacks `tools:read`
        or `tools:execute`), `tool_disabled`, `unsupported_context`,
        `execution_identity_required`, `connection_required`, `tool_forbidden`
        (access changed), or `tool_internal` (requires an internal context).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Operation'
    RateLimited:
      description: >
        `rate_limited`: too many requests, or too many operations running or
        started this minute. Nothing ran. Wait for `Retry-After` and send the
        same request again.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Operation'
    Unavailable:
      description: >
        Check `error.retryable` before retrying. Temporary failures include
        `server_restarting`, `admission_unavailable`, `service_unavailable`,
        `webhooks_unavailable`, `billing_unavailable`, `not_started`,
        `media_model_unavailable` and `schema_unavailable`. When
        `error.retryable` is true, send the same request again with the same key
        after `Retry-After`. `feature_unavailable` (new operations disabled for
        this workspace) and `invalid_schema` (unsupported tool input schema)
        have `error.retryable: false`, even if Retry-After is present. Stop
        automatic retries and contact support or the tool's editor respectively.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Operation'
  headers:
    RetryAfter:
      description: Seconds to wait before asking again.
      schema:
        type: integer
  securitySchemes:
    bearerKey:
      type: http
      scheme: bearer
      description: >
        A workspace API key from Settings → Developers → API keys, sent as
        `Authorization: Bearer sk_…` (or `X-API-Key: sk_…`). It acts as one
        workspace member and uses the workspace's credits.

````

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