Builders Program

Build with us for a whole month. Unlimited usage and add-ons, weekly calls and your own Slack channel.

Learn more
Polymorfa

Command Palette

Search for a command to run...

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.

Named variables. Text, number, currency and date variables, each with a sample. Cloud API numbers receive Meta's numbered placeholders.
Headers and buttons. A text, image, video, document or location header. Quick replies, links, phone, copy code and Flow buttons.
Four kinds. Standard, carousel, authentication and limited-time offer, in the Marketing, Utility and Authentication categories.

Approve

Approval that follows the number.

One submit call works for every number. Preview the result for each route before anything reaches a customer.

Submit per number. Linked Devices numbers return Approved without review. Cloud API numbers return Pending until Meta decides.
Status as events. Meta's decision and later quality changes arrive on your webhooks as template.status.Cloud API
Preview each route. See the message as Cloud API, Linked Devices or Sandbox renders it 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.

templates.ts
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/messaging/projects/{projectSlug}/templatesList the project's templates
  • POST/messaging/projects/{projectSlug}/templatesCreate a template
  • PATCH/messaging/projects/{projectSlug}/templates/{id}Update a draft
  • POST/messaging/projects/{projectSlug}/templates/{id}/previewRender a preview
  • POST/messaging/projects/{projectSlug}/templates/{id}/submitSubmit for one number

Platform drafts

  • GET/platform/templatesList drafts across the team
  • POST/platform/templatesCreate a draft
  • PATCH/platform/templates/{templateId}Update a draft

Sending and events

  • POST/messaging/{session}/messages/sendSend with content.template
  • Eventtemplate.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.