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

# Give an endpoint a new signing secret

> Needs the crypto:webhooks:manage scope. The new secret is in the answer once. The old secret keeps working for 24 hours, and during that time each webhook carries two signatures, so you can switch over without missing one.




## OpenAPI

````yaml /openapi.yaml post /v1/webhooks/endpoints/{id}/rotate-secret
openapi: 3.1.0
info:
  title: Taramiz Crypto API (live gateway)
  version: 0.1.0
  description: >
    Generate crypto deposit addresses. Draft: describes the endpoint built so
    far. Must be kept in step with the gateway by hand until it is generated.
servers:
  - url: http://127.0.0.1:44010
    description: Local development (task dev)
security:
  - bearerAuth: []
paths:
  /v1/webhooks/endpoints/{id}/rotate-secret:
    post:
      summary: Give an endpoint a new signing secret
      description: >
        Needs the crypto:webhooks:manage scope. The new secret is in the answer
        once. The old secret keeps working for 24 hours, and during that time
        each webhook carries two signatures, so you can switch over without
        missing one.
      operationId: rotateWebhookSecret
      parameters:
        - $ref: '#/components/parameters/EndpointId'
      responses:
        '200':
          description: The endpoint, with its new secret.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointWithSecret'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  parameters:
    EndpointId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    WebhookEndpointWithSecret:
      allOf:
        - $ref: '#/components/schemas/WebhookEndpoint'
        - type: object
          required:
            - secret
          properties:
            secret:
              type: string
              description: The signing secret (whsec_...). Shown only in this answer.
    WebhookEndpoint:
      type: object
      required:
        - id
        - environment
        - url
        - description
        - status
        - secret_prefix
        - previous_secret_expires_at
        - created_at
      properties:
        id:
          type: string
          format: uuid
        environment:
          type: string
          enum:
            - live
            - sandbox
            - test
        url:
          type: string
        description:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - active
            - disabled
        secret_prefix:
          type: string
          description: The first characters of the current secret, to tell secrets apart.
        previous_secret_expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            While a rotation settles, the previous secret also works until this
            time.
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable code.
              enum:
                - invalid_request
                - unauthorized
                - product_not_enabled
                - insufficient_scope
                - idempotency_conflict
                - request_in_progress
                - payload_too_large
                - not_found
                - service_unavailable
                - internal_error
            message:
              type: string
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        product_not_enabled, or insufficient_scope (the key lacks the scope this
        call needs).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: No such endpoint (including one that belongs to another account).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: Temporarily unavailable. Try again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API key, sent as `Authorization: Bearer <key>`.'

````

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