Skip to content
Preview: the PushFleet API isn't live yet. Join the waitlist

Templates

Template IDs are slugs you choose, such as order_shipped. A template takes the same fields as a send, and {{name}} placeholders in any field are filled from vars. Templates explains why they keep requests small.

PUT /v1/templates/{id}

Needs templates: write. Saving an existing ID replaces it.

await fleet.templates.put("order_shipped", {
  title: "Your order shipped",
  body: "Arriving {{eta}}",
});

GET /v1/templates/{id}

await fleet.templates.get("order_shipped");

DELETE /v1/templates/{id}

Sends that still name the template get 404 not_found.

await fleet.templates.delete("order_shipped");