Skip to content

Save the draft (autosave)

PUT
/api/v1/workspaces/{workspace}/transactional/templates/{template}/draft
curl --request PUT \
--url https://reputecast.example.com/api/v1/workspaces/acme-newsletter/transactional/templates/password-reset/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "baseRevision": 1, "editorMode": "visual", "force": true, "html": "example", "label": "example", "mjml": "example", "plainText": "example", "preheader": "example", "replyTo": "example", "senderId": "example", "source": "autosave", "subject": "example", "testData": [ { "data": { "additionalProperty": "example" }, "name": "New user" } ], "trackClicks": true, "trackOpens": true, "variables": [ { "default": "example", "description": "example", "name": "reset_url", "required": true, "sample": "example", "sensitive": true, "type": "text" } ] }'

Permission: transactional:edit

Content, variables, test data, sender, reply-to and tracking. Fails with 409 version_conflict when someone saved a newer revision since baseRevision; the problem’s meta says who, when and what each side changed. Send force: true to keep yours.

workspace
required

Workspace slug

string
/^[a-z0-9][a-z0-9-]{1,62}$/

Workspace slug

template
required

The template’s ID, such as password-reset, or its UUID

string
<= 64 characters

The template’s ID, such as password-reset, or its UUID

language

Saves a language version instead of the draft (internal/languages)

string
<= 16 characters

Saves a language version instead of the draft (internal/languages)

Media typeapplication/json
object
baseRevision
required
integer format: int64
>= 1
editorMode
string
Allowed values: visual mjml html
force
boolean
html

The HTML the editor compiled; empty compiles the MJML on the server

string
<= 2500000 characters
label
string
<= 200 characters
mjml
string
<= 2000000 characters
plainText
string
<= 500000 characters
preheader
string
<= 500 characters
replyTo
string
<= 254 characters
senderId

A Transactional sender, or empty for the default

string
source
string
default: autosave
Allowed values: autosave manual import restore
subject
string
<= 998 characters
testData
Array<object>
<= 50 items
object
data
required
object
key
additional properties
name
required
string
>= 1 characters <= 80 characters
trackClicks
boolean
trackOpens
boolean
variables
Array<object>
<= 200 items
object
default
string
<= 4000 characters
description
string
<= 300 characters
name
required
string
>= 1 characters <= 64 characters /^[A-Za-z_][A-Za-z0-9_]*$/
required
required
boolean
sample
string
<= 4000 characters
sensitive
required

Never stored: logs and stored content show ••••••

boolean
type
required
string
Allowed values: text number boolean date url list object

OK

Media typeapplication/json
object
draftChanges
required
boolean
draftHash
required
string
draftRevision
required
integer format: int64
html
required
string
plainText
required
string
savedAt
required
string format: date-time
sizeBytes
required
integer format: int64

Example generated

{
"draftChanges": true,
"draftHash": "example",
"draftRevision": 1,
"html": "example",
"plainText": "example",
"savedAt": "2026-04-15T12:00:00Z",
"sizeBytes": 1
}

Error

Media typeapplication/problem+json
object
code

Stable error code, e.g. permission_denied

string
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object>
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

helpers

Members who hold the missing permission

Array<string>
instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
meta
object
key
additional properties
permission

The missing permission key

string
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank

Example

{
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}