Get Template by ID
GET /templates/:id
Section titled “GET /templates/: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.
HTTP Method
Section titled “HTTP Method”GETEndpoint
Section titled “Endpoint”/templates/:idQuery Parameters
Section titled “Query Parameters”| Name | Type | Required | Description |
|---|---|---|---|
| format | string | No | Optional. Set to html to return rendered HTML output. |
Headers
Section titled “Headers”| Header | Value | Required | Description |
|---|---|---|---|
| Authorization | Bearer YOUR_API_KEY | Yes | Your Maiilo API key. |
Example Request (cURL)
Section titled “Example Request (cURL)”curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://app.maiilo.io/api/v1/templates/10?format=html"Example Request (fetch)
Section titled “Example Request (fetch)”fetch('https://app.maiilo.io/api/v1/templates/10?format=html', { headers: { Authorization: 'Bearer YOUR_API_KEY', },});Response (200 OK)
Section titled “Response (200 OK)”{ "id": 10, "name": "Newsletter Template", "html": "<!DOCTYPE html>...", "updatedAt": "2025-10-01T12:00:00Z"}Errors
Section titled “Errors”| Code | Message | Description |
|---|---|---|
| 401 | Unauthorized | Missing or invalid API key. |
| 403 | Rate limit exceeded | Your quota has been exhausted. |
| 404 | Template not found | No template matches the given ID. |
| 500 | Internal server error | An 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.