- List email templates GET
- Create an email template POST
- Retrieve an email template GET
- Update an email template PATCH
- Delete an email template DELETE
- Retrieve a template's draft GET
- Update a template's draft PUT
- Publish a template's draft POST
- Render a template POST
- List a template's versions GET
- Retrieve a template version GET
- Restore a template version POST
Render a template
Renders the draft (or a published version) with variables, exactly as a send would, and returns the subject, HTML and text: a preview, nothing is sent or stored. Without variables it renders the version's sample_variables.
bearerAuthAuthorizationBearer <token>A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.
id*stringThe template's id or alias.
Coss-Version?"2026-10-10"The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.
"2026-10-10"application/json- body
- body
- …
What to render: nothing is sent or stored.
version?integerA published version to render. Default: the draft.
1 <= valuelocale?stringThe locale to render, e.g. "pt-BR". Falls back to the language ("pt"), then to the default locale, as sends do.
length <= 35variables?Values by variable name, checked as a send checks them. Default: sample_variables.
The rendered template.
application/json- response
- response
- …
object*"email_template_render""email_template_render"template_id*stringversion*|The version rendered; null for the draft.
locale*stringThe locale rendered.
subject*stringhtml*string|nulltext*string|nullimport { Coss } from "coss";const coss = new Coss({ apiKey: process.env.COSS_API_KEY, baseUrl: "https://api.coss.com",});const { data, error } = await coss.email.templates.render("etpl_01k7c8m4q2f3e9v6t5r1n0p8yz", { locale: "en", variables: { first_name: "Ada", },});{ "object": "email_template_render", "template_id": "etpl_01k7c8m4q2f3e9v6t5r1n0p8yz", "version": null, "locale": "en", "subject": "Welcome, Ada", "html": "<p>Hi Ada, thanks for signing up!</p>", "text": null}