---
title: "Create a message template"
method: POST
path: "/api/profiles/{profile_id}/templates"
tags: ["WhatsApp"]
---

# Create a message template

`POST /api/profiles/{profile_id}/templates`

## Request

- Base URL: `https://api.postproxy.dev`
- URL: `https://api.postproxy.dev/api/profiles/{profile_id}/templates`
- Auth: HTTP bearer

Creates a custom template from components, or copies one of Meta’s pre-approved library templates. A custom template starts as PENDING; a library copy comes back APPROVED.

## Query parameters

- `profile_group_id` string

## Headers

- `Idempotency-Key` string

## Request body

- WhatsAppTemplateCreateRequest: Creates a custom template from components, or copies one of Meta’s pre-approved library templates.
  - `name` string, required: Lowercase letters, digits and underscores, starting with a letter. Unique per language on the account.
  - `category` 'UTILITY' | 'MARKETING' | 'AUTHENTICATION', required: Case-insensitive.
  - `language` string, required
  - `components` object[]: Required for a custom template. Meta’s component array; a component with variables needs an example for review.
  - `parameter_format` 'POSITIONAL' | 'NAMED': Defaults to POSITIONAL.
  - `message_send_ttl_seconds` integer: AUTHENTICATION 30–900, UTILITY 30–43200, MARKETING 43200–2592000. -1 keeps Meta’s default on AUTHENTICATION or UTILITY.
  - `library_template_name` string: Required to copy a Meta library template; components is then not needed. A library copy is approved immediately.
  - `library_template_body_inputs` object
  - `library_template_button_inputs` object[]

## Response `201`

The created template.

- WhatsAppTemplate: A WhatsApp message template on the connected WhatsApp Business Account.
  - `id` string: Postproxy hashid
  - `external_id` string, nullable: Meta’s template id
  - `profile_id` string
  - `name` string: Lowercase letters, digits and underscores, starting with a letter. With language it identifies the template on Meta.
  - `language` string: Meta language code, e.g. en_US, pt_BR, de
  - `category` 'UTILITY' | 'MARKETING' | 'AUTHENTICATION'
  - `status` 'APPROVED' | 'PENDING' | 'REJECTED' | 'PAUSED' | 'DISABLED' | 'IN_APPEAL' | 'PENDING_DELETION': Meta review status. Only APPROVED templates can be sent.
  - `parameter_format` 'POSITIONAL' | 'NAMED' | 'null', nullable
  - `components` object[]: Meta’s component array — HEADER, BODY, FOOTER, BUTTONS.
  - `message_send_ttl_seconds` integer: Time-to-live for undelivered sends, when the template overrides Meta’s default.
  - `rejected_reason` string: Present when Meta rejected the template.
  - `quality_score` object: Meta’s quality score once scored, e.g. { "score": "GREEN" }.
  - `variable_count` integer: How many variables a send of this template expects.
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `400`: Missing required parameters.
- `401`: Invalid, missing, or insufficient API key permissions.
- `404`: Resource does not exist or is not accessible.
- `422`: Validation failed.

---

[API](https://skmtc.dev/postproxy/apis/postproxy-social-media-api.md) - [All operations](https://skmtc.dev/postproxy/apis/postproxy-social-media-api/llms.txt) - [OpenAPI document](https://skmtc.dev/postproxy/apis/postproxy-social-media-api/revisions/d54482ac4ce7?raw)
