Overview
Understand the Templated API architecture, concepts, and conventions.
API Overview
The Templated API is a RESTful JSON API built on Next.js API routes. It follows standard HTTP conventions and returns JSON responses for all endpoints.
Core concepts
Accounts
An account is the top-level organizational unit. Each account has a unique slug used in API paths. Users can belong to multiple accounts with different roles.
Templates
Templates are email designs stored as structured JSON (block-based) with an HTML representation. Templates belong to an account and can be created manually, imported from HTML/ZIP, generated by AI, or imported from Canva.
Brand Kit
Each account has a brand kit containing logos, brand colors, and default typography. The brand kit informs AI generation and provides consistent styling across templates.
Members and roles
Accounts support multiple members with role-based access:
| Role | Permissions |
|---|---|
| Owner | Full access, billing, can transfer ownership |
| Admin | Manage members, templates, settings |
| Member | Create and edit templates |
API conventions
Authentication
All authenticated endpoints require a valid session. See Authentication for details.
Request format
- Content-Type:
application/jsonfor request bodies - Multipart:
multipart/form-datafor file uploads (images, fonts)
Response format
Successful responses return JSON:
{
"id": "abc123",
"name": "Welcome Email",
"createdAt": "2026-02-09T12:00:00.000Z"
}Error responses include a message:
{
"error": "Template not found"
}URL structure
https://app.templated.email/api/{resource}
https://app.templated.email/api/accounts/{slug}/{resource}Account-scoped resources are nested under /api/accounts/{slug}/.
HTTP methods
| Method | Usage |
|---|---|
GET | Retrieve resources |
POST | Create resources |
PUT | Update resources (full replacement) |
PATCH | Partial updates |
DELETE | Remove resources |
Pagination
List endpoints return arrays. Pagination details will be documented per endpoint as the API evolves.
Status codes
| Code | Meaning |
|---|---|
200 | Success |
201 | Created |
400 | Bad request — invalid input |
401 | Unauthorized — not authenticated |
403 | Forbidden — insufficient permissions |
404 | Not found |
429 | Rate limited |
500 | Server error |