Call it
curl https://api.peume.com/v1/call/whatsapp-create-template \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"accountId": "your accountId",
"name": "your name",
"category": "AUTHENTICATION",
"language": "your language"
}
}'const res = await fetch("https://api.peume.com/v1/call/whatsapp-create-template", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"accountId": "your accountId",
"name": "your name",
"category": "AUTHENTICATION",
"language": "your language"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/whatsapp-create-template",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"accountId": "your accountId",
"name": "your name",
"category": "AUTHENTICATION",
"language": "your language"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: whatsapp-create-template.
Parameters
accountIdRequiredstringWhatsApp account ID
nameRequiredstringTemplate name (lowercase, letters/numbers/underscores, must start with a letter)
categoryRequiredstringTemplate category
AUTHENTICATION · MARKETING · UTILITY
languageRequiredstringTemplate language code (e.g., en_US)
parameter_formatstringVariable style: POSITIONAL ({{1}}, the default) or NAMED ({{customer_name}}). Named templates provide examples via body_text_named_params / header_text_named_params. Inferred as NAMED when omitted but a named-params example is present.
POSITIONAL · NAMED · positional · named
componentsarrayTemplate components (header, body, footer, buttons, carousel, limited_time_offer). Required for custom templates, omit when using library_template_name.
library_template_namestringName of a pre-built template from Meta's template library (e.g., "appointment_reminder", "auto_pay_reminder_1", "address_update"). When provided, the template is pre-approved by Meta with no review wait. Omit components when using this field.
library_template_body_inputsobjectOptional body customizations for library templates. Available options depend on the template (e.g., add_contact_number, add_learn_more_link, add_security_recommendation, add_track_package_link, code_expiration_minutes).
library_template_button_inputsarrayOptional button customizations for library templates. Each item specifies button type and configuration (e.g., URL, phone number, quick reply).
message_send_ttl_secondsintegerDelivery validity window in seconds: a message not delivered within it is dropped. Range by category: - AUTHENTICATION: 30 to 900. - UTILITY: 30 to 43200 (12h). - MARKETING: 43200 to 2592000 (30 days). -1 (create only) keeps the 30-day default on AUTHENTICATION and UTILITY. Meta defaults to 600 for AUTHENTICATION and 30 days otherwise. If Meta later recategorises the template, it clears the TTL (read it back to check).
