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

# Set Webhook

> Set Webhook for instance



## OpenAPI

````yaml openapi-whatsapp POST /webhook/set/{instance}
openapi: 3.0.3
info:
  title: l2msg API
  version: 2.1.1
servers:
  - url: https://api.l2msg.com/whatsapp
security: []
paths:
  /webhook/set/{instance}:
    post:
      tags:
        - Webhook Controller
      summary: Set Webhook
      description: Set Webhook for instance
      operationId: setWebhook
      parameters:
        - name: instance
          in: path
          required: true
          description: Name of the instance
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - webhook
              properties:
                webhook:
                  type: object
                  required:
                    - url
                    - events
                    - enabled
                    - webhookByEvents
                    - webhookBase64
                  description: Webhook
                  properties:
                    enabled:
                      type: boolean
                      description: enable webhook to instance
                    url:
                      type: string
                      description: Webhook URL
                    webhookByEvents:
                      type: boolean
                      description: Enables Webhook by events
                    webhookBase64:
                      type: boolean
                      description: Sends files in base64 when available
                    events:
                      type: array
                      minItems: 1
                      items:
                        type: string
                        enum:
                          - APPLICATION_STARTUP
                          - QRCODE_UPDATED
                          - MESSAGES_SET
                          - MESSAGES_UPSERT
                          - MESSAGES_UPDATE
                          - MESSAGES_DELETE
                          - SEND_MESSAGE
                          - CONTACTS_SET
                          - CONTACTS_UPSERT
                          - CONTACTS_UPDATE
                          - PRESENCE_UPDATE
                          - CHATS_SET
                          - CHATS_UPSERT
                          - CHATS_UPDATE
                          - CHATS_DELETE
                          - GROUPS_UPSERT
                          - GROUP_UPDATE
                          - GROUP_PARTICIPANTS_UPDATE
                          - CONNECTION_UPDATE
                          - CALL
                          - NEW_JWT_TOKEN
                          - TYPEBOT_START
                          - TYPEBOT_CHANGE_STATUS
                      description: Events to be sent to the Webhook
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  webhook:
                    type: object
                    properties:
                      instanceName:
                        type: string
                        description: The name of the instance.
                      webhook:
                        type: object
                        properties:
                          url:
                            type: string
                            description: The URL of the webhook.
                          events:
                            type: array
                            items:
                              type: string
                            description: List of events the webhook is subscribed to.
                          enabled:
                            type: boolean
                            description: Indicates whether the webhook is enabled.
                example:
                  webhook:
                    instanceName: teste-docs
                    webhook:
                      url: https://example.com
                      events:
                        - APPLICATION_STARTUP
                      enabled: true
      deprecated: false
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
      description: Your authorization key header

````