Publish Template

Publish a template. Publishing generates a new version, marks the template as published, and sets has_unpublished_versions to false.

POST/templates/{template_id}/publish

Requires a full_access API key.

Path Parameters

template_idstringrequired

The template ID (UUID) or alias string.

Response Fields

idstring

The template ID.

objectstring

Always "template".

curl -X POST 'https://api.postflare.app/templates/e5f6a7b8-c9d0-1234-efab-345678901234/publish' \
  -H 'Authorization: Bearer re_xxxxxxxxx'
const response = await fetch(
  'https://api.postflare.app/templates/welcome-email/publish',
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer re_xxxxxxxxx',
    },
  }
);

const data = await response.json();

Response

Response
{
  "id": "e5f6a7b8-c9d0-1234-efab-345678901234",
  "object": "template"
}