WhatsApp

Create a message template

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.

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

Query parameters

profile_group_idstring

Profile group context for the request. Optional when the API key is scoped to a profile group (that group is used automatically); with a full-access key, defaults to the first profile group in the account.

Headers

Idempotency-Keystring

Optional idempotency key (up to 255 characters; a UUID is ideal). Retrying a successful write with the same key replays the original response (with an Idempotent-Replay: true header) instead of executing again. Stored responses are kept for 24 hours; only 2xx responses are stored.

Request body

namestring required

Lowercase letters, digits and underscores, starting with a letter. Unique per language on the account.

category'UTILITY' | 'MARKETING' | 'AUTHENTICATION' required

Case-insensitive.

languagestring required
componentsobject[]

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_secondsinteger

AUTHENTICATION 30–900, UTILITY 30–43200, MARKETING 43200–2592000. -1 keeps Meta’s default on AUTHENTICATION or UTILITY.

library_template_namestring

Required to copy a Meta library template; components is then not needed. A library copy is approved immediately.

library_template_body_inputsobject
library_template_button_inputsobject[]

Response

The created template.

idstring

Postproxy hashid

external_idstring nullable

Meta’s template id

profile_idstring
namestring

Lowercase letters, digits and underscores, starting with a letter. With language it identifies the template on Meta.

languagestring

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
componentsobject[]

Meta’s component array — HEADER, BODY, FOOTER, BUTTONS.

message_send_ttl_secondsinteger

Time-to-live for undelivered sends, when the template overrides Meta’s default.

rejected_reasonstring

Present when Meta rejected the template.

quality_scoreobject

Meta’s quality score once scored, e.g. { "score": "GREEN" }.

variable_countinteger

How many variables a send of this template expects.

created_atstring date-time
updated_atstring date-time

Changes

No recorded changes to this operation across all 1 revision of this API.