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

# Rotate the signing secret for an outbound webhook endpoint



## OpenAPI

````yaml /openapi.json post /webhooks/{id}/rotate-secret
openapi: 3.1.0
info:
  title: AgentRef REST API
  version: 1.0.0
  description: >-
    REST API v1 for merchants and affiliates. Authentication via API keys
    (Authorization: Bearer ak_...).
servers:
  - url: /api/v1
    description: Current API version
security:
  - ApiKeyAuth: []
tags:
  - name: Auth
  - name: Onboarding
  - name: Programs
  - name: Merchant
  - name: Applications
  - name: Affiliates
  - name: Me
  - name: Coupons
  - name: Invites
  - name: Conversions
  - name: Payouts
  - name: Flags
  - name: Billing
  - name: Marketplace
  - name: Marketing Resources
  - name: Notifications
  - name: Webhooks
  - name: Docs
  - name: Meta
paths:
  /webhooks/{id}/rotate-secret:
    post:
      tags:
        - Webhooks
      summary: Rotate the signing secret for an outbound webhook endpoint
      operationId: rotateWebhookEndpointSecret
      parameters:
        - $ref: '#/components/parameters/UuidPathId'
      responses:
        '200':
          description: Webhook secret rotated
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WebhookSecretResponse'
                  meta:
                    $ref: '#/components/schemas/RequestMeta'
                required:
                  - data
                  - meta
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    UuidPathId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    WebhookSecretResponse:
      type: object
      properties:
        endpoint:
          $ref: '#/components/schemas/WebhookEndpoint'
        signingSecret:
          type: string
      required:
        - endpoint
        - signingSecret
    RequestMeta:
      type: object
      properties:
        requestId:
          type: string
      required:
        - requestId
    WebhookEndpoint:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        url:
          type: string
          format: uri
        status:
          type: string
          enum:
            - active
            - disabled
        programId:
          type:
            - string
            - 'null'
          format: uuid
        schemaVersion:
          type: integer
          enum:
            - 2
          default: 2
        subscribedEvents:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEventType'
        secretLastFour:
          type:
            - string
            - 'null'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        disabledAt:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - name
        - url
        - status
        - programId
        - schemaVersion
        - subscribedEvents
        - secretLastFour
        - createdAt
        - updatedAt
        - disabledAt
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - message
        meta:
          $ref: '#/components/schemas/RequestMeta'
      required:
        - error
        - meta
    WebhookEventType:
      type: string
      enum:
        - program.created
        - program.updated
        - affiliate.joined
        - affiliate.approved
        - affiliate.blocked
        - affiliate.unblocked
        - conversion.created
        - conversion.refunded
        - payout.created
        - payout.processing
        - payout.completed
        - payout.failed
        - flag.resolved
  responses:
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use API key as Bearer token, for example: Bearer ak_live_xxx'

````