Skip to main content
PUT
/
v1
/
templates
/
{id}
Update template
curl --request PUT \
  --url https://api.emailr.dev/v1/templates/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "name": "Welcome Email",
  "subject": "Welcome to {{company}}",
  "html_content": "<h1>Welcome {{name}}</h1>",
  "text_content": "Welcome {{name}}",
  "variables": [
    "name",
    "company"
  ],
  "from_email": "hello@example.com",
  "reply_to": "support@example.com",
  "preview_text": "Check out what's new..."
}
EOF
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "subject": "<string>",
  "html_content": "<string>",
  "text_content": "<string>",
  "variables": [
    "<string>"
  ],
  "from_email": "<string>",
  "reply_to": "<string>",
  "preview_text": "<string>",
  "created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API key authentication. Use your API key as the bearer token.

Path Parameters

id
string<uuid>
required
Example:

"123e4567-e89b-12d3-a456-426614174000"

Body

application/json
name
string
required
Minimum string length: 1
Example:

"Welcome Email"

subject
string
required
Minimum string length: 1
Example:

"Welcome to {{company}}"

html_content
string
Example:

"<h1>Welcome {{name}}</h1>"

text_content
string
Example:

"Welcome {{name}}"

variables
string[]
Example:
["name", "company"]
from_email
string<email>

Default from email address. Must match a verified domain.

Example:

"hello@example.com"

reply_to
string<email>

Reply-To email address for template-based emails.

Example:

"support@example.com"

preview_text
string

Preview text (preheader) shown in email clients.

Example:

"Check out what's new..."

Response

Template updated

id
string<uuid>
required
Example:

"123e4567-e89b-12d3-a456-426614174000"

organization_id
string<uuid>
required
name
string
required
subject
string
required
html_content
string | null
required
text_content
string | null
required
variables
string[] | null
required
from_email
string | null
required
reply_to
string | null
required
preview_text
string | null
required
created_by
string<uuid> | null
required
created_at
string<date-time>
required
updated_at
string<date-time>
required