Templated

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:

RolePermissions
OwnerFull access, billing, can transfer ownership
AdminManage members, templates, settings
MemberCreate and edit templates

API conventions

Authentication

All authenticated endpoints require a valid session. See Authentication for details.

Request format

  • Content-Type: application/json for request bodies
  • Multipart: multipart/form-data for 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

MethodUsage
GETRetrieve resources
POSTCreate resources
PUTUpdate resources (full replacement)
PATCHPartial updates
DELETERemove resources

Pagination

List endpoints return arrays. Pagination details will be documented per endpoint as the API evolves.

Status codes

CodeMeaning
200Success
201Created
400Bad request — invalid input
401Unauthorized — not authenticated
403Forbidden — insufficient permissions
404Not found
429Rate limited
500Server error

On this page