Update template

const response = await fetch('https://api.emailit.com/v2/templates/tem_47TaFwzJx6mD7NeJYvLjFxVwbgT', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'Welcome Email - Updated',
    subject: 'Welcome! We are glad you are here'
  })
});

const result = await response.json();

Responses

{
  "data": {
    "id": "tem_47TaFwzJx6mD7NeJYvLjFxVwbgT",
    "name": "Welcome Email - Updated",
    "alias": "welcome-email",
    "from": "Support <support@company.com>",
    "subject": "Welcome! We are glad you are here",
    "reply_to": ["support@company.com"],
    "html": "<h1>Welcome!</h1>",
    "text": "Welcome!",
    "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-24T12:00:00.000000Z"
  },
  "message": "Template was successfully updated."
}