---
title: "Add Group Template"
method: POST
path: "/orgunit/{orgunitId}/groups/{groupId}/templates"
tags: ["Group"]
---

# Add Group Template

`POST /orgunit/{orgunitId}/groups/{groupId}/templates`

Templates are pre-saved messages that can be sent at any time simply by 
passing a `templateId` to the Message API. There are three types of templates for group:
- Text Templates: Used to send SMS.
- Media Templates: Used to send MMS.
- WhatsApp Templates: Used to send WhatsApp Message.

To create a Media Template, first call the 'Upload Media File' API in the 
send section, then pass the 'mediaDetails' object from that response into 
the template object.

To create WhatsApp Template refer to the article https://help.poweredbytext.com/s/article/Creating-and-Submitting-WhatsApp-Message-Templates

## Path parameters

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

## Request body

- AppTemplateRequestParams
  - `name` string, required — Template name can be alphanumeric characters along with special characters.
  - `message` string, required — This message will be sent to the subscriber when this template is used.
  - `mediaDetails` MediaDetails
    - `mediaPath` MediaPath[], nullable
      - `fileName` string
      - `extension` string
      - `fileSaveId` string
      - `mimetype` string
      - `url` string

## Response `200`

Success

- TemplateResponseExternalApiResponseNew
  - `data` TemplateResponse
    - `id` string
  - `appCode` string
  - `message` string
  - `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)
