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/templates

Get 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/:slug

Get 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

FieldTypeDescription
idstringUnique template ID
slugstringURL-friendly identifier (used in send requests)
namestringHuman-readable name
subjectstringEmail subject line (may contain variables)
variablesstring[]List of variable names used in template
categorystringtransactional or marketing
versionnumberTemplate version number

Using Variables

When sending an email, provide values for the template variables in the data field:

json
{
"template": "welcome",
"data": {
"name": "John",
"company": "Acme Inc",
"verifyUrl": "https://example.com/verify/abc123"
}
}

Variables are substituted using {{variableName}} syntax in the template.