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

# Create webhook subscription

> Create a new webhook subscription for events



## OpenAPI

````yaml POST /webhooks/subscriptions
openapi: 3.0.3
info:
  title: NativeMessage API
  version: 1.0.0
  description: Complete API documentation for NativeMessage platform
  contact:
    name: NativeMessage Support
    email: support@nativemessage.com
servers:
  - url: https://api-message.nativehub.live/api/v1
    description: Production server
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /webhooks/subscriptions:
    post:
      tags:
        - Webhooks
      summary: Create webhook subscription
      description: Create a new webhook subscription for events
      operationId: createWebhookSubscription
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
                - events
              properties:
                url:
                  type: string
                  format: uri
                events:
                  type: array
                  items:
                    type: string
                secret:
                  type: string
              example:
                url: https://api.example.com/webhooks/sms
                events:
                  - message.delivered
                  - message.failed
                secret: whsec_abc123xyz789
      responses:
        '201':
          description: Webhook subscription created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSubscription'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    WebhookSubscription:
      type: object
      properties:
        id:
          type: string
          format: uuid
        tenant_id:
          type: string
          format: uuid
        url:
          type: string
          format: uri
        events:
          type: array
          items:
            type: string
        secret:
          type: string
        status:
          type: string
        created_at:
          type: string
          format: date-time
      example:
        id: c5d6e7f8-a9b0-1234-cd56-789012345678
        tenant_id: c3d4e5f6-a7b8-9012-cdef-123456789012
        url: https://api.example.com/webhooks/sms
        events:
          - message.delivered
          - message.failed
        secret: whsec_abc123xyz789
        status: active
        created_at: '2026-02-01T12:00:00Z'
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      example:
        error: Invalid request parameters
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````