Skip to the documentation
API

Sharing

Every operation in this group: what it accepts, what it returns and the errors it can answer with.

Operations

Public links to templates, forms and automations, the Share button on each of them in the app. Everything is private until it is shared, and a shared item is a page anyone with the link can open without an account, where they can try it: fill in a template's props, type into a form, follow an automation step by step. With copyable on, anyone signed in can also copy it into their own workspace.

A copy carries the design only: never the submissions, sends, runs or contacts the original collected, and never the audiences, addresses, forms or webhook endpoints it points at, which stay with the owner and are left empty for you to fill in. The templates an automation sends are copied with it, and the images a template shows are copied into your workspace.

GET/shared/{token}

Read a shared item

Scopestemplates:readReads

What the public page of a link shows, from any workspace: the item's name and description, the workspace that shares it, whether it may be copied, and its content. A template comes rendered with the sample values of its props, a form with its design, and an automation with its flow and the templates it sends. The audiences, addresses, forms and webhook endpoints an automation points at are left empty, and a form's audience choices keep their labels only. Reading it takes the read scope of the item's kind, and it does not count as a view of the page.

Requires the templates:read scope, or forms:read or automations:read in its place.

Path parameters

tokenstringRequired

The token at the end of a public link, token on a share link, or the last part of its url.

Returns

The shared item.

Errors

404

shared_item_not_found: no shared item has that link, because the owner made it private or deleted it.

The errors every operation can return400401403422429500Error catalog

Also available in

TypeScript
shared.get()
Python
shared.get()
Ruby
shared.get
PHP
shared->get
Go
Shared.Get
Java
shared().get
C#
Shared.GetAsync
CLI
nextmail shared get

POST/shared/{token}/copy

Copy a shared item into this workspace

Scopestemplates:writeChanges data

Copies the item at a public link into this workspace as a new draft, as Copy to my workspace does on the page, and answers the copy's id. Copying takes the write scope of the item's kind, and an automation that sends templates also takes templates:write. A template whose name is taken here gets a number after it. Workspace limits apply as they do to anything created here.

A copy carries the design only: never the submissions, sends, runs or contacts the original collected, and never the audiences, addresses, forms or webhook endpoints it points at, which stay with the owner and are left empty for you to fill in. The templates an automation sends are copied with it, and the images a template shows are copied into your workspace.

Requires the templates:write scope, or forms:write or automations:write in its place.

Path parameters

tokenstringRequired

The token at the end of a public link, token on a share link, or the last part of its url.

Returns

The copy, a draft in this workspace.

Errors

403

share_not_copyable: the owner shares it to look at, not to copy.

404

shared_item_not_found: no shared item has that link.

The errors every operation can return400401422429500Error catalog

Also available in

TypeScript
shared.copy()
Python
shared.copy()
Ruby
shared.copy
PHP
shared->copy
Go
Shared.Copy
Java
shared().copy
C#
Shared.CopyAsync
CLI
nextmail shared copy
MCP
copySharedItem

Objects

AutomationDefinitionobject

What starts an automation and what it then does. Paths never join or loop: every step is reached from exactly one place, and a definition holds at most 50 steps.

triggerobjectRequired

What puts a contact into the automation. Null in a draft that has none yet, and a draft cannot be published without one.

Can be null
kindstringRequired
One of"audience_joined"
audienceIdstringRequired
Up to 64 characters
includeImportedbooleanRequired
entrystringRequired

The key of the first step, or null while the draft has no steps.

Can be nullPattern^[a-z][a-z0-9]{2,23}$
stepsobject[]Required

Every step, in any order. Each has a unique key, and names the step after it by key in next, or in yes and no for a branch. Null ends the path there.

