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

# Fully replace a Partner webhook endpoint

> Fully replaces URL, nullable description, enabled state, and exact subscription set atomically. Replacing an endpoint never rotates its signing secret.



## OpenAPI

````yaml /openapi/openapi.json put /partner/webhooks/{webhook_id}
openapi: 3.1.0
info:
  title: Stabyl API
  description: >-
    REST API for approved Stabyl accounts to automate exchange, wallet, and
    non-production simulation workflows.
  contact:
    name: Stabyl Support
    email: support@stabyl.com
  license:
    name: Proprietary
  version: 1.0.0
servers:
  - url: https://api.stabyl.com/v1
    description: Production
  - url: https://api-staging.stabyl.com/v1
    description: Staging
security: []
tags:
  - name: Exchange
    description: Trading market data and order management for account automation.
  - name: Wallets
    description: >-
      Supported routes, deposit destinations, balances, transactions, and saved
      recipients.
  - name: Webhooks
    description: >-
      Outbound event delivery configuration and eventually consistent delivery
      history. Verify Standard Webhooks webhook-id, webhook-timestamp, and
      webhook-signature headers against the unchanged raw request body before
      parsing JSON.
  - name: Simulation
    description: Non-production endpoints for testing integration behavior.
paths:
  /partner/webhooks/{webhook_id}:
    put:
      tags:
        - Webhooks
      summary: Fully replace a Partner webhook endpoint
      description: >-
        Fully replaces URL, nullable description, enabled state, and exact
        subscription set atomically. Replacing an endpoint never rotates its
        signing secret.
      operationId: put_partner_webhooks_webhook_id
      parameters:
        - name: webhook_id
          in: path
          description: Webhook endpoint identifier
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplacePartnerWebhookRequest'
        required: true
      responses:
        '200':
          description: Endpoint replaced
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/PartnerWebhookEndpointResponse'
                  status:
                    type: string
                    enum:
                      - success
              example:
                data:
                  created_at: '2026-07-12T11:00:00Z'
                  description: Production event receiver
                  event_types:
                    - deposit.success
                    - withdrawal.success
                  id: 01980d95-5537-76aa-88a8-ad59117632ef
                  secret_version: 1
                  status: enabled
                  updated_at: '2026-07-12T11:00:00Z'
                  url: https://partner.example.com/stabyl/events
                status: success
        '400':
          description: Invalid topics or request
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        example: VALIDATION_FAILED
                      message:
                        type: string
                        example: invalid request parameters
                  status:
                    type: string
                    enum:
                      - error
              example:
                error:
                  code: VALIDATION_FAILED
                  message: invalid request parameters
                status: error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        example: UNAUTHORIZED
                      message:
                        type: string
                        example: missing X-Api-Key header
                  status:
                    type: string
                    enum:
                      - error
              example:
                error:
                  code: UNAUTHORIZED
                  message: missing X-Api-Key header
                status: error
        '403':
          description: Missing webhook or domain scope
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        example: MISSING_SCOPE
                      message:
                        type: string
                        example: missing_scope
                  status:
                    type: string
                    enum:
                      - error
              example:
                error:
                  code: MISSING_SCOPE
                  message: missing_scope
                status: error
        '404':
          description: Endpoint not found
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        example: NOT_FOUND
                      message:
                        type: string
                        example: resource not found
                  status:
                    type: string
                    enum:
                      - error
              example:
                error:
                  code: NOT_FOUND
                  message: resource not found
                status: error
        '409':
          description: Three enabled endpoints already exist
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        example: WEBHOOK_ACTIVE_LIMIT_REACHED
                      message:
                        type: string
                        example: webhook_active_limit_reached
                  status:
                    type: string
                    enum:
                      - error
              example:
                error:
                  code: WEBHOOK_ACTIVE_LIMIT_REACHED
                  message: webhook_active_limit_reached
                status: error
        '422':
          description: Destination URL rejected
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        example: UNPROCESSABLE_ENTITY
                      message:
                        type: string
                        example: webhook destination is not an allowed public HTTPS URL
                  status:
                    type: string
                    enum:
                      - error
              example:
                error:
                  code: UNPROCESSABLE_ENTITY
                  message: webhook destination is not an allowed public HTTPS URL
                status: error
        '503':
          description: Partner webhook mutation is disabled
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        example: PARTNER_WEBHOOKS_DISABLED
                      message:
                        type: string
                        example: partner_webhooks_disabled
                  status:
                    type: string
                    enum:
                      - error
              example:
                error:
                  code: PARTNER_WEBHOOKS_DISABLED
                  message: partner_webhooks_disabled
                status: error
      security:
        - api_key: []
components:
  schemas:
    ReplacePartnerWebhookRequest:
      type: object
      required:
        - url
        - enabled
        - event_types
      properties:
        description:
          type:
            - string
            - 'null'
        enabled:
          type: boolean
        event_types:
          type: array
          items:
            $ref: '#/components/schemas/PartnerWebhookEventType'
        url:
          type: string
      additionalProperties: false
    PartnerWebhookEndpointResponse:
      type: object
      required:
        - id
        - url
        - status
        - event_types
        - secret_version
        - created_at
        - updated_at
      properties:
        created_at:
          type: string
          format: date-time
        description:
          type:
            - string
            - 'null'
        event_types:
          type: array
          items:
            $ref: '#/components/schemas/PartnerWebhookEventType'
        id:
          type: string
          format: uuid
        secret_version:
          type: integer
          format: int32
        status:
          $ref: '#/components/schemas/PartnerWebhookEndpointStatus'
        updated_at:
          type: string
          format: date-time
        url:
          type: string
    PartnerWebhookEventType:
      type: string
      description: Exact Partner webhook topics supported by the V1 public contract.
      enum:
        - deposit.action_required
        - deposit.success
        - deposit.failed
        - withdrawal.success
        - withdrawal.failed
        - exchange.accepted
        - exchange.filled
        - exchange.replaced
        - exchange.cancelled
        - exchange.rejected
    PartnerWebhookEndpointStatus:
      type: string
      enum:
        - enabled
        - disabled
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        API credential. Withdrawal quote and submit operations additionally
        require the documented Ed25519 timestamp, nonce, and signature headers.
      x-default: sb_test_your_key

````