---
title: "Upload file for segment of subscribers of a group"
method: POST
path: "/orgunit/{orgunitId}/groups/{groupId}/messages/segment/file"
tags: ["Send"]
---

# Upload file for segment of subscribers of a group

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

## Request

- Base URL: `https://api-docs.ministrybytext.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api-docs.ministrybytext.com/orgunit/{orgunitId}/groups/{groupId}/messages/segment/file`
- Auth: none declared
- TypeScript: <https://skmtc.dev/ministrybytext/apis/pbt-api-documentation/docs/orgunit/:orgunitId/groups/:groupId/messages/segment/file/post.ts> (a function with typed inputs; its response is checked against the schema)

This function allows you to upload a CSV file which will have a set of subscribers whom the user wants to send message to. If the subscribers is not subscribed to the particular group, auto subscribe will be done. The response will include fileName, count(subscribers count) and the url of file.
    
Sample File:  https://gopbt.me/9e05qH

## Path parameters

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

## Request body `multipart/form-data`

- object
  - `file` string, binary

## Response `201`

Success

- SegmentFileUploadResponseExternalApiResponseNew
  - `data` SegmentFileUploadResponse
    - `fileName` string, nullable
    - `url` string, nullable
    - `count` integer
  - `appCode` string, nullable
  - `message` string, nullable
  - `isError` boolean

## Other responses

- `400`: Bad Request

---

[API](https://skmtc.dev/ministrybytext/apis/pbt-api-documentation.md) - [All operations](https://skmtc.dev/ministrybytext/apis/pbt-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/ministrybytext/apis/pbt-api-documentation/revisions/7d64a1f0b0c3?raw)
