> ## Documentation Index
> Fetch the complete documentation index at: https://botsify.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create WhatsApp Template — POST /api/v1/media-block/create

> Create a new WhatsApp message template in Botsify for Meta review and approval. Optionally specify a template type using the typed endpoint variant.

Use this endpoint to create a new WhatsApp message template inside your Botsify account. Once created, the template can be submitted to Meta for approval and, once approved, used in broadcast campaigns. You can optionally provide a template type by appending it to the URL path. A legacy endpoint is also available for simpler use cases where only a template string is required. All variants require a Bearer token for authentication.

<Note>
  WhatsApp templates must be pre-approved by Meta before they can be used in broadcasts. Creating a template in Botsify initiates or updates the record on your account, but delivery to end users is only possible after Meta grants approval.
</Note>

## Endpoints

| Method | URL | Notes |
| - | - | - |
| `POST` | `https://app.botsify.com/api/v1/media-block/create` | Standard template creation |
| `POST` | `https://app.botsify.com/api/v1/media-block/create/{type}` | Typed template creation |
| `POST` | `https://app.botsify.com/api/v1/whatsapp/create-template` | Legacy endpoint |

## Path Parameters

<ParamField path="type" type="string">
  An optional template type specifier appended to the URL (e.g., `/api/v1/media-block/create/text`). Use this when your workflow requires distinguishing templates by type at the routing level.
</ParamField>

## Request Body (Legacy Endpoint)

<ParamField body="template" type="string" required>
  The template content string. Required when using the legacy endpoint `POST /api/v1/whatsapp/create-template`.
</ParamField>

## Example Request — Standard Endpoint

```bash theme={null}
curl --request POST \
  --url https://app.botsify.com/api/v1/media-block/create \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "order_update",
    "language": "en_US",
    "body": "Hi {{1}}, your order {{2}} is on its way!"
  }'
```

## Example Request — Typed Endpoint

```bash theme={null}
curl --request POST \
  --url https://app.botsify.com/api/v1/media-block/create/text \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "shipping_notice",
    "language": "en_US",
    "body": "Your shipment has been dispatched. Track it here: {{1}}"
  }'
```

## Example Request — Legacy Endpoint

```bash theme={null}
curl --request POST \
  --url https://app.botsify.com/api/v1/whatsapp/create-template \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "template": "Hello {{1}}, thank you for contacting us!"
  }'
```

## Response

A successful request returns a JSON object confirming the template was created, including the assigned template ID and current approval status. Newly created templates will typically show a `pending` status until Meta completes their review.

```json theme={null}
{
  "success": true,
  "template": {
    "id": "tpl_009",
    "name": "order_update",
    "status": "pending",
    "language": "en_US"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.