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

# Rotate Webhook



## OpenAPI

````yaml put /v1/aggregators/{raast-aggregator-id}/webhooks/{webhook-id}/rotate
openapi: 3.1.0
info:
  title: Raast Wire
  version: 1.0.0
  description: ''
servers:
  - url: https://api.getsafepay.com/raastwire
security: []
tags:
  - name: Aggregators
  - name: Access Keys
  - name: Merchants
  - name: Raast Merchants
  - name: Payments
  - name: Refunds
  - name: QRs
  - name: Utilities
  - name: Aliases
  - name: Ledgers
  - name: Webhooks
paths:
  /v1/aggregators/{raast-aggregator-id}/webhooks/{webhook-id}/rotate:
    put:
      tags:
        - Webhooks
      summary: Rotate Webhook
      parameters:
        - $ref: '#/components/parameters/AggregatorIdParam'
        - $ref: '#/components/parameters/WebhookIdParam'
      responses:
        '200':
          $ref: '#/components/responses/RotateWebhookResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - apiKey: []
components:
  parameters:
    AggregatorIdParam:
      name: raast-aggregator-id
      in: path
      required: true
      schema:
        type: string
        example: agg_2288490a-2176-4de5-b373-0ffb6f8e2e6e
      description: The unique identifier for the aggregator
    WebhookIdParam:
      name: webhook-id
      in: path
      required: true
      schema:
        type: string
        example: wh_be2d4ee4-96b0-4104-92b2-95237fd3aa16
      description: The unique identifier for the webhook
  responses:
    RotateWebhookResponse:
      description: This response contains details of a Webhook
      headers:
        Content-Length:
          $ref: '#/components/headers/ContentLengthHeader'
        Date:
          $ref: '#/components/headers/DateHeader'
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/StandardResponse'
              - type: object
                properties:
                  data:
                    type: object
                    properties:
                      endpoint:
                        $ref: '#/components/schemas/Webhook'
                      secret:
                        type: string
                        description: The rotated webhook secret
                      rotated_at:
                        type: string
                        format: date-time
                        description: Timestamp when the secret was rotated
                    required:
                      - endpoint
                      - secret
                      - rotated_at
          examples:
            WebhookRotated:
              value:
                api_version: v1
                data:
                  endpoint:
                    token: wh_f52d84b4-a140-4a3a-b707-80644232e926
                    aggregator_id: agg_2288490a-2176-4de5-b373-0ffb6f8e2e6e
                    url: https://github.com/HasCold
                    description: this is the testing url
                    enabled: true
                    event_filter_json: '["payment.created","payment.authorized"]'
                    created_at: '2025-12-02T12:48:35Z'
                    updated_at: '2025-12-03T08:45:13.869665886Z'
                    secret: s3UvEYcNaKdLD0pOCEOjy0e6XMszyuj/DIFEJRwIkHA=
                    secret_version: 3
                    secret_rotated_at: '2025-12-03T08:45:13.867701713Z'
                  secret: s3UvEYcNaKdLD0pOCEOjy0e6XMszyuj/DIFEJRwIkHA=
                  rotated_at: '2025-12-03T08:45:13.867701713Z'
    BadRequest:
      description: Bad request
      headers:
        Content-Length:
          $ref: '#/components/headers/ContentLengthHeader'
        Date:
          $ref: '#/components/headers/DateHeader'
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ErrorResponse'
              - type: object
                properties:
                  code:
                    example: error.bad_request
                  message:
                    example: Invalid request parameters
  headers:
    ContentLengthHeader:
      schema:
        type: string
        example: '256'
    DateHeader:
      schema:
        type: string
        example: Sat, 12 Aug 2023 08:55:04 GMT
  schemas:
    StandardResponse:
      type: object
      description: Standard response structure for successful operations
      properties:
        api_version:
          type: string
          example: v1
          description: The current version of the API spec
        data:
          type: object
          description: Contains the response data
    Webhook:
      type: object
      properties:
        token:
          type: string
        aggregator_id:
          type: string
        url:
          type: string
        description:
          type: string
        enabled:
          type: boolean
        event_filter_json:
          type: string
        secret:
          type: string
          description: >-
            Base64-encoded signing secret (returned on create or rotate).
            Base64-decode it and use the bytes as the HMAC-SHA256 key when
            verifying webhook deliveries; see webhooks documentation for the
            signature algorithm.
        secret_version:
          type: integer
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        secret_rotated_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      description: Standard error response structure
      properties:
        code:
          type: string
          description: Error code identifying the type of error
        message:
          type: string
          description: Human-readable error message
  securitySchemes:
    apiKey:
      type: apiKey
      name: X-SFPY-AGGREGATOR-SECRET-KEY
      in: header

````