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

# Create a webhook



## OpenAPI

````yaml openapi.yaml post /webhooks
openapi: 3.1.0
info:
  title: Notch Pay API
  description: API for integrating payment and money transfer services into applications.
  version: 2.1.0
servers:
  - url: https://api.notchpay.co
    description: Production and Sandbox Environment
security: []
paths:
  /webhooks:
    post:
      summary: Create a webhook
      operationId: createWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  example: https://example.com/webhooks
                description:
                  type: string
                  example: Webhook principal
                events:
                  type: array
                  items:
                    type: string
                    enum:
                      - payment.created
                      - payment.complete
                      - payment.failed
                      - payment.canceled
                      - payment.expired
                      - transfer.created
                      - transfer.complete
                      - transfer.failed
                      - customer.created
                      - customer.updated
                      - customer.deleted
                      - customer.blocked
                      - customer.unblocked
              required:
                - url
                - events
      responses:
        '201':
          description: Webhook endpoint created
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 201
                  status:
                    type: string
                    example: Created
                  message:
                    type: string
                    example: Webhook endpoint created successfully
                  endpoint: 95bfe263-d0d1-4ac7-aeb2-eb0c154b1869
                required:
                  - code
                  - status
                  - message
                  - endpoint
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: b29a71d3-4f97-40ed-a676-731aa1fbe742
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: b29a71d3-4f97-40ed-a676-731aa1fbe742
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: b29a71d3-4f97-40ed-a676-731aa1fbe742
      security:
        - ApiKeyAuth: []
        - GrantAuth: []
        - SyncAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
    GrantAuth:
      type: apiKey
      in: header
      name: X-Grant
    SyncAuth:
      type: apiKey
      in: header
      name: X-Sync

````