Automations
Emails and steps that run by themselves for each contact, and the events that start them.
Automations tools
| Tool | What it does |
|---|---|
| listAutomations | The workspace’s automations, most recently changed first, with their status, what starts each one and how many contacts are in it. |
| getAutomation | One automation in full: its status, settings and numbers, what is wrong with its draft, and the draft definition as JSON. includePublished adds the version that is running. |
| listAutomationStarters | The ready-made automations a new one can begin from, each with its definition. |
| createAutomation | Create a draft from a starter, from a definition written as JSON, or empty, with any settings. Nothing runs until it is published. |
| updateAutomation | Change an automation’s name and settings, which apply at once, or replace its draft definition. A live automation keeps running its published version. |
| deleteAutomation | Delete an automation for good, with its versions, enrollments and numbers. Contacts in it stop at once. |
| publishAutomation | Make the draft the version that runs and turn the automation on. A draft that is not complete is refused with every problem that blocks it. Needs emails:send as well. |
| pauseAutomation | Stop a live automation. Nobody new enters, and everyone in it stays where they are. |
| resumeAutomation | Turn a paused automation back on with the version it was running. Needs emails:send as well. |
| archiveAutomation | Retire an automation for good and keep its history. Everyone in it leaves. |
| duplicateAutomation | Copy an automation into a new draft, without its versions, contacts or numbers. |
| sendAutomationTest | Send the email of one step of the draft to yourself or to one address. Needs emails:send as well. |
| listAutomationVersions | The published versions, newest first, and which one is running. includeDefinitions adds each definition. |
| restoreAutomationVersion | Copy an earlier version back into the draft. Nothing that is running changes until the next publish. |
| getAutomationStats | Contacts entered, in it now, completed and left, and emails sent, delivered, opened and clicked over a window, in total and for each step. |
| listAutomationEnrollments | The contacts in an automation or that have been, a page at a time, with the step each is at and how it ended. Filter by status, step or a piece of the address. |
| getAutomationEnrollment | One contact’s way through an automation: what each step did for them, oldest first. |
| enrollInAutomation | Put one contact into a live automation at its first step, whatever starts it normally. |
| removeFromAutomation | Take one contact out of an automation at once. |
| sendContactEvent | Record that something happened to a contact. It starts the live automations whose trigger names the event and ends the waits that were holding out for it. |
| sendContactEvents | Record up to 100 events in one call. One failing does not stop the rest. |
| listContactEventNames | The event names the workspace has recorded in the last 90 days. |
| listContactEvents | The events recorded for one contact, newest first, a page at a time. |
| getAutomationAnalytics | Every automation side by side over a window: contacts in, inside and out, and emails sent, opened and clicked, with a line for each automation. |
| listAutomationRuns | The run log of one automation, newest first: who entered, what each step did for them and how they finished. Narrow it by kind, step or outcome. |
| listThreadAutomations | The automations that ran on one email thread: what started each, the case the email matched, the messages it started from or sent and every step it ran. |
Reading needs automations:read and every change needs automations:write. Reading the automations that ran on a thread also needs threads:read. Publishing, resuming and sending a test also need emails:send, because the automation then sends mail for whoever published it. Sending an event needs contacts:write, reading the events of a contact needs contacts:read, and listContactEventNames needs automations:read. A client acting for a member sees only the automations that member made and the contacts that member added.
Some tools on this server make a change the REST API guards with a verification code, and ask for the same code. Until the client has verified a code in the last 60 minutes, or the person has chosen Allow changes for 60 minutes on it in Account → Connected apps, such a tool answers with a result that starts Refused (step_up_required): and changes nothing. beginStepUp asks for a code, verifyStepUp checks the one the person gives, and getStepUpStatus says whether the client is verified. emptyAudience never asks for a code. The API Authentication page lists every tool that asks.
The tools apply the same rules and refusals as the REST API, and the /automations and /events pages of the API reference describe every field. A definition is passed whole as JSON: read it with getAutomation, change it and pass all of it back to updateAutomation.
An automation is one JSON document: {"name": ..., "description": ..., "settings": {...}, "definition": {...}}. name is 1 to 120 characters and description a note of at most 500 characters, or null. settings holds all of timezone, sendWindow, reentryDays, exitOnLeave and listAudienceId, and definition is {"trigger": ..., "entry": ..., "steps": [...]}. It is the body PATCH /automations/{id} takes, less expectedUpdatedAt, the updatedAt you read, which refuses the save when somebody saved in between. createAutomation and updateAutomation take its four parts as their parameters.
A document may leave out what has a default, and the tools and the editor fill it in: entry (the first step), includeImported (false), offsetDays (0), a trigger’s filters, addresses, domains and senders (empty), threadId (null), match (any), a send step’s templateVersion, replyTo and subject (null) and props (empty), and an address check’s mailbox (false) and accept (valid_or_risky). The REST API takes the definition whole, as getAutomation shows it.
In the app, the automation editor switches between the canvas and a JSON view of this document. Valid text is applied as the draft, with the name, the description and the settings, and saved as an edit on the canvas would be. Text that does not fit shows its problems, each with the dotted path of the field, such as definition.steps.2.next: text that is not JSON, with the line and column where it breaks, a key that is not taken, a value of the wrong type, one that is not in its list, with the values that are, one too long or too short, or a missing key. Meanwhile the editor keeps the last valid version, and nothing is saved until the text is valid again. A document that fits can still be incomplete, and the problems list says what stops it from being published, as on the canvas.
Reference
listAutomationsgetAutomationlistAutomationStarterscreateAutomationupdateAutomationdeleteAutomationpublishAutomationpauseAutomationresumeAutomationarchiveAutomationduplicateAutomationsendAutomationTestlistAutomationVersionsrestoreAutomationVersiongetAutomationStatslistAutomationEnrollmentsgetAutomationEnrollmentenrollInAutomationremoveFromAutomationsendContactEventsendContactEventslistContactEventNameslistContactEventsgetAutomationAnalyticslistAutomationRunslistThreadAutomations
listAutomations
List the automations in this workspace, the most recently changed first: name, id, status (draft, live, paused or archived), what starts each one, its steps and how many contacts are in it now, completed it or left early. Use it to find an automation by name before reading or changing it. One page at a time: when more follow, the last line gives a cursor to pass back.
Inputs
statusstring- One of
"draft""live""paused""archived" limitinteger- At least 1At most 100
cursorstring- 1 to 64 characters
Also available in
- API
GET /automations- TypeScript
automations.list()automations.listAll()automations.iterate()- Python
automations.list()automations.list_all()automations.iterate()- Ruby
automations.listautomations.list_allautomations.iterate- PHP
automations->listautomations->listAllautomations->iterate- Go
Automations.ListAutomations.ListAllAutomations.Iterate- Java
automations().listautomations().listAllautomations().iterate- C#
Automations.ListAsyncAutomations.ListAllAsyncAutomations.IterateAsync
getAutomation
Read one automation: its status, settings, numbers, what is wrong with its draft, and the draft definition (trigger and steps) as JSON, to change and pass back to updateAutomation. includePublished adds the definition of the version that is running, which differs from the draft while there are unpublished changes.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 charactersincludePublishedboolean- Default
false
Also available in
listAutomationStarters
The ready-made automations a new one can begin from, such as a welcome series or a birthday note: slug, name, what each is for and its definition as JSON. Pass a slug to createAutomation as starter. A starter leaves the audience, the templates and the from address empty to fill in.
Inputs
Takes no input.
Also available in
createAutomation
Create an automation as a draft: from a starter (listAutomationStarters names them), from a definition written out as JSON, or empty. definition is the JSON definition {"trigger": ..., "entry": ..., "steps": [...]}. The whole automation is one JSON document, {"name": ..., "description": ..., "settings": {...}, "definition": {...}}, and name, description, settings and definition here are its parts. The docs page /docs/mcp/tools/automations describes the document, the defaults it may leave out and the problems it can have. Nothing runs until publishAutomation. The answer lists what the draft still needs before it can be published, such as a template or a from address for each email. Find audiences with listAudiences, templates with listTemplates and forms with listForms. Use this too when the user wants mail answered by itself: an email_received trigger, a branch that asks the AI a yes or no question (ai_check) or compares the text (email_matches), and reply steps. For one conversation, put its thread id in the trigger as threadId and the address that received it in addresses. Set reentryDays to 0 so every email runs it. Leave it a draft and say what it will do, so the user can check it and publish it.
Inputs
namestringRequiredA short name for the automation. Contacts never see it.
1 to 120 charactersdescriptionstringOne line about what it is for.
Up to 500 charactersstarterstring- 1 to 64 characters
definitionRecord<string, any> | stringThe trigger and steps as JSON: {"trigger": {...}, "entry": "<key of the first step>", "steps": [...]}. Triggers: {"kind": "audience_joined", "audienceId", "includeImported": false}, {"kind": "form_submitted", "formId"}, {"kind": "event", "eventName", "filters": []}, {"kind": "date", "field": "birthday" or "joined", "audienceId", "offsetDays": 0}, {"kind": "manual"} and {"kind": "email_received", "addresses": [], "domains": [], "senders": [], "threadId": null, "match": "any", "filters": []}, which starts when somebody writes to the workspace: addresses and domains are the workspace's own, where the mail arrives, and both empty means any address, senders are who it comes from, such as ["[email protected]", "example.com"], where a domain covers its subdomains and any one is enough, and empty means anybody, so a sender's domain goes in senders and never in domains, threadId limits it to one conversation, match is "any", "reply" or "new", and a filter is {"property": "from" or "subject" or "text", "operator": "contains", "value"}. Every step has a unique key of 3 to 24 lowercase letters and digits starting with a letter, and points at the next step by key in next, or null to end the path. Steps: {"kind": "send_email", "key", "next", "templateId", "templateVersion": null, "from": {"email", "name"}, "replyTo": null, "subject": null, "props": {}}, {"kind": "wait", "key", "next", "wait": {"mode": "duration", "amount": 3, "unit": "days"}}, {"kind": "branch", "key", "condition": {"kind": "email_clicked", "stepKey"}, "yes", "no"}, {"kind": "add_to_audience" or "remove_from_audience", "key", "next", "audienceId"}, {"kind": "update_field", "key", "next", "field", "value": {"source": "static", "value"}}, {"kind": "webhook", "key", "next", "endpointId"}, {"kind": "reply", "key", "next", "reply": {"mode": "text", "text"}} and {"kind": "exit", "key"}. A reply step answers the contact's latest email in its conversation, from the address that received it; its reply can also be {"mode": "ai", "instructions"}, where the AI writes it. It needs an email_received trigger or a wait for a reply before it. A wait can also be {"mode": "until", "weekdays": [1], "hour": 9, "minute": 0}, {"mode": "event", "eventName", "timeout": {"amount": 7, "unit": "days"}} or {"mode": "reply", "timeout": {"amount": 3, "unit": "days"}}, which ends when the contact writes back. Conditions: email_opened and email_clicked with stepKey, in_audience with audienceId, field with field, operator and value, event with eventName and withinDays, replied (after a wait for a reply), email_matches with field ("from", "subject" or "text"), operator and value, ai_check with question, a yes or no question the AI answers about the contact's email, and address_check with mailbox and accept, which checks the contact's address: accept "valid" passes only a valid address and "valid_or_risky" every address that is not invalid, and mailbox true also asks whether the mailbox exists, which uses one of the workspace's monthly deep checks and then pay as you go. To answer people who write in, use email_received, with their addresses or domains in senders when only some people get an answer, then a branch on ai_check or email_matches, then reply steps on yes and no, and set reentryDays to 0 so every email runs it. A props value is {"source": "static", "value"}, {"source": "contact", "field"} or {"source": "event", "path"}. Paths never join or loop. These may be left out and take their default: entry (the first step), includeImported (false), offsetDays (0), filters, addresses, domains and senders ([]), threadId (null), match ("any"), and on a send_email step templateVersion, replyTo and subject (null) and props ({}), and on an address_check mailbox (false) and accept ("valid_or_risky"). Every other key shown is needed, next, yes and no included. A refusal lists every problem with its field, so fix them all before calling again. getAutomation shows a saved definition in this shape, and listAutomationStarters has ready-made ones.
settingsRecord<string, any> | stringHow it runs, as JSON with any of: timezone (an IANA zone such as Europe/London), sendWindow ({"days": [1, 2, 3, 4, 5], "startMinute": 540, "endMinute": 1020} or null for any time), reentryDays (days after finishing before a contact may enter again, 0 for straight away, or null for once only), exitOnLeave (true takes a contact out when they leave the audience that started it) and listAudienceId (the audience unsubscribes are recorded in).
Also available in
updateAutomation
Change an automation. Its name, description and settings apply at once. definition is the JSON definition {"trigger": ..., "entry": ..., "steps": [...]} and replaces the whole draft, so start from getAutomation, change the JSON and pass all of it back. The whole automation is one JSON document, {"name": ..., "description": ..., "settings": {...}, "definition": {...}}, and name, description, settings and definition here are its parts, with expectedUpdatedAt beside them. The docs page /docs/mcp/tools/automations describes the document, its defaults and its problems. A live automation keeps running its published version until publishAutomation, and contacts already in it stay on the version they entered on. Pass only the parts that change, or the whole document.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 charactersnamestring- 1 to 120 characters
descriptionstring- Can be nullUp to 500 characters
definitionRecord<string, any> | stringThe trigger and steps as JSON: {"trigger": {...}, "entry": "<key of the first step>", "steps": [...]}. Triggers: {"kind": "audience_joined", "audienceId", "includeImported": false}, {"kind": "form_submitted", "formId"}, {"kind": "event", "eventName", "filters": []}, {"kind": "date", "field": "birthday" or "joined", "audienceId", "offsetDays": 0}, {"kind": "manual"} and {"kind": "email_received", "addresses": [], "domains": [], "senders": [], "threadId": null, "match": "any", "filters": []}, which starts when somebody writes to the workspace: addresses and domains are the workspace's own, where the mail arrives, and both empty means any address, senders are who it comes from, such as ["[email protected]", "example.com"], where a domain covers its subdomains and any one is enough, and empty means anybody, so a sender's domain goes in senders and never in domains, threadId limits it to one conversation, match is "any", "reply" or "new", and a filter is {"property": "from" or "subject" or "text", "operator": "contains", "value"}. Every step has a unique key of 3 to 24 lowercase letters and digits starting with a letter, and points at the next step by key in next, or null to end the path. Steps: {"kind": "send_email", "key", "next", "templateId", "templateVersion": null, "from": {"email", "name"}, "replyTo": null, "subject": null, "props": {}}, {"kind": "wait", "key", "next", "wait": {"mode": "duration", "amount": 3, "unit": "days"}}, {"kind": "branch", "key", "condition": {"kind": "email_clicked", "stepKey"}, "yes", "no"}, {"kind": "add_to_audience" or "remove_from_audience", "key", "next", "audienceId"}, {"kind": "update_field", "key", "next", "field", "value": {"source": "static", "value"}}, {"kind": "webhook", "key", "next", "endpointId"}, {"kind": "reply", "key", "next", "reply": {"mode": "text", "text"}} and {"kind": "exit", "key"}. A reply step answers the contact's latest email in its conversation, from the address that received it; its reply can also be {"mode": "ai", "instructions"}, where the AI writes it. It needs an email_received trigger or a wait for a reply before it. A wait can also be {"mode": "until", "weekdays": [1], "hour": 9, "minute": 0}, {"mode": "event", "eventName", "timeout": {"amount": 7, "unit": "days"}} or {"mode": "reply", "timeout": {"amount": 3, "unit": "days"}}, which ends when the contact writes back. Conditions: email_opened and email_clicked with stepKey, in_audience with audienceId, field with field, operator and value, event with eventName and withinDays, replied (after a wait for a reply), email_matches with field ("from", "subject" or "text"), operator and value, ai_check with question, a yes or no question the AI answers about the contact's email, and address_check with mailbox and accept, which checks the contact's address: accept "valid" passes only a valid address and "valid_or_risky" every address that is not invalid, and mailbox true also asks whether the mailbox exists, which uses one of the workspace's monthly deep checks and then pay as you go. To answer people who write in, use email_received, with their addresses or domains in senders when only some people get an answer, then a branch on ai_check or email_matches, then reply steps on yes and no, and set reentryDays to 0 so every email runs it. A props value is {"source": "static", "value"}, {"source": "contact", "field"} or {"source": "event", "path"}. Paths never join or loop. These may be left out and take their default: entry (the first step), includeImported (false), offsetDays (0), filters, addresses, domains and senders ([]), threadId (null), match ("any"), and on a send_email step templateVersion, replyTo and subject (null) and props ({}), and on an address_check mailbox (false) and accept ("valid_or_risky"). Every other key shown is needed, next, yes and no included. A refusal lists every problem with its field, so fix them all before calling again. getAutomation shows a saved definition in this shape, and listAutomationStarters has ready-made ones.
settingsRecord<string, any> | stringHow it runs, as JSON with any of: timezone (an IANA zone such as Europe/London), sendWindow ({"days": [1, 2, 3, 4, 5], "startMinute": 540, "endMinute": 1020} or null for any time), reentryDays (days after finishing before a contact may enter again, 0 for straight away, or null for once only), exitOnLeave (true takes a contact out when they leave the audience that started it) and listAudienceId (the audience unsubscribes are recorded in).
expectedUpdatedAtstringThe Updated time getAutomation gave. When somebody saved the automation since, the change is refused instead of written over theirs.
Formatdate-time
Also available in
deleteAutomation
Delete an automation for good, with its versions, its enrollments and its numbers. Contacts in it stop at once. The emails it already sent stay. It cannot be undone: to retire one and keep its history, use archiveAutomation.
- Asks for a verification code
DELETE /automations/{id}
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 characters
Also available in
publishAutomation
Publish an automation: its draft becomes the version that runs and it goes live, so its trigger starts putting contacts in and its emails start going out. Use it for a first publish and to put later changes to work. The draft has to be complete, and a refusal lists every problem that blocks it. Contacts already in it stay on the version they entered on.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 characters
Also available in
pauseAutomation
Pause a live automation. Nobody new enters, and everyone in it stays where they are and moves on when it is resumed with resumeAutomation.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 characters
Also available in
resumeAutomation
Turn a paused automation back on with the version it was running, without publishing the draft. Contacts that were held move on and its emails go out again. One that was paused because something it needs went away stays paused until that is fixed, and the refusal says what.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 characters
Also available in
archiveAutomation
Retire an automation for good and keep its history. Everyone in it leaves, nobody enters again and it can no longer be changed, published or resumed. Its versions, enrollments and numbers stay readable. To stop one for a while, use pauseAutomation.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 characters
Also available in
duplicateAutomation
Copy an automation into a new draft with "(copy)" after its name: the same draft definition and settings, and none of its versions, contacts or numbers.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 characters
Also available in
sendAutomationTest
Send the email of one step of the draft to one address, to read it before publishing. It goes to the user's own account address unless to names another. Contact values come from a sample contact, the subject starts with [Test], and nobody is enrolled. It counts toward the monthly sends.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 charactersstepKeystringRequiredThe key of the email step, from the definition getAutomation returns.
1 to 64 characterstostringWhere the test goes, when not to the user themselves.
Up to 320 charactersFormatemail
Also available in
listAutomationVersions
The published versions of an automation, the newest first: number, when it was published and whether it is the one running. includeDefinitions adds each definition as JSON. restoreAutomationVersion copies one back into the draft.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 charactersincludeDefinitionsboolean- Default
false
Also available in
restoreAutomationVersion
Copy the definition of an earlier version back into the draft, replacing what the draft holds. Nothing that is running changes until publishAutomation.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 charactersversionintegerRequiredThe version number, from listAutomationVersions.
At least 1
Also available in
getAutomationStats
How one automation did over a window, 30 days by default: contacts that entered, are in it now, completed it or left early, emails sent, delivered, opened, clicked, bounced and marked as spam, and unsubscribes, in total and for each step. Opens are a floor, because many mail apps hide them. includeDaily adds a line for each day, a calendar day in the time zone of the automation.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 characterssincestringWhere the window starts, as an ISO 8601 instant.
Formatdate-timeuntilstringWhere the window ends, as an ISO 8601 instant. Left out, now.
Formatdate-timeincludeDailyboolean- Default
false
Also available in
listAutomationEnrollments
The contacts that are in an automation or have been, the most recent entry first: which step each is at, what they are waiting for, what holds a step that is due, when they move next and how it ended. Narrow it by status, by step or by a piece of the address or name. One page at a time: when more follow, the last line gives a cursor.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 charactersstatusstring- One of
"active""completed""exited" stepKeystring- 1 to 64 characters
qstring- Up to 200 characters
limitinteger- At least 1At most 200
cursorstring- 1 to 64 characters
Also available in
- API
GET /automations/{id}/enrollments- TypeScript
automations.listEnrollments()automations.listAllEnrollments()automations.iterateEnrollments()- Python
automations.list_enrollments()automations.list_all_enrollments()automations.iterate_enrollments()- Ruby
automations.list_enrollmentsautomations.list_all_enrollmentsautomations.iterate_enrollments- PHP
automations->listEnrollmentsautomations->listAllEnrollmentsautomations->iterateEnrollments- Go
Automations.ListEnrollmentsAutomations.ListAllEnrollmentsAutomations.IterateEnrollments- Java
automations().listEnrollmentsautomations().listAllEnrollmentsautomations().iterateEnrollments- C#
Automations.ListEnrollmentsAsyncAutomations.ListAllEnrollmentsAsyncAutomations.IterateEnrollmentsAsync
getAutomationEnrollment
One contact's way through an automation: where they are, and what each step did for them, oldest first, such as an email sent, a wait, a yes or no at a branch, or why a step was skipped or failed.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 charactersenrollmentIdstringRequiredThe enrollment, by id (aen_...), from listAutomationEnrollments.
1 to 64 characters
Also available in
enrollInAutomation
Put one contact into a live automation at its first step, whatever starts it normally, so its emails start going to them. The contact has to exist already. A contact is in an automation once at a time, and an address that is suppressed or unsubscribed is refused. An automation that sends or answers email also needs permission to send mail.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 charactersemailstringRequiredThe contact to enroll, by email address.
Up to 320 charactersFormatemaildataRecord<string, any>Values the steps read wherever a value comes from the event, such as an order number. At most 50 keys and 4 KB of JSON. The key email is kept for the email an automation answers and is refused.
Also available in
removeFromAutomation
Take one contact out of an automation at once, by the id of their enrollment from listAutomationEnrollments. They get nothing more from it, and stay in the contacts and in their audiences.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 charactersenrollmentIdstringRequiredThe enrollment, by id (aen_...), from listAutomationEnrollments.
1 to 64 characters
Also available in
sendContactEvent
Record that something happened to one contact, such as order.placed or trial.started. Every live automation that starts on that event name takes the contact in, so its emails start going to them, and a wait step holding out for the name moves on. The answer says which automations it started. Events are kept for 90 days.
Inputs
namestringRequiredWhat happened, such as order.placed: letters, digits, dots, colons, dashes and underscores. Names are matched exactly, case included.
1 to 100 charactersemailstringRequiredThe contact the event is about, by email address.
Up to 320 charactersFormatemailpropertiesRecord<string, any>Details of the event as a JSON object, at most 50 keys and 4 KB. An event trigger can filter on them and steps can use them, except a property named email, which never reaches the steps.
occurredAtstringWhen it happened, as an ISO 8601 instant. Left out, it is now. Not in the future, and at most 90 days ago.
Formatdate-timecreateContactbooleantrue adds the address to the contacts when nobody has it yet.
contactNamestringThe name to give a contact that createContact adds.
Up to 200 characters
sendContactEvents
Record up to 100 events in one call, each handled as sendContactEvent handles one, in order. One event failing does not stop the rest: the answer says which were recorded, what each started, and why any was not.
Inputs
eventsobject[]Required- 1 to 100 items
namestringRequiredWhat happened, such as order.placed: letters, digits, dots, colons, dashes and underscores. Names are matched exactly, case included.
1 to 100 charactersemailstringRequiredThe contact the event is about, by email address.
Up to 320 charactersFormatemailpropertiesRecord<string, any>Details of the event as a JSON object, at most 50 keys and 4 KB. An event trigger can filter on them and steps can use them, except a property named email, which never reaches the steps.
occurredAtstringWhen it happened, as an ISO 8601 instant. Left out, it is now. Not in the future, and at most 90 days ago.
Formatdate-timecreateContactbooleantrue adds the address to the contacts when nobody has it yet.
contactNamestringThe name to give a contact that createContact adds.
Up to 200 characters
listContactEventNames
The names of the events this workspace has recorded in the last 90 days, to choose the event that starts an automation or that a wait step holds out for.
Inputs
Takes no input.
Also available in
listContactEvents
The events recorded for one contact in the last 90 days, the most recent first: name, when it happened and its properties. Narrow it to one event name. One page at a time: when more follow, the last line gives a cursor.
Inputs
emailstringRequiredThe contact the event is about, by email address.
3 to 320 charactersnamestring- 1 to 100 characters
limitinteger- At least 1At most 200
cursorstring- 1 to 64 characters
Also available in
- API
GET /contacts/{email}/events- TypeScript
contacts.listEvents()contacts.listAllEvents()contacts.iterateEvents()- Python
contacts.list_events()contacts.list_all_events()contacts.iterate_events()- Ruby
contacts.list_eventscontacts.list_all_eventscontacts.iterate_events- PHP
contacts->listEventscontacts->listAllEventscontacts->iterateEvents- Go
Contacts.ListEventsContacts.ListAllEventsContacts.IterateEvents- Java
contacts().listEventscontacts().listAllEventscontacts().iterateEvents- C#
Contacts.ListEventsAsyncContacts.ListAllEventsAsyncContacts.IterateEventsAsync
getAutomationAnalytics
How all the automations of the workspace did over a window, 30 days by default: how many there are and how many are live, contacts that entered, are in one now, completed or left early, and emails sent, delivered, opened, clicked, bounced and marked as spam, and unsubscribes, in total and for each automation. ids narrows the totals and the days to some automations; every automation still gets its own line. includeDaily adds a line for each day, each counted in the time zone of its automation.
Inputs
idsstring[]- Up to 50 items
sincestringWhere the window starts, as an ISO 8601 instant.
Formatdate-timeuntilstringWhere the window ends, as an ISO 8601 instant. Left out, now.
Formatdate-timeincludeDailyboolean- Default
false
Also available in
listAutomationRuns
What an automation did, newest first: each contact entering, every step it ran for them with its outcome (an email sent, a wait, a yes or no at a branch, a step skipped or failed and why), and each contact completing or leaving early with the reason. Narrow it to one kind of entry, to one step or to one outcome. One page at a time: when more follow, the last line gives a cursor.
Inputs
idstringRequiredThe automation, by id (aut_...). listAutomations finds it by name.
1 to 64 characterseventstring- One of
"entered""step""completed""exited" stepKeystring- 1 to 64 characters
outcomestring- One of
"sent""skipped""waited""yes""no""added""removed""updated""called""exited""failed" limitinteger- At least 1At most 200
cursorstring- 1 to 120 characters
Also available in
- API
GET /automations/{id}/runs- TypeScript
automations.listRuns()automations.listAllRuns()automations.iterateRuns()- Python
automations.list_runs()automations.list_all_runs()automations.iterate_runs()- Ruby
automations.list_runsautomations.list_all_runsautomations.iterate_runs- PHP
automations->listRunsautomations->listAllRunsautomations->iterateRuns- Go
Automations.ListRunsAutomations.ListAllRunsAutomations.IterateRuns- Java
automations().listRunsautomations().listAllRunsautomations().iterateRuns- C#
Automations.ListRunsAsyncAutomations.ListAllRunsAsyncAutomations.IterateRunsAsync
listThreadAutomations
Which automations ran on an email thread and what each did, newest first: the automation, what started it and the case the email matched (the address or domain that received it, the sender rule and the filters that held), the messages of the thread it started from or sent, such as an automatic reply, and every step it ran with its outcome, such as a yes or no at a branch. Give it a thread id.
Inputs
threadIdstringRequired- 1 to 256 characters
Also available in
- API
GET /threads/{id}GET /threads/{id}/automations- TypeScript
threads.get()threads.listAutomations()- Python
threads.get()threads.list_automations()- Ruby
threads.getthreads.list_automations- PHP
threads->getthreads->listAutomations- Go
Threads.GetThreads.ListAutomations- Java
threads().getthreads().listAutomations- C#
Threads.GetAsyncThreads.ListAutomationsAsync