Skip to content

Get Template by ID

Fetch a rendered HTML version of a specific email template by its ID. This endpoint is read-only and useful for rendering and exporting stored templates programmatically.

GET
/templates/:id
NameTypeRequiredDescription
formatstringNoOptional. Set to html to return rendered HTML output.
HeaderValueRequiredDescription
AuthorizationBearer YOUR_API_KEYYesYour Maiilo API key.
Terminal window
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://app.maiilo.io/api/v1/templates/10?format=html"
fetch('https://app.maiilo.io/api/v1/templates/10?format=html', {
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
{
"id": 10,
"name": "Newsletter Template",
"html": "<!DOCTYPE html>...",
"updatedAt": "2025-10-01T12:00:00Z"
}
CodeMessageDescription
401UnauthorizedMissing or invalid API key.
403Rate limit exceededYour quota has been exhausted.
404Template not foundNo template matches the given ID.
500Internal server errorAn unexpected error occurred.
  • Ensure your API key is kept secure and not exposed in public frontend code.
  • Rate limits are based on your active plan (Free or Pro).
  • This endpoint is read-only. Editing or creating templates via API is not yet available.