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

# Create a new webhook endpoint

> Creates a new webhook endpoint. Events define which notifications are sent to the URL. Use instance_id to scope to a specific instance.



## OpenAPI

````yaml openapi.json post /api/webhooks
openapi: 3.0.0
info:
  title: Wappfy API
  description: >-
    WhatsApp API Platform — Manage instances, send messages, and build
    integrations.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.wappfy.io
    description: Production
security: []
tags:
  - name: Instances
    description: Create, connect, and manage WhatsApp instances (WAHA or Cloud API)
  - name: Messages
    description: >-
      Send messages via WhatsApp (text, media, location, poll, contacts, and
      more)
  - name: Chats
    description: List chats, read messages, mark as seen, and manage typing indicators
  - name: Groups
    description: Create and manage WhatsApp groups, participants, and invite links
  - name: Contacts
    description: Look up contacts, check phone numbers, and fetch profile pictures
  - name: Labels
    description: Organize chats with WhatsApp Business labels
  - name: Channels
    description: Create and manage WhatsApp Channels (newsletters)
  - name: Status
    description: Publish text status/stories
  - name: Presence
    description: Set and get online/offline presence
  - name: Webhooks
    description: Configure webhook endpoints to receive real-time event notifications
  - name: Admin
    description: >-
      Platform administration — user management, statistics, and proxy
      monitoring (admin only)
paths:
  /api/webhooks:
    post:
      tags:
        - Webhooks
      summary: Create a new webhook endpoint
      description: >-
        Creates a new webhook endpoint. Events define which notifications are
        sent to the URL. Use instance_id to scope to a specific instance.
      operationId: WebhooksController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookDto'
      responses:
        '201':
          description: Webhook endpoint created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointResponseDto'
        '401':
          description: Missing or invalid authentication token
        '403':
          description: Insufficient permissions
        '500':
          description: Internal server error
      security:
        - bearer: []
components:
  schemas:
    CreateWebhookDto:
      type: object
      properties:
        url:
          type: string
          example: https://example.com/webhook
        secret:
          type: string
          description: HMAC secret for verifying webhook signatures
        events:
          type: array
          example:
            - message.received
            - message.sent
          items:
            type: string
            enum:
              - message.received
              - message.sent
              - message.delivered
              - message.read
              - message.failed
              - message.reaction
              - instance.connected
              - instance.disconnected
              - instance.qr
              - contact.created
              - group.joined
              - group.left
        description:
          type: string
        instance_id:
          type: string
          description: Scope to a specific instance. NULL = global (all instances).
        headers:
          type: object
          description: Custom HTTP headers sent with each delivery
          additionalProperties: true
          example:
            X-Custom: value
        retry_count:
          type: number
          default: 3
        timeout_ms:
          type: number
          default: 5000
      required:
        - url
        - events
    WebhookEndpointResponseDto:
      type: object
      properties:
        id:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
          description: Webhook endpoint UUID
        user_id:
          type: string
          description: Owner user ID
        url:
          type: string
          example: https://example.com/webhook
          description: Destination URL
        events:
          example:
            - message.received
            - message.sent
          description: Subscribed event types
          type: array
          items:
            type: string
        secret:
          type: string
          description: HMAC secret for signature verification
        description:
          type: string
          example: Production webhook
          description: Human-readable description
        instance_id:
          type: string
          description: Scoped instance ID (null = all instances)
        headers:
          type: object
          description: Custom HTTP headers sent with each delivery
        retry_count:
          type: number
          example: 3
          description: Max retry attempts on failure
        timeout_ms:
          type: number
          example: 5000
          description: Request timeout in milliseconds
        is_active:
          type: boolean
          example: true
          description: Whether the endpoint is active
        created_at:
          type: string
          description: Creation timestamp
        updated_at:
          type: string
          description: Last update timestamp
      required:
        - id
        - user_id
        - url
        - events
        - retry_count
        - timeout_ms
        - is_active
        - created_at
        - updated_at
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````