Appearance
Email Templates
SendAPI provides a built-in template engine for rendering dynamic HTML emails. Templates use standard variable interpolation syntax (e.g., ) and can be managed programmatically.
List Templates
Retrieve all email templates stored in the project.
GET /v1/email/templates
Response
json
{
"data": [
{
"id": 1,
"name": "Welcome Email",
"subject": "Welcome to SendAPI, {{ name }}!",
"created_at": "2026-03-09T14:30:00.000000Z",
"updated_at": "2026-03-10T09:15:00.000000Z"
}
]
}Create a Template
Store a new reusable HTML template.
POST /v1/email/templates
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Internal reference name for the template. |
subject | string | Yes | Default subject line (supports variables). |
html_content | string | Yes | The raw HTML structure of your email. Use for dynamic data injection. |
bash
curl -X POST https://sendapi.co/v1/email/templates \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Password Reset",
"subject": "Reset your password",
"html_content": "<html><body>Hi {{ name }}, <a href=\"{{ reset_url }}\">Click here to reset</a>.</body></html>"
}'Get a Template
Retrieve the full details of a specific template, including its html_content.
GET /v1/email/templates/{id}
Update a Template
Update the contents of an existing template.
PUT /v1/email/templates/{id}
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Internal reference name for the template. |
subject | string | No | Default subject line (supports variables). |
html_content | string | No | The raw HTML structure of your email. |
Delete a Template
DELETE /v1/email/templates/{id}
Immediate Effect
Deleting a template is immediate. Any active API integrations calling /v1/email/send using this template ID will instantly fail with a 404 Not Found error.