Automatisations
Des e-mails et des étapes qui s'exécutent tout seuls pour chaque contact, et les événements qui les déclenchent.
Outils d'automatisation
| Outil | Ce qu'il fait |
|---|---|
| listAutomations | Les automatisations de l'espace de travail, les plus récemment modifiées en premier, avec leur statut, ce qui déclenche chacune et le nombre de contacts en cours. |
| getAutomation | Une automatisation au complet : son statut, ses paramètres et ses chiffres, ce qui ne va pas dans son brouillon, et la définition du brouillon en JSON. includePublished ajoute la version qui s'exécute. |
| listAutomationStarters | Les automatisations prêtes à l'emploi dont une nouvelle peut partir, chacune avec sa définition. |
| createAutomation | Créer un brouillon à partir d'un point de départ, d'une définition écrite en JSON, ou vide, avec les paramètres de votre choix. Rien ne s'exécute avant la publication. |
| updateAutomation | Modifier le nom et les paramètres d'une automatisation, qui s'appliquent aussitôt, ou remplacer la définition de son brouillon. Une automatisation en ligne continue d'exécuter sa version publiée. |
| deleteAutomation | Supprimer définitivement une automatisation, avec ses versions, ses inscriptions et ses chiffres. Les contacts en cours s'arrêtent aussitôt. |
| publishAutomation | Faire du brouillon la version qui s'exécute et activer l'automatisation. Un brouillon incomplet est refusé avec chaque problème qui le bloque. Nécessite aussi emails:send. |
| pauseAutomation | Arrêter une automatisation en ligne. Plus personne n'entre, et toutes les personnes en cours restent où elles sont. |
| resumeAutomation | Réactiver une automatisation en pause avec la version qu'elle exécutait. Nécessite aussi emails:send. |
| archiveAutomation | Retirer définitivement une automatisation en gardant son historique. Toutes les personnes en cours en sortent. |
| duplicateAutomation | Copier une automatisation dans un nouveau brouillon, sans ses versions, ses contacts ni ses chiffres. |
| sendAutomationTest | Envoyer l'e-mail d'une étape du brouillon à vous-même ou à une adresse. Nécessite aussi emails:send. |
| listAutomationVersions | Les versions publiées, de la plus récente à la plus ancienne, et celle qui s'exécute. includeDefinitions ajoute chaque définition. |
| restoreAutomationVersion | Recopier une version antérieure dans le brouillon. Rien de ce qui s'exécute ne change avant la prochaine publication. |
| getAutomationStats | Les contacts entrés, en cours, ayant terminé et sortis, et les e-mails envoyés, délivrés, ouverts et cliqués sur une période, au total et par étape. |
| listAutomationEnrollments | Les contacts qui sont ou ont été dans une automatisation, une page à la fois, avec l'étape où se trouve chacun et la façon dont son parcours s'est terminé. Filtrez par statut, par étape ou par un fragment de l'adresse. |
| getAutomationEnrollment | Le parcours d'un contact dans une automatisation : ce que chaque étape a fait pour lui, de la plus ancienne à la plus récente. |
| enrollInAutomation | Faire entrer un contact dans une automatisation en ligne à sa première étape, quel que soit son déclencheur habituel. |
| removeFromAutomation | Retirer un contact d'une automatisation, immédiatement. |
| sendContactEvent | Enregistrer qu'il est arrivé quelque chose à un contact. Cela démarre les automatisations en ligne dont le déclencheur nomme l'événement et met fin aux attentes qui le guettaient. |
| sendContactEvents | Enregistrer jusqu'à 100 événements en un appel. L'échec de l'un n'arrête pas les autres. |
| listContactEventNames | Les noms d'événements que l'espace de travail a enregistrés ces 90 derniers jours. |
| listContactEvents | Les événements enregistrés pour un contact, les plus récents en premier, une page à la fois. |
La lecture nécessite automations:read et chaque modification automations:write. Publier, reprendre et envoyer un test nécessitent aussi emails:send, parce que l'automatisation envoie alors du courrier au nom de la personne qui l'a publiée. Envoyer un événement nécessite contacts:write, lire les événements d'un contact nécessite contacts:read, et listContactEventNames nécessite automations:read. Un client qui agit pour un membre ne voit que les automatisations créées par ce membre et les contacts qu'il a ajoutés.
Certains outils de ce serveur font un changement que l'API REST protège par un code de vérification, et demandent le même code. Tant que le client n'a pas vérifié de code dans les 60 dernières minutes, et que la personne n'a pas choisi Autoriser les modifications pendant 60 minutes pour lui dans Compte → Applications connectées, un tel outil répond par un résultat qui commence par Refused (step_up_required): et ne change rien. emptyAudience ne demande jamais de code. La page Authentification de l'API liste chaque outil qui en demande un, et montre comment demander un code et le vérifier.
Les outils appliquent les mêmes règles et les mêmes refus que l'API REST, et les pages /automations et /events de la référence de l'API décrivent chaque champ. Une définition se passe entière en JSON : lisez-la avec getAutomation, modifiez-la et repassez-la en entier à updateAutomation.
Référence
listAutomationsgetAutomationlistAutomationStarterscreateAutomationupdateAutomationdeleteAutomationpublishAutomationpauseAutomationresumeAutomationarchiveAutomationduplicateAutomationsendAutomationTestlistAutomationVersionsrestoreAutomationVersiongetAutomationStatslistAutomationEnrollmentsgetAutomationEnrollmentenrollInAutomationremoveFromAutomationsendContactEventsendContactEventslistContactEventNameslistContactEvents
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.
Entrées
statusstring- L'un de
"draft""live""paused""archived" limitinteger- Au moins 1Au plus 100
cursorstring- De 1 à 64 caractères
Aussi disponible dans
- 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.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractèresincludePublishedboolean- Par défaut
false
Aussi disponible dans
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.
Entrées
Ne prend aucune entrée.
Aussi disponible dans
createAutomation
Create an automation as a draft: from a starter (listAutomationStarters names them), from a definition written out as JSON, or empty. 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.
Entrées
namestringObligatoireA short name for the automation. Contacts never see it.
De 1 à 120 caractèresdescriptionstringOne line about what it is for.
Jusqu'à 500 caractèresstarterstring- De 1 à 64 caractères
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} and {"kind": "manual"}. 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"} and {"kind": "exit", "key"}. A wait can also be {"mode": "until", "weekdays": [1], "hour": 9, "minute": 0} or {"mode": "event", "eventName", "timeout": {"amount": 7, "unit": "days"}}. Conditions: email_opened and email_clicked with stepKey, in_audience with audienceId, field with field, operator and value, and event with eventName and withinDays. A props value is {"source": "static", "value"}, {"source": "contact", "field"} or {"source": "event", "path"}. Paths never join or loop. 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, 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).
Aussi disponible dans
updateAutomation
Change an automation. Its name, description and settings apply at once. definition replaces the whole draft, so start from getAutomation, change the JSON and pass all of it back. A live automation keeps running its published version until publishAutomation, and contacts already in it stay on the version they entered on. Pass only what changes.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractèresnamestring- De 1 à 120 caractères
descriptionstring- Peut être nullJusqu'à 500 caractères
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} and {"kind": "manual"}. 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"} and {"kind": "exit", "key"}. A wait can also be {"mode": "until", "weekdays": [1], "hour": 9, "minute": 0} or {"mode": "event", "eventName", "timeout": {"amount": 7, "unit": "days"}}. Conditions: email_opened and email_clicked with stepKey, in_audience with audienceId, field with field, operator and value, and event with eventName and withinDays. A props value is {"source": "static", "value"}, {"source": "contact", "field"} or {"source": "event", "path"}. Paths never join or loop. 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, 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
Aussi disponible dans
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.
- Demande un code de vérification
DELETE /automations/{id}
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractères
Aussi disponible dans
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.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractères
Aussi disponible dans
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.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractères
Aussi disponible dans
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.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractères
Aussi disponible dans
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.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractères
Aussi disponible dans
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.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractères
Aussi disponible dans
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.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractèresstepKeystringObligatoireThe key of the email step, from the definition getAutomation returns.
De 1 à 64 caractèrestostringWhere the test goes, when not to the user themselves.
Jusqu'à 320 caractèresFormatemail
Aussi disponible dans
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.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractèresincludeDefinitionsboolean- Par défaut
false
Aussi disponible dans
restoreAutomationVersion
Copy the definition of an earlier version back into the draft, replacing what the draft holds. Nothing that is running changes until publishAutomation.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractèresversionintegerObligatoireThe version number, from listAutomationVersions.
Au moins 1
Aussi disponible dans
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.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractèressincestringWhere the window starts, as an ISO 8601 instant.
Formatdate-timeuntilstringWhere the window ends, as an ISO 8601 instant. Left out, now.
Formatdate-timeincludeDailyboolean- Par défaut
false
Aussi disponible dans
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.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractèresstatusstring- L'un de
"active""completed""exited" stepKeystring- De 1 à 64 caractères
qstring- Jusqu'à 200 caractères
limitinteger- Au moins 1Au plus 200
cursorstring- De 1 à 64 caractères
Aussi disponible dans
- 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.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractèresenrollmentIdstringObligatoireThe enrollment, by id (aen_...), from listAutomationEnrollments.
De 1 à 64 caractères
Aussi disponible dans
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.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractèresemailstringObligatoireThe contact to enroll, by email address.
Jusqu'à 320 caractèresFormatemaildataRecord<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.
Aussi disponible dans
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.
Entrées
idstringObligatoireThe automation, by id (aut_...). listAutomations finds it by name.
De 1 à 64 caractèresenrollmentIdstringObligatoireThe enrollment, by id (aen_...), from listAutomationEnrollments.
De 1 à 64 caractères
Aussi disponible dans
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.
Entrées
namestringObligatoireWhat happened, such as order.placed: letters, digits, dots, colons, dashes and underscores. Names are matched exactly, case included.
De 1 à 100 caractèresemailstringObligatoireThe contact the event is about, by email address.
Jusqu'à 320 caractèresFormatemailpropertiesRecord<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.
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.
Jusqu'à 200 caractères
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.
Entrées
eventsobject[]Obligatoire- De 1 à 100 éléments
namestringObligatoireWhat happened, such as order.placed: letters, digits, dots, colons, dashes and underscores. Names are matched exactly, case included.
De 1 à 100 caractèresemailstringObligatoireThe contact the event is about, by email address.
Jusqu'à 320 caractèresFormatemailpropertiesRecord<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.
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.
Jusqu'à 200 caractères
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.
Entrées
Ne prend aucune entrée.
Aussi disponible dans
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.
Entrées
emailstringObligatoireThe contact the event is about, by email address.
De 3 à 320 caractèresnamestring- De 1 à 100 caractères
limitinteger- Au moins 1Au plus 200
cursorstring- De 1 à 64 caractères
Aussi disponible dans
- 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