Get a template
SDK platic.whatsapp.templates.get()
Read a template by name. Use language to choose its language; the response includes one version and the available languages.
Meta stores one version per name and language: order_update in es_MX and in en_US are two versions. You need an approved template to start a conversation outside the 24-hour window.
Example
curl https://api.platic.ai/v1/whatsapp/templates/$TEMPLATE_NAME \
-H "Authorization: Bearer $PLATIC_API_KEY" const template = await platic.whatsapp.templates.get("order_update"); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
name | string | Exact name of the template to get | ✓ |
Query parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
workspace | string | ID of the workspace to look in. Required if your credential covers several workspaces (list workspaces); without it the answer is 400. Its former name, workspaceId, is also accepted | If the credential has several |
language | string | The language version, such as es_MX. es-MX and es_mx are read the same | — |
wabaId | string | The WhatsApp Business account (WABA) to look in. Only needed if the same name exists in several | — |
Which version answers
- With
language, the version in that language. If it does not exist, the response is404 TEMPLATE_NOT_FOUNDwith available languages indetails.languages. - Without
languageand with a single version, that one. - Without
languageand with several, an approved one (APPROVED) before the others and, among equals, the lowest language code (en_USbeforeesbeforees_MX). The same query always answers the same version.
Send a template and campaigns pick the version with the same rule.
Response
data is the template, in the chosen version.
{
"status": "success",
"data": {
"name": "car_maintenance_reminder",
"category": "UTILITY",
"status": "APPROVED",
"language": "es",
"createdAt": "2025-07-20T10:12:34.567890123Z",
"updatedAt": "2025-07-28T16:45:01.234567890Z",
"content": "Hi {{1}}! A reminder of your maintenance appointment.",
"header": "Maintenance reminder",
"footer": "Reply CHANGE to reschedule",
"buttons": [
{
"type": "URL",
"text": "See location",
"url": "https://example.com/shop/location"
}
],
"params": ["Ana", "2025-08-18"],
"api_example": {
"name": "car_maintenance_reminder",
"params": ["Ana", "2025-08-18"]
},
"dynamicButtonsCount": 0,
"wabaId": "155512345678901",
"languages": ["en_US", "es"],
"workspaceId": "K7u9rQ2LmZx18BvC5tNd"
}
} | Field | Description |
|---|---|
name | Unique name of the template |
category | Category: UTILITY, MARKETING, AUTHENTICATION |
status | Status at Meta: APPROVED, PENDING, REJECTED, PAUSED or DISABLED. Only an APPROVED one can be sent |
language | Language code (e.g. es, en) |
content | Message body with variables {{1}}, {{2}}, etc. |
header | Message header (optional) |
footer | Message footer (optional) |
buttons | Array of interactive buttons |
params | Example values for the variables |
api_example | Example of use in the API |
dynamicButtonsCount | How many buttons need a value when sending |
wabaId | The WABA of this version |
languages | All the languages the template has in that WABA. Ask for another with ?language= |
workspaceId | The workspace where the template is |
templateNamespace | Only on MessageBird (legacy) workspaces: the namespace its templates are sent with |
Tip
Use the api_example field as a reference to build your requests to the /v1/messages/template endpoint.
Errors
| Status | details.code | When |
|---|---|---|
400 | INVALID_REQUEST | language or wabaId are not valid (details.issues says which). Also if your credential covers several workspaces and you did not send ?workspace=, if you sent one it does not cover (details.available has the IDs you can use), or if workspace and workspaceId name different workspaces |
401 | UNAUTHENTICATED | The credential is missing or not valid |
403 | FORBIDDEN | The person has no permission in Conversations or Campaigns. The message is Missing conversations or campaigns permission |
404 | WORKSPACE_NOT_FOUND | The workspace no longer exists |
404 | WABA_NOT_FOUND | The workspace has no connected WABA, or wabaId is not one of its WABAs. details.requested has the one you asked for and details.available the ones it has |
404 | TEMPLATE_NOT_FOUND | No template has that name, or it does not have that language. In the second case details.language has the one you asked for and details.languages the ones it has |
409 | WHATSAPP_TOKEN_INVALID, WHATSAPP_PERMISSION_DENIED, WHATSAPP_ACCOUNT_RESTRICTED | The template did not show up and a WABA of the workspace could not be read through its WhatsApp account. details.wabaErrors lists the ones that failed |
429 | RATE_LIMITED | Same, because WhatsApp is rate limiting requests for that WABA |
502 | UPSTREAM_ERROR | Same, because Platica could not reach WhatsApp |
503 | TEMPORARILY_UNAVAILABLE | Platica could not read the workspace or its WABAs. Try again in a moment |
A template found in one WABA is returned even if another WABA could not be read.
{
"code": 404,
"error": "Not Found - The resource doesn't exist",
"details": {
"code": "TEMPLATE_NOT_FOUND",
"message": "Template \"car_maintenance_reminder\" has no \"pt_BR\" version.",
"language": "pt_BR",
"languages": ["en_US", "es"]
}
} The general error format is in Errors.