Create template

const response = await fetch('https://api.emailit.com/v2/templates', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'Welcome Email',
    alias: 'welcome-email',
    from: 'Support <support@company.com>',
    subject: 'Welcome to our service!',
    reply_to: ['support@company.com'],
    html: '<h1>Welcome!</h1><p>Thanks for joining us.</p>',
    text: 'Welcome! Thanks for joining us.',
    editor: 'html'
  })
});

const result = await response.json();

Responses

{
  "data": {
    "id": "tem_47TaFwzJx6mD7NeJYvLjFxVwbgT",
    "name": "Welcome Email",
    "alias": "welcome-email",
    "from": "Support <support@company.com>",
    "subject": "Welcome to our service!",
    "reply_to": ["support@company.com"],
    "html": "<h1>Welcome!</h1><p>Thanks for joining us.</p>",
    "text": "Welcome! Thanks for joining us.",
    "editor": "html",
    "published_at": "2025-12-24T10:30:00.000000Z",
    "preview_url": null,
    "created_at": "2025-12-24T10:30:00.000000Z",
    "updated_at": "2025-12-24T10:30:00.000000Z"
  },
  "message": "Template was successfully created."
}