API overview and authentication
The Maiilo API lets your application fetch your email templates. It always returns a template’s published version: the exact HTML, subject and variables frozen when you last published, never the draft you are editing.
The API is read-only, and available on every plan.
What the API returns
Section titled “What the API returns”- The published version of a template, stored when you pressed Publish. The API does not render the template on request, so the same version returns the same bytes every time.
- Editing the draft or a shared block does not change the response. Only publishing does. See What the API and SendGrid serve.
- A template that has never been published returns
404with{"error":"template_not_published"}.
Base URL
Section titled “Base URL”https://app.maiilo.io/api/v1Endpoints:
GET https://app.maiilo.io/api/v1/templates/:idGET https://app.maiilo.io/api/v1/templates/:id?format=htmlGET https://app.maiilo.io/api/v1/templates/:id?format=variablesSee Get template by ID for the full reference.
Authentication
Section titled “Authentication”Every request needs an API key, sent as a bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEYCreate and delete keys on the API keys page in the app. Free includes 1 key and Pro includes 5.
A request with no key or an unknown key gets a 401. See Errors.
Sending the email
Section titled “Sending the email”Maiilo does not send email. A typical integration:
- Fetch the template from the API, or cache it and refresh it when you publish.
- Replace the
{{variables}}with your data.?format=variablestells you which variables a template expects. - Send the HTML and subject with your email provider, such as SendGrid, Amazon SES, Postmark or Resend.
If you send with SendGrid, you can skip the API: Maiilo can push the published version into SendGrid as a dynamic template, and tells you when SendGrid falls behind your latest publish (Pro). See SendGrid.
Limits
Section titled “Limits”Each plan includes a number of API requests per month: 100 on Free and 10,000 on Pro. See Limits and quotas.
Need help?
Section titled “Need help?”Email [email protected].