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

# Create Webhook

> Add a webhook to a SMS instance with its API token, so your app or an automation tool can register its own URL.

Add a webhook to this instance from code. It's the same webhook you can create in the dashboard: Hypersender sends the events you choose to the URL, with the [same payloads](https://docs.hypersender.com/v2/api-reference/sms-webhooks/sms-webhooks-introduction.md).

Tools such as the n8n Hypersender Trigger use this to register their URL when a workflow is turned on, and [delete it](https://docs.hypersender.com/v2/api-reference/sms/webhooks/delete-webhook.md) when it's turned off.

* `events` takes one or more event names, for example `message.phone.received`. Events this instance type doesn't send are rejected.
* Set `authorization_secret` to a long random value. Hypersender sends it unchanged in the `Authorization` header, so your endpoint can reject requests that don't have it. It's stored encrypted, and no endpoint returns it.
* Each webhook counts toward your plan's webhook limit. Over the limit, you get a `403` with the reason.


## OpenAPI

````yaml v2/api-reference/sms/sms-collection.json POST /{instance}/webhooks
openapi: 3.1.0
info:
  title: Hypersender SMS API Docs
  version: v1.0
  description: >-
    Send and receive SMS through your own Android phone and SIM card with the
    Hypersender SMS API.


    **Base URL**: `https://app.hypersender.com/api/sms/v1/{instance}`. Replace
    `{instance}` with the Instance ID from the dashboard.


    **Authentication**: send the instance API Key as a Bearer token in the
    `Authorization` header.


    **The Android app**: install Hypersender SMS from [Google
    Play](https://play.google.com/store/apps/details?id=com.hypersender.app&hl=en)
    and link it to your instance. See the [SMS quick
    start](https://docs.hypersender.com/v2/hypersender/overview/sms/sms-quick-start).


    **Quick demo**: [Send an SMS in
    Postman](https://docs.hypersender.com/v2/api-reference/sms/how-to-send-an-sms-message-in-postman).
servers:
  - url: https://app.hypersender.com/api/sms/v1
    description: Production
security:
  - Authorization: []
paths:
  /{instance}/webhooks:
    post:
      tags:
        - Webhooks
      summary: Create Webhook
      description: Add a webhook to this instance. Counts toward your plan's webhook limit.
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
          example: application/json
        - name: instance
          in: path
          description: Instance ID from the Hypersender dashboard.
          required: true
          schema:
            type: string
            example: '{{ instance_id }}'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
                - events
              properties:
                url:
                  type: string
                  maxLength: 255
                  description: Where Hypersender sends the events.
                  example: https://example.com/hypersender
                events:
                  type: array
                  minItems: 1
                  items:
                    type: string
                    enum:
                      - message.phone.received
                      - message.phone.sent
                      - message.phone.delivered
                      - message.send.failed
                      - message.send.expired
                      - message.notification.scheduled
                      - message.notification.failed
                      - message.phone.ussd
                      - phone.heartbeat.received
                      - phone.heartbeat.online
                      - phone.heartbeat.offline
                      - phone.heartbeat.missed
                      - phone.heartbeat.disabled
                      - phone.logout
                  description: Events to send to this URL.
                  example:
                    - message.phone.received
                name:
                  type: string
                  maxLength: 100
                  description: >-
                    A name to recognise the webhook in the dashboard. Default
                    `API webhook`.
                  example: n8n
                authorization_secret:
                  type: string
                  maxLength: 512
                  description: >-
                    Sent unchanged in the `Authorization` header of every
                    webhook, so your endpoint can reject requests that are not
                    from Hypersender. Stored encrypted and never returned.
                  example: a-long-random-secret
      responses:
        '201':
          description: The webhook was created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 42
                      name:
                        type: string
                        example: n8n
                      url:
                        type: string
                        example: https://example.com/hypersender
                      events:
                        type: array
                        items:
                          type: string
                          enum:
                            - message.phone.received
                            - message.phone.sent
                            - message.phone.delivered
                            - message.send.failed
                            - message.send.expired
                            - message.notification.scheduled
                            - message.notification.failed
                            - message.phone.ussd
                            - phone.heartbeat.received
                            - phone.heartbeat.online
                            - phone.heartbeat.offline
                            - phone.heartbeat.missed
                            - phone.heartbeat.disabled
                            - phone.logout
                        example:
                          - message.phone.received
                      enabled:
                        type: boolean
                        example: true
                      has_authorization_secret:
                        type: boolean
                        example: true
                        description: >-
                          Whether an Authorization Secret is set. The secret
                          itself is never returned.
                      created_at:
                        type: string
                        format: date-time
                        example: '2026-11-27T18:00:00+00:00'
        '401':
          description: The Bearer token is missing, invalid, or expired.
          content:
            application/json:
              example:
                message: >-
                  The Bearer token is not valid please check the token and try
                  again.
        '403':
          description: >-
            The token belongs to another instance, or the instance is of another
            type.
          content:
            application/json:
              example:
                message: The Bearer token does not have access to this instance.
        '422':
          description: >-
            A field is missing or not valid, such as an event this instance type
            doesn't send.
          content:
            application/json:
              example:
                message: The selected events.0 is invalid.
components:
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.