# Create a Webhook

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/webhook_endpoints:
    post:
      summary: Create a Webhook
      deprecated: false
      description: A webhook endpoint must have a url and a list of enabled_events.
      tags:
        - API Reference/Webhooks
      parameters:
        - name: Accept
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              x-apifox-overrides: {}
              type: object
              x-apifox-refs:
                01GHRJMVWV5DCP3FG8AYV3W8J4: &ref_3
                  $ref: '#/components/schemas/Webhook'
                  x-apifox-overrides:
                    object: null
                    api_version: null
                    created: null
                    description: &ref_0
                      type: string
                      description: An optional description of what the webhook is used for.
                    secret: null
                    status: null
                    metadata: &ref_1
                      type: object
                      properties: {}
                      description: >-
                        Set of key-value pairs that you can attach to an
                        object. 
                      x-apifox-orders: []
                      x-apifox-ignore-properties: []
                    livemode: null
                    url: &ref_2
                      type: string
                      description: The URL of the webhook endpoint.
                    id: null
                  required:
                    - enabled_events
                    - url
              x-apifox-orders:
                - 01GHRJMVWV5DCP3FG8AYV3W8J4
              properties:
                description: *ref_0
                enabled_events:
                  type: array
                  items:
                    type: string
                  description: 'The list of events to enable for this endpoint. '
                metadata: *ref_1
                url: *ref_2
              required:
                - url
              x-apifox-ignore-properties:
                - description
                - enabled_events
                - metadata
                - url
            example:
              description: This is your description of the webhook
              enabled_events:
                - payment_intent.succeeded
                - payment_intent.payment_failed
                - charge.refund.updated
                - charge.dispute.updated
              url: https://your_call_back_address.com
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema: *ref_3
              example:
                id: we_1M3fqHHTdYyGj2Y6LeGVaamQ
                object: webhook_endpoint
                api_version: null
                created: 1668344601
                description: This is my webhook, I like it a lot
                enabled_events:
                  - payment_intent.succeeded
                  - payment_intent.payment_failed
                  - charge.refund.updated
                  - charge.dispute.updated
                livemode: false
                metadata: {}
                status: enabled
                url: https://example.com/my/webhook/endpoint
                secret: whsec_9rMfZUGWM3gTTBtn0f8kPEfmiIJCmzQi
          headers: {}
          x-apifox-name: OK
      security:
        - basic: []
      x-apifox-folder: API Reference/Webhooks
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/1296482/apis/api-42648310-run
components:
  schemas:
    Webhook:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object, like "we_xxxxx"
        object:
          type: string
          title: ''
          default: '"webhook_endpoint"'
          description: '**"webhook_endpoint"** '
        api_version:
          type: string
          description: The API version events are rendered as for this webhook endpoint.
        created:
          type: integer
          description: >-
            Time at which the object was created. Measured in seconds since the
            Unix epoch.
        description:
          type: string
          description: An optional description of what the webhook is used for.
        enabled_events:
          type: array
          items:
            type: string
          description: 'The list of events to enable for this endpoint. '
        livemode:
          type: boolean
          description: >-
            Has the value true if the object exists in live mode or the value
            false if the object exists in test mode.
        metadata:
          type: object
          properties: {}
          x-apifox-orders: []
          description: 'Set of key-value pairs that you can attach to an object. '
          x-apifox-ignore-properties: []
        status:
          type: string
          description: The status of the webhook. It can be enabled or disabled.
        secret:
          type: string
          description: >-
            The endpoint’s secret, used to generate webhook signatures. Only
            returned at creation.
        url:
          type: string
          description: The URL of the webhook endpoint.
      x-apifox-orders:
        - id
        - object
        - api_version
        - created
        - description
        - enabled_events
        - livemode
        - metadata
        - status
        - secret
        - url
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
  securitySchemes:
    basic:
      type: http
      scheme: basic
servers:
  - url: https://apitest.wooshpay.com
    description: 官网测试
security:
  - basic: []

```
