Templated

Quickstart

Make your first API call to Templated in under 5 minutes.

Quickstart

Get up and running with the Templated API. By the end of this guide, you'll have created an account, authenticated, and fetched your templates.

Prerequisites

Step 1: Sign in

Authenticate to get a session cookie:

curl -c cookies.txt -X POST \
  https://app.templated.email/api/auth/callback/credentials \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "email=you@example.com&password=your-password"

This saves your session cookie to cookies.txt.

Step 2: List your accounts

curl -b cookies.txt \
  https://app.templated.email/api/accounts

Response:

[
  {
    "id": "clx...",
    "name": "My Company",
    "slug": "my-company",
    "role": "OWNER"
  }
]

Note the slug value — you'll use it for all account-scoped requests.

Step 3: List templates

curl -b cookies.txt \
  https://app.templated.email/api/accounts/my-company/templates

Response:

[
  {
    "id": "tmpl_abc123",
    "name": "Welcome Email",
    "createdAt": "2026-02-09T12:00:00.000Z",
    "updatedAt": "2026-02-09T12:00:00.000Z"
  }
]

Step 4: Create a template

curl -b cookies.txt -X POST \
  https://app.templated.email/api/accounts/my-company/templates \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My First Template",
    "html": "<h1>Hello World</h1><p>This is my template.</p>"
  }'

Step 5: Generate with AI

curl -b cookies.txt -X POST \
  https://app.templated.email/api/accounts/my-company/ai/generate \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Create a welcome email for a SaaS product launch"
  }'

The AI generates a complete, styled email template based on your prompt and brand kit.

Next steps

On this page