API Reference
Templates API
Endpoints for listing and retrieving email templates.
Read-Only API
Templates are created and managed in the ArtaMail dashboard. The API provides read-only access to view available templates.
GET
/api/v1/templatesGet all templates available for your organization.
Example Request
Terminal
curl https://artamail.artatol.com/api/v1/templates \ -H "Authorization: Bearer am_live_sk_xxx"Response
json
[ { "id": "template-uuid-1", "slug": "welcome", "name": "Welcome Email", "subject": "Welcome to {{company}}!", "variables": ["name", "company", "verifyUrl"], "category": "transactional", "version": 2 }, { "id": "template-uuid-2", "slug": "password-reset", "name": "Password Reset", "subject": "Reset your password", "variables": ["name", "resetUrl"], "category": "transactional", "version": 1 }]GET
/api/v1/templates/:slugGet details of a specific template by slug.
Example Request
Terminal
curl https://artamail.artatol.com/api/v1/templates/welcome \ -H "Authorization: Bearer am_live_sk_xxx"Response
json
{ "id": "template-uuid-1", "slug": "welcome", "name": "Welcome Email", "subject": "Welcome to {{company}}!", "variables": ["name", "company", "verifyUrl"], "category": "transactional", "version": 2, "created_at": "2024-01-10T10:00:00Z", "updated_at": "2024-01-15T14:30:00Z"}Returns 404 if template not found.
Template Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique template ID |
slug | string | URL-friendly identifier (used in send requests) |
name | string | Human-readable name |
subject | string | Email subject line (may contain variables) |
variables | string[] | List of variable names used in template |
category | string | transactional or marketing |
version | number | Template version number |
Using Variables
When sending an email, provide values for the template variables in the data field:
json
{ "to": "[email protected]", "template": "welcome", "data": { "name": "John", "company": "Acme Inc", "verifyUrl": "https://example.com/verify/abc123" }}Variables are substituted using {{variableName}} syntax in the template.