---
title: "Send SMS, MMS or WhatsApp to a Segment"
method: POST
path: "/orgunit/{orgunitId}/groups/{groupId}/messages/segment"
tags: ["Send"]
---

# Send SMS, MMS or WhatsApp to a Segment

`POST /orgunit/{orgunitId}/groups/{groupId}/messages/segment`

To send an SMS, MMS or WhatsApp to only few subscribers in a group, you can either upload a csv file through Upload file for segment API and attach the file url in segment API or pass subscriberNumbers in request body schema. If csv file url is attached,  then subscriberNumbers parameters will not be accepted and the message will be sent to only the subscribers in the file. If csv file url is not passed, then message will be sent to subscriberNumbers list.

Supports multi-channel delivery including SMS, MMS (requires pre-uploading media files to attach a valid 'mediaPath'),  and WhatsApp (requires an approved WhatsApp template layout).

## Path parameters

- `orgunitId` string, required
- `groupId` string, required

## Request body

- SegmentMessageRequest
  - `from` string — The sending entity identifier or group name displayed to the recipient in the message's start.
  - `message` string — The raw text payload to be delivered to subscribers. Leave empty or omit if you are utilizing a pre-configured template layout via 'templateId'.
  - `templateId` string, nullable — The unique identifier of a message template. When passed, the system will deliver the structured template message layout. For sending WHATSAPP broadcast, this field is mandatory.
  - `type` 'BroadcastMessage'
  - `mediaDetails` MediaDetails
    - `mediaPath` MediaPath[], nullable
      - `fileName` string
      - `extension` string
      - `fileSaveId` string
      - `mimetype` string
      - `url` string
  - `referenceId` string, nullable — An optional external tracking or transaction identifier used to correlate this transmission with your internal database records.
  - `subscriberNumbers` string[], nullable — An array of specific destination mobile phone numbers. Used to isolate delivery to individual subscribers instead of the entire group list.
  - `segmentSubscriberFileUrl` string, nullable — Url of csv file containing specific destination mobile phone numbers. Used to isolate delivery to individual subscribers instead of the entire group list.
  - `channelType` 'SMS' | 'MMS' | 'WHATSAPP' — Specifies the target communication network channel for delivery. Accepted values include SMS, MMS, or WHATSAPP.
  - `fallbackMessage` FallbackMessage
    - `from` string, nullable
    - `message` string
    - `channelType` string

## Response `201`

Success

- SegmentMessageResponseExternalApiResponseNew
  - `data` SegmentMessageResponse
    - `referenceId` string, nullable
  - `appCode` string, nullable
  - `message` string, nullable
  - `isError` boolean

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/ministrybytext/apis/pbt-api-documentation.md) · [All operations](https://skmtc.net/ministrybytext/apis/pbt-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ministrybytext/pbt-api-documentation/versions/ca6e9c8f430d/schema)