Up to 50 items
keystringRequired
Pattern^[a-z][a-z0-9]{2,23}$
namestring
Up to 80 characters
kindstringRequired
One of"send_email"
nextstringRequired
Can be nullPattern^[a-z][a-z0-9]{2,23}$
templateIdstringRequired
Up to 64 characters
templateVersionintegerRequired
Can be nullAt least 1
fromobjectRequired
emailstringRequired
Up to 320 characters
namestring
Up to 120 characters
replyTostringRequired
Can be nullUp to 320 characters
subjectstringRequired
Can be nullUp to 300 characters
propsRecord<string, object>Required

AutomationSettingsobject

timezonestringRequired

The IANA time zone the sending window and waits until a day and time are read in, such as Europe/London. UTC until you set one.

1 to 64 characters
sendWindowobjectRequired

When emails may go out: days of the week (0 is Sunday) and startMinute to endMinute of the day, counted from midnight. An email due outside it waits for the window to open. Null sends at any time.

Can be null
daysinteger[]Required
Up to 7 items
startMinuteintegerRequired
At least 0At most 1440
endMinuteintegerRequired
At least 0At most 1440
reentryDaysintegerRequired

How many days after a contact finishes before they may enter again. Null lets each contact through once only.

Can be nullAt least 0At most 3650
exitOnLeavebooleanRequired

Take a contact out when they leave the audience that started the automation. True by default.

listAudienceIdstringRequired

The audience an unsubscribe from one of these emails is recorded in. A contact who unsubscribed from it is not sent to and cannot be enrolled. Null uses the audience that starts the automation, or the built-in audience of every contact when no audience starts it.

Can be nullUp to 64 characters

FormDocumentobject

Everything a visitor sees: fields in order, the copy around them and the style. Every form has exactly one email field, and every input field has a unique key that answers are posted under.

fieldsobject[]Required
1 to 50 items
idstringRequired
1 to 64 characters
typestringRequired
One of"email""text""textarea""number""phone""url""date""select""radio""checkboxes""checkbox""consent""audiences""hidden""heading""paragraph""divider"
keystringRequired
Up to 40 charactersPattern^[a-z][a-z0-9_]{0,39}$
labelstringRequired
Up to 300 characters
placeholderstringRequired
Can be nullUp to 200 characters
helpstringRequired
Can be nullUp to 1000 characters
requiredbooleanRequired
defaultValuestringRequired
Can be nullUp to 1000 characters
optionsobject[]Required
Up to 50 items
idstringRequired
1 to 64 characters
labelstringRequired
1 to 300 characters
valuestringRequired
1 to 1000 characters
mapsTostringRequired

The contact detail this field fills when the sign-up is accepted, or null for none. email goes on the email field. firstName, lastName, name, company and jobTitle go on a text field, phone on a phone field, website on a url field and birthday on a date field. One field per detail, and name never together with firstName or lastName. The name is saved on the contact. The phone number, company, job title, website and birthday are saved on the contact card, and only where the card has nothing yet: a company, job title or birthday already there is kept, and a phone number or website the card already lists is not added again.

Can be nullOne of"email""firstName""lastName""name""phone""company""jobTitle""website""birthday"
saveAsstring

A custom field of the contact this field fills when the sign-up is accepted, such as plan, or null for none. A key starts with a letter and holds up to 64 letters, digits and underscores. The answer replaces the field of that name on the contact, an empty answer leaves it alone, and a choice of several options is saved as their labels joined by commas. Not on the email field or an audience choice, one field per custom field, and never together with mapsTo. Left out when a form is updated, a field keeps the custom field it had.

