> ## 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.

# Create a Partner webhook endpoint

> Creates an owned HTTPS endpoint and returns its Standard Webhooks signing secret exactly once. Requires `webhooks:manage` and the matching `wallets:view` and/or `trades:view` scope for every subscribed event type.



## OpenAPI

````yaml /openapi/openapi.json post /partner/webhooks
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:
    post:
      tags:
        - Webhooks
      summary: Create a Partner webhook endpoint
      description: >-
        Creates an owned HTTPS endpoint and returns its Standard Webhooks
        signing secret exactly once. Requires `webhooks:manage` and the matching
        `wallets:view` and/or `trades:view` scope for every subscribed event
        type.
      operationId: post_partner_webhooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePartnerWebhookRequest'
        required: true
      responses:
        '200':
          description: Endpoint created; secret shown once
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/CreatePartnerWebhookResponse'
                  status:
                    type: string
                    enum:
                      - success
              example:
                data:
                  secret: whsec_<shown-once>
                  webhook:
                    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
        '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:
    CreatePartnerWebhookRequest:
      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
    CreatePartnerWebhookResponse:
      type: object
      required:
        - webhook
        - secret
      properties:
        secret:
          type: string
          description: Signing secret shown only in this create response.
          example: whsec_<shown-once>
        webhook:
          $ref: '#/components/schemas/PartnerWebhookEndpointResponse'
    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
    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
    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

````