Get template by id
Retrieve one template variant by its Meta id, the id every variant of a family has on its own
and the one the whatsapp.template.status_updated webhook carries.
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
Meta template id (numeric).
Query Parameters
WhatsApp social account ID
Response Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.whatsapp.getWhatsAppTemplateById({ path: { templateId: 'template_abc123', }, query: { accountId: 'account_abc123', },});console.log(data);{
"success": true,
"template": {
"id": "string",
"name": "string",
"status": "string",
"category": "string",
"language": "string",
"components": [
{}
],
"rejected_reason": "string",
"quality_score": {}
}
}{
"error": "string",
"type": "invalid_request_error",
"code": "string",
"param": "string",
"platform": "string",
"platformError": {},
"details": {}
}{
"error": "Unauthorized"
}Delete template by id DELETE
Delete one language variant by its Meta id. Other languages of the same name are untouched. The name cannot be reused for 30 days once its last variant is deleted.
Update template by id PATCH
Update one variant's components by its Meta id. Name, language and category cannot change. Meta only allows editing templates in `APPROVED`, `REJECTED` or `PAUSED` state; an approved template can be edited once per 24 hours and up to 10 times per 30 days. A successful update sends the variant back to Meta for review, so the `status` returned here is normally `PENDING`. The final outcome arrives on the `whatsapp.template.status_updated` webhook (which carries the variant's `templateId` and `language`). A variant already in `PENDING` cannot be edited again until Meta finishes reviewing it.