Templates
Write it once, send it from any number
Variables, media headers and buttons in one definition. Linked Devices numbers approve it at once; Cloud API numbers submit it to Meta.
- Template kinds, carousels included
- 4
- Buttons per template
- 10
- Characters in the body
- 1,024
- Header types, from text to location
- 5
Build
One definition for every route.
Write variables by name. Polymorfa checks the definition when you save it and converts it for each route when you send.
Approve
Approval that follows the number.
One submit call works for every number. Preview the result for each route before anything reaches a customer.
In your code
Templates from your own code.
Create, submit and send from the SDK, the CLI or plain HTTP. Campaigns use the same approved templates.
import { MessagingClient } from "@polymorfa/sdk";
const messaging = new MessagingClient({
credential: { type: "apiKey", value: apiKey },
});
const created = await messaging.templates.create("support", {
name: "order_shipped",
definition: {
version: 1,
kind: "standard",
category: "UTILITY",
language: "en_US",
body: "Hi {{name}}, order {{order_id}} has shipped.",
variables: [
{ name: "name", type: "text", example: "Marina" },
{ name: "order_id", type: "text", example: "#8412" },
],
},
});API surface
The Templates API.
Reads need templates:read and changes need templates:manage. The TypeScript SDK wraps every route below.
Project templates
- GET
/List the project's templatesmessaging/ projects/ {projectSlug}/ templates - POST
/Create a templatemessaging/ projects/ {projectSlug}/ templates - PATCH
/Update a draftmessaging/ projects/ {projectSlug}/ templates/ {id} - POST
/Render a previewmessaging/ projects/ {projectSlug}/ templates/ {id}/ preview - POST
/Submit for one numbermessaging/ projects/ {projectSlug}/ templates/ {id}/ submit
Platform drafts
- GET
/List drafts across the teamplatform/ templates - POST
/Create a draftplatform/ templates - PATCH
/Update a draftplatform/ templates/ {templateId}
Sending and events
- POST
/Send with content.templatemessaging/ {session}/ messages/ send - Event
template.statusMeta approved, rejected or rated a template
Start with a free number
Your first real number is free. Add more numbers on Pay-As-You-Go.