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

> Send a notification using a template.

# Send a notification using a template



## OpenAPI

````yaml post /notifications/messages
openapi: 3.0.0
info:
  title: Campaigns Service API
  description: Campaigns Service REST API
  version: '1.0'
  contact: {}
servers:
  - url: https://{appId}.api-{region}.cometchat.io/v3/campaigns
    variables:
      appId:
        default: appId
        description: (Required) App ID
      region:
        enum:
          - us
          - eu
          - in
        default: us
        description: Select Region
security:
  - apikey: []
tags:
  - name: Notification Feed
    description: Operations on the per-user in-app notification feed.
  - name: Channels
    description: Manage channel instances and per-type availability.
  - name: Templates
    description: Manage templates and their versions.
  - name: Template Categories
    description: Manage template categories for feed filtering.
  - name: Campaigns
    description: Create, schedule, and manage notification campaigns.
  - name: Notifications
    description: Send notifications directly via API.
  - name: Push Notifications
    description: Manage push notification delivery and engagement.
  - name: Analytics
    description: Delivery and engagement analytics.
paths:
  /notifications/messages:
    post:
      tags:
        - Notifications
      summary: Send a notification using a template
      description: >-
        Sendbird-equivalent POST /notifications/messages. 1–10 receivers =
        realtime (synchronous, returns notificationId). 11–10,000 receivers =
        inline batch (asynchronous, returns batchId). Larger sends should use
        the Campaigns CSV flow.
      operationId: NotificationSendController_send
      parameters:
        - name: appid
          in: header
          description: Tenant application ID
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendNotificationDto'
      responses:
        '200':
          description: >-
            Realtime: { notificationId, channels[], mode: "realtime" }. Batch: {
            batchId, total, channels[], mode: "batch" }.
        '400':
          description: >-
            Template not found, template not approved, or recipient count
            exceeds limits
        '403':
          description: Admin-only — onbehalfof header must not be present
components:
  schemas:
    SendNotificationDto:
      type: object
      properties:
        templateId:
          type: string
          description: >-
            Template CUID or templateId slug. Template must be in approved
            status.
          example: order_update
        receivers:
          description: >-
            Array of target user IDs. 1–10 = realtime (synchronous, returns
            notificationId immediately). 11–10,000 = batch (asynchronous,
            returns batchId; processing happens via queue).
          minItems: 1
          maxItems: 10000
          type: array
          items:
            type: string
        variables:
          type: object
          description: >-
            Per-user variables. Keyed by userId; values are { variableName:
            value } objects. Variables are applied to the template content at
            delivery time.
          example:
            user_42:
              user_name: John
              order_id: '12345'
            user_43:
              user_name: Sarah
              order_id: '12346'
        tag:
          type: string
          description: >-
            Optional analytics tag attached to the send (passes through to
            delivery records).
      required:
        - templateId
        - receivers
  securitySchemes:
    apikey:
      type: apiKey
      in: header
      name: apikey
      description: Your CometChat REST API Key.

````