Skip to content

What the API and SendGrid serve

Maiilo has two ways to deliver a template: your application fetches it through the API, or Maiilo pushes it to SendGrid. Both use the same thing: the template’s published version.

GET /api/v1/templates/:id returns the published version’s stored HTML, subject and variables. The API does not render the template when you call it, so:

  • Editing the draft does not change the response.
  • Editing a shared block does not change the response.
  • Every request for the same version returns the same bytes.
  • Only publishing changes the response.

A template that has never been published returns 404 with {"error":"template_not_published"}. See Get template by ID.

Push to SendGrid sends the published version’s HTML and subject into a SendGrid dynamic template, without rewriting your HTML.

Publishing a new version does not push it automatically. SendGrid keeps the version you last pushed, and Maiilo shows that it has fallen behind until you push again. See Keep SendGrid in sync.

ActionChanges the API response?Changes SendGrid?
Edit the draft (autosave)NoNo
Edit a shared blockNoNo
Restore an old versionNo (it only changes the draft)No
PublishYes, immediatelyNo, until you push
Push to SendGridNoYes

If the API rendered the draft on every request, a typo saved mid-edit or a change to a shared footer could reach customers without anyone deciding to ship it. Serving a frozen version means every change your customers see went through a deliberate publish, and the version history records it.