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

const template = await platic.whatsapp.templates.get("order_update");

Path parameters

ParameterTypeDescriptionRequired
namestringExact name of the template to get✓

Query parameters

ParameterTypeDescriptionRequired
workspacestringID 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 acceptedIf the credential has several
languagestringThe language version, such as es_MX. es-MX and es_mx are read the same—
wabaIdstringThe 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 is 404 TEMPLATE_NOT_FOUND with available languages in details.languages.
  • Without language and with a single version, that one.
  • Without language and with several, an approved one (APPROVED) before the others and, among equals, the lowest language code (en_US before es before es_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"
  }
}
FieldDescription
nameUnique name of the template
categoryCategory: UTILITY, MARKETING, AUTHENTICATION
statusStatus at Meta: APPROVED, PENDING, REJECTED, PAUSED or DISABLED. Only an APPROVED one can be sent
languageLanguage code (e.g. es, en)
contentMessage body with variables {{1}}, {{2}}, etc.
headerMessage header (optional)
footerMessage footer (optional)
buttonsArray of interactive buttons
paramsExample values for the variables
api_exampleExample of use in the API
dynamicButtonsCountHow many buttons need a value when sending
wabaIdThe WABA of this version
languagesAll the languages the template has in that WABA. Ask for another with ?language=
workspaceIdThe workspace where the template is
templateNamespaceOnly on MessageBird (legacy) workspaces: the namespace its templates are sent with

Errors

Statusdetails.codeWhen
400INVALID_REQUESTlanguage 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
401UNAUTHENTICATEDThe credential is missing or not valid
403FORBIDDENThe person has no permission in Conversations or Campaigns. The message is Missing conversations or campaigns permission
404WORKSPACE_NOT_FOUNDThe workspace no longer exists
404WABA_NOT_FOUNDThe 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
404TEMPLATE_NOT_FOUNDNo 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
409WHATSAPP_TOKEN_INVALID, WHATSAPP_PERMISSION_DENIED, WHATSAPP_ACCOUNT_RESTRICTEDThe 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
429RATE_LIMITEDSame, because WhatsApp is rate limiting requests for that WABA
502UPSTREAM_ERRORSame, because Platica could not reach WhatsApp
503TEMPORARILY_UNAVAILABLEPlatica 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.