---
title: "Add Account Template"
method: POST
path: "/accounts/{accountId}/templates"
tags: ["Account"]
---

# Add Account Template

`POST /accounts/{accountId}/templates`

## 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/accounts/{accountId}/templates`
- Auth: none declared
- TypeScript: <https://skmtc.dev/ministrybytext/apis/pbt-api-documentation/docs/accounts/:accountId/templates/post.ts> (a function with typed inputs; its response is checked against the schema)

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

You can create an account-level template that applies directly to newly 
created orgunits and groups.

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.

## Path parameters

- `accountId` 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.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)