Can be nullPattern^[A-Za-z][A-Za-z0-9_]{0,63}$
widthstringRequired
One of"full""half"
minLengthintegerRequired
Can be nullAt least 0At most 5000
maxLengthintegerRequired
Can be nullAt least 1At most 5000
minnumberRequired
Can be nullAt least -1000000000000At most 1000000000000
maxnumberRequired
Can be nullAt least -1000000000000At most 1000000000000
copyobjectRequired
titlestringRequired
Up to 200 characters
descriptionstringRequired
Can be nullUp to 2000 characters
submitLabelstringRequired
1 to 60 characters
successTitlestringRequired
Up to 200 characters
successMessagestringRequired
Up to 2000 characters
pendingTitlestringRequired
Up to 200 characters
pendingMessagestringRequired
Up to 2000 characters
closedTitlestringRequired
Up to 200 characters
closedMessagestringRequired
Up to 2000 characters
footerstringRequired
Can be nullUp to 2000 characters
styleobjectRequired
accentstringRequired
Pattern^#[0-9a-fA-F]{6}$
backgroundstringRequired
Pattern^#[0-9a-fA-F]{6}$
surfacestringRequired
Pattern^#[0-9a-fA-F]{6}$
textstringRequired
Pattern^#[0-9a-fA-F]{6}$
fontstringRequired
One of"system""sans""serif""mono"
radiusstringRequired
One of"none""sm""md""lg""full"
widthstringRequired
One of"narrow""normal""wide"
layoutstringRequired
One of"card""plain"
alignstringRequired
One of"left""center"
logoUrlstringRequired
Can be nullUp to 2000 charactersFormaturi

SharedAutomationTemplateobject

stepKeystringRequired

The send step that sends it.

namestringRequired
subjectstringRequired

SharedCopyobject

objectstringRequired
One of"shared_copy"
kindstringRequired
One of"template""form""automation"
idstringRequired

The new template, form or automation, a draft here.

namestringRequired
templateIdsstring[]Required

The templates copied along with an automation, empty for the rest.

SharedFormobject

documentFormDocumentRequired
doubleOptInbooleanRequired

True when the form asks people to confirm their address before they join.

SharedItemobject

objectstringRequired
One of"shared_item"
kindstringRequired
One of"template""form""automation"
tokenstringRequired
namestringRequired
descriptionstringRequired
Can be null
workspaceNamestringRequired

The workspace that shares it, empty when it has no name.

copyablebooleanRequired
sharedAtstringRequired
Formatdate-time
templateSharedTemplateRequired
formSharedFormRequired
automationSharedAutomationRequired

SharedTemplateobject

subjectstringRequired

The subject, with the sample values filled in.

enginestringRequired
One of"blocks""html"
slotsTemplateSlot[]Required
propsTemplateProp[]Required
htmlstringRequired

The email rendered with the sample values.

textstringRequired

The plain text part, rendered the same way.

unfilledstring[]Required

The props and slots that have no sample value, so they render empty.

TemplatePropobject

keystring

A letter followed by letters, digits or underscores. This is what {{key}} in the subject or the body refers to, and what a send names in props or slots.

labelstring

For whoever fills it in. Never rendered into the message.

kindstring

How a supplied value is escaped when it lands in the body. text becomes a React child, so React escapes it; url and image are parsed and scheme-checked before they reach an href or a src. The kind is declared rather than sniffed from the value, because a string that happens to start with https: is not evidence that the author meant it to be followed.

One of"text""url""image"
requiredboolean

A required prop missing at send is a 422 and no mail leaves. That refusal is the most valuable rule in the feature: the alternative is a message going out with a blank where the order number should be, which nothing reports, nobody notices, and no one can recall.

defaultstring

Used when the caller names nothing. Null means there is no fallback: either the prop is required and its absence is refused, or it renders empty.

Can be null

TemplateSlotobject

keystring

A letter followed by letters, digits or underscores. This is what {{key}} in the subject or the body refers to, and what a send names in props or slots.

labelstring

For whoever fills it in. Never rendered into the message.

kindstring

How a supplied value is escaped when it lands in the body. text becomes a React child, so React escapes it; url and image are parsed and scheme-checked before they reach an href or a src. The kind is declared rather than sniffed from the value, because a string that happens to start with https: is not evidence that the author meant it to be followed.

One of"text""url""image"
defaultstring

What renders when nobody overrides it. Never null. A slot always has something to fall back to, which is the difference between it and a prop.