Skip to main content

PUT /templates/:id

Update a template’s name, subject, or content. Variables are auto-detected from the updated content.

Authentication

JWT Bearer token (dashboard auth)

Request Body

FieldTypeRequiredDescription
namestringNoNew template name
subjectstringNoNew subject line
html_contentstringNoNew HTML content
text_contentstringNoNew text content

Response

{
  "success": true,
  "data": {
    "template": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Updated Welcome",
      "subject": "Welcome {{name}}!",
      "html_content": "<h1>Hey {{name}}!</h1>",
      "text_content": null,
      "variables": ["name"],
      "created_at": "2026-03-07T12:00:00Z",
      "updated_at": "2026-03-07T12:30:00Z"
    }
  }
}

Errors

StatusErrorCause
404Template not foundInvalid ID or not owned by user
409Duplicate nameAnother template with this name exists