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

# Criar Webhook

> Configura um novo webhook



## OpenAPI

````yaml openapi-v2.json post /webhooks
openapi: 3.0.0
info:
  title: Wapizap API v2 - Native
  description: >-
    API v2 nativa Wapizap com arquitetura RESTful moderna. Inclui 60 endpoints
    para gerenciamento completo de integrações WhatsApp, incluindo instâncias,
    mensagens, chats, grupos, contatos, webhooks e downloads.
  version: 2.0.0
  contact:
    name: Wapizap Support
    url: https://wapizap.com/support
servers:
  - url: https://api.wapizap.com/api/v2
    description: Produção
  - url: http://localhost:3000/api/v2
    description: Desenvolvimento
security:
  - BearerAuth: []
tags:
  - name: Instances
    description: Gerenciamento de instâncias WhatsApp
  - name: Messages
    description: Envio e gerenciamento de mensagens
  - name: Chats
    description: Gerenciamento de chats e conversas
  - name: Contacts
    description: Gerenciamento de contatos
  - name: Groups
    description: Gerenciamento de grupos
  - name: Webhooks
    description: Configuração de webhooks
  - name: Downloads
    description: Download de mídias
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Criar Webhook
      description: Configura um novo webhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - instanceId
                - url
                - events
              properties:
                instanceId:
                  type: string
                  format: uuid
                url:
                  type: string
                  format: uri
                  example: https://seusite.com/webhook
                events:
                  type: array
                  items:
                    type: string
                    enum:
                      - messages.upsert
                      - messages.update
                      - messages.delete
                      - message.send
                      - contacts.upsert
                      - contacts.update
                      - presence.update
                      - groups.upsert
                      - groups.update
                      - groups.participants.update
                  example:
                    - messages.upsert
                    - messages.update
                headers:
                  type: object
                  description: Headers customizados
                secret:
                  type: string
                  description: Segredo para verificar assinatura
                retryOnFailure:
                  type: boolean
                  default: true
      responses:
        '201':
          description: Webhook criado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
components:
  schemas:
    Webhook:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
          format: uri
        events:
          type: array
          items:
            type: string
        headers:
          type: object
        secret:
          type: string
        retryOnFailure:
          type: boolean
        isActive:
          type: boolean
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````