---
title: "Automations"
description: "Emails and steps that run by themselves for each contact, and the events that start them."
url: "https://nextmail.sh/docs/mcp/tools/automations"
area: "MCP server"
category: "Tools"
---

# 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. |

> Reading needs `automations:read` and every change needs `automations:write`. 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. `emptyAudience` never asks for a code. The API Authentication page lists every tool that asks, and shows how to ask for a code and verify it.

> 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`.

## Reference

### `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.

- Scopes: `automations:read`.
- The app's assistant runs it without asking.
- Toolkit: `automations`.

**Inputs**

- `status` (`string`, one of `"draft"`, `"live"`, `"paused"`, `"archived"`)
- `limit` (`integer`, at least 1, at most 100)
- `cursor` (`string`, 1 to 64 characters)

Also available in: API [`GET /automations`](https://nextmail.sh/docs/api/reference/automations#get-automations); TypeScript [`nextmail.automations.list()`](https://nextmail.sh/docs/sdk/reference/automations#list), [`nextmail.automations.listAll()`](https://nextmail.sh/docs/sdk/reference/automations#listAll), [`nextmail.automations.iterate()`](https://nextmail.sh/docs/sdk/reference/automations#iterate); Python [`automations.list()`](https://nextmail.sh/docs/python/reference/automations#list), [`automations.list_all()`](https://nextmail.sh/docs/python/reference/automations#listAll), [`automations.iterate()`](https://nextmail.sh/docs/python/reference/automations#iterate); Ruby [`automations.list`](https://nextmail.sh/docs/ruby/reference/automations#list), [`automations.list_all`](https://nextmail.sh/docs/ruby/reference/automations#listAll), [`automations.iterate`](https://nextmail.sh/docs/ruby/reference/automations#iterate); PHP [`automations->list`](https://nextmail.sh/docs/php/reference/automations#list), [`automations->listAll`](https://nextmail.sh/docs/php/reference/automations#listAll), [`automations->iterate`](https://nextmail.sh/docs/php/reference/automations#iterate); Go [`Automations.List`](https://nextmail.sh/docs/go/reference/automations#list), [`Automations.ListAll`](https://nextmail.sh/docs/go/reference/automations#listAll), [`Automations.Iterate`](https://nextmail.sh/docs/go/reference/automations#iterate); Java [`automations().list`](https://nextmail.sh/docs/java/reference/automations#list), [`automations().listAll`](https://nextmail.sh/docs/java/reference/automations#listAll), [`automations().iterate`](https://nextmail.sh/docs/java/reference/automations#iterate); C# [`Automations.ListAsync`](https://nextmail.sh/docs/csharp/reference/automations#list), [`Automations.ListAllAsync`](https://nextmail.sh/docs/csharp/reference/automations#listAll), [`Automations.IterateAsync`](https://nextmail.sh/docs/csharp/reference/automations#iterate).

### `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.

- Scopes: `automations:read`.
- The app's assistant runs it without asking.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.
- `includePublished` (`boolean`, default `false`)

Also available in: API [`GET /automations/{id}`](https://nextmail.sh/docs/api/reference/automations#get-automations-id); TypeScript [`nextmail.automations.get()`](https://nextmail.sh/docs/sdk/reference/automations#get); Python [`automations.get()`](https://nextmail.sh/docs/python/reference/automations#get); Ruby [`automations.get`](https://nextmail.sh/docs/ruby/reference/automations#get); PHP [`automations->get`](https://nextmail.sh/docs/php/reference/automations#get); Go [`Automations.Get`](https://nextmail.sh/docs/go/reference/automations#get); Java [`automations().get`](https://nextmail.sh/docs/java/reference/automations#get); C# [`Automations.GetAsync`](https://nextmail.sh/docs/csharp/reference/automations#get).

### `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.

- Scopes: `automations:read`.
- The app's assistant runs it without asking.
- Toolkit: `automations`.

**Inputs**

Takes no input.

Also available in: API [`GET /automations/starters`](https://nextmail.sh/docs/api/reference/automations#get-automations-starters); TypeScript [`nextmail.automations.listStarters()`](https://nextmail.sh/docs/sdk/reference/automations#listStarters); Python [`automations.list_starters()`](https://nextmail.sh/docs/python/reference/automations#listStarters); Ruby [`automations.list_starters`](https://nextmail.sh/docs/ruby/reference/automations#listStarters); PHP [`automations->listStarters`](https://nextmail.sh/docs/php/reference/automations#listStarters); Go [`Automations.ListStarters`](https://nextmail.sh/docs/go/reference/automations#listStarters); Java [`automations().listStarters`](https://nextmail.sh/docs/java/reference/automations#listStarters); C# [`Automations.ListStartersAsync`](https://nextmail.sh/docs/csharp/reference/automations#listStarters).

### `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. 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.

- Scopes: `automations:write`.
- The app's assistant asks first unless you asked for it.
- Toolkit: `automations`.

**Inputs**

- `name` (`string`, required, 1 to 120 characters): A short name for the automation. Contacts never see it.
- `description` (`string`, up to 500 characters): One line about what it is for.
- `starter` (`string`, 1 to 64 characters)
- `definition` (`Record<string, any> | string`): The 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": [], "threadId": null, "match": "any", "filters": []}, which starts when somebody writes to the workspace: addresses and domains are the workspace's own and both empty means any address, 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, and ai_check with question, a yes or no question the AI answers about the contact's email. To answer people who write in, use email_received, 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 and domains ([]), threadId (null), match ("any"), and on a send_email step templateVersion, replyTo and subject (null) and props ({}). 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.
- `settings` (`Record<string, any> | string`): How 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: API [`POST /automations`](https://nextmail.sh/docs/api/reference/automations#post-automations); TypeScript [`nextmail.automations.create()`](https://nextmail.sh/docs/sdk/reference/automations#create); Python [`automations.create()`](https://nextmail.sh/docs/python/reference/automations#create); Ruby [`automations.create`](https://nextmail.sh/docs/ruby/reference/automations#create); PHP [`automations->create`](https://nextmail.sh/docs/php/reference/automations#create); Go [`Automations.Create`](https://nextmail.sh/docs/go/reference/automations#create); Java [`automations().create`](https://nextmail.sh/docs/java/reference/automations#create); C# [`Automations.CreateAsync`](https://nextmail.sh/docs/csharp/reference/automations#create).

### `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.

- Scopes: `automations:write`.
- The app's assistant asks first unless you asked for it.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.
- `name` (`string`, 1 to 120 characters)
- `description` (`string`, nullable, up to 500 characters)
- `definition` (`Record<string, any> | string`): The 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": [], "threadId": null, "match": "any", "filters": []}, which starts when somebody writes to the workspace: addresses and domains are the workspace's own and both empty means any address, 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, and ai_check with question, a yes or no question the AI answers about the contact's email. To answer people who write in, use email_received, 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 and domains ([]), threadId (null), match ("any"), and on a send_email step templateVersion, replyTo and subject (null) and props ({}). 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.
- `settings` (`Record<string, any> | string`): How 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).
- `expectedUpdatedAt` (`string`, format `date-time`): The Updated time getAutomation gave. When somebody saved the automation since, the change is refused instead of written over theirs.

Also available in: API [`PATCH /automations/{id}`](https://nextmail.sh/docs/api/reference/automations#patch-automations-id); TypeScript [`nextmail.automations.update()`](https://nextmail.sh/docs/sdk/reference/automations#update); Python [`automations.update()`](https://nextmail.sh/docs/python/reference/automations#update); Ruby [`automations.update`](https://nextmail.sh/docs/ruby/reference/automations#update); PHP [`automations->update`](https://nextmail.sh/docs/php/reference/automations#update); Go [`Automations.Update`](https://nextmail.sh/docs/go/reference/automations#update); Java [`automations().update`](https://nextmail.sh/docs/java/reference/automations#update); C# [`Automations.UpdateAsync`](https://nextmail.sh/docs/csharp/reference/automations#update).

### `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.

- Scopes: `automations:write`.
- The app's assistant always asks first.
- Asks for a verification code, the same as [`DELETE /automations/{id}`](https://nextmail.sh/docs/api/reference/automations#delete-automations-id).
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.

Also available in: API [`DELETE /automations/{id}`](https://nextmail.sh/docs/api/reference/automations#delete-automations-id); TypeScript [`nextmail.automations.delete()`](https://nextmail.sh/docs/sdk/reference/automations#delete); Python [`automations.delete()`](https://nextmail.sh/docs/python/reference/automations#delete); Ruby [`automations.delete`](https://nextmail.sh/docs/ruby/reference/automations#delete); PHP [`automations->delete`](https://nextmail.sh/docs/php/reference/automations#delete); Go [`Automations.Delete`](https://nextmail.sh/docs/go/reference/automations#delete); Java [`automations().delete`](https://nextmail.sh/docs/java/reference/automations#delete); C# [`Automations.DeleteAsync`](https://nextmail.sh/docs/csharp/reference/automations#delete).

### `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.

- Scopes: `automations:write`, `emails:send`.
- The app's assistant always asks first.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.

Also available in: API [`POST /automations/{id}/publish`](https://nextmail.sh/docs/api/reference/automations#post-automations-id-publish); TypeScript [`nextmail.automations.publish()`](https://nextmail.sh/docs/sdk/reference/automations#publish); Python [`automations.publish()`](https://nextmail.sh/docs/python/reference/automations#publish); Ruby [`automations.publish`](https://nextmail.sh/docs/ruby/reference/automations#publish); PHP [`automations->publish`](https://nextmail.sh/docs/php/reference/automations#publish); Go [`Automations.Publish`](https://nextmail.sh/docs/go/reference/automations#publish); Java [`automations().publish`](https://nextmail.sh/docs/java/reference/automations#publish); C# [`Automations.PublishAsync`](https://nextmail.sh/docs/csharp/reference/automations#publish).

### `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.

- Scopes: `automations:write`.
- The app's assistant asks first unless you asked for it.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.

Also available in: API [`POST /automations/{id}/pause`](https://nextmail.sh/docs/api/reference/automations#post-automations-id-pause); TypeScript [`nextmail.automations.pause()`](https://nextmail.sh/docs/sdk/reference/automations#pause); Python [`automations.pause()`](https://nextmail.sh/docs/python/reference/automations#pause); Ruby [`automations.pause`](https://nextmail.sh/docs/ruby/reference/automations#pause); PHP [`automations->pause`](https://nextmail.sh/docs/php/reference/automations#pause); Go [`Automations.Pause`](https://nextmail.sh/docs/go/reference/automations#pause); Java [`automations().pause`](https://nextmail.sh/docs/java/reference/automations#pause); C# [`Automations.PauseAsync`](https://nextmail.sh/docs/csharp/reference/automations#pause).

### `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.

- Scopes: `automations:write`, `emails:send`.
- The app's assistant always asks first.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.

Also available in: API [`POST /automations/{id}/resume`](https://nextmail.sh/docs/api/reference/automations#post-automations-id-resume); TypeScript [`nextmail.automations.resume()`](https://nextmail.sh/docs/sdk/reference/automations#resume); Python [`automations.resume()`](https://nextmail.sh/docs/python/reference/automations#resume); Ruby [`automations.resume`](https://nextmail.sh/docs/ruby/reference/automations#resume); PHP [`automations->resume`](https://nextmail.sh/docs/php/reference/automations#resume); Go [`Automations.Resume`](https://nextmail.sh/docs/go/reference/automations#resume); Java [`automations().resume`](https://nextmail.sh/docs/java/reference/automations#resume); C# [`Automations.ResumeAsync`](https://nextmail.sh/docs/csharp/reference/automations#resume).

### `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.

- Scopes: `automations:write`.
- The app's assistant always asks first.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.

Also available in: API [`POST /automations/{id}/archive`](https://nextmail.sh/docs/api/reference/automations#post-automations-id-archive); TypeScript [`nextmail.automations.archive()`](https://nextmail.sh/docs/sdk/reference/automations#archive); Python [`automations.archive()`](https://nextmail.sh/docs/python/reference/automations#archive); Ruby [`automations.archive`](https://nextmail.sh/docs/ruby/reference/automations#archive); PHP [`automations->archive`](https://nextmail.sh/docs/php/reference/automations#archive); Go [`Automations.Archive`](https://nextmail.sh/docs/go/reference/automations#archive); Java [`automations().archive`](https://nextmail.sh/docs/java/reference/automations#archive); C# [`Automations.ArchiveAsync`](https://nextmail.sh/docs/csharp/reference/automations#archive).

### `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.

- Scopes: `automations:write`.
- The app's assistant asks first unless you asked for it.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.

Also available in: API [`POST /automations/{id}/duplicate`](https://nextmail.sh/docs/api/reference/automations#post-automations-id-duplicate); TypeScript [`nextmail.automations.duplicate()`](https://nextmail.sh/docs/sdk/reference/automations#duplicate); Python [`automations.duplicate()`](https://nextmail.sh/docs/python/reference/automations#duplicate); Ruby [`automations.duplicate`](https://nextmail.sh/docs/ruby/reference/automations#duplicate); PHP [`automations->duplicate`](https://nextmail.sh/docs/php/reference/automations#duplicate); Go [`Automations.Duplicate`](https://nextmail.sh/docs/go/reference/automations#duplicate); Java [`automations().duplicate`](https://nextmail.sh/docs/java/reference/automations#duplicate); C# [`Automations.DuplicateAsync`](https://nextmail.sh/docs/csharp/reference/automations#duplicate).

### `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.

- Scopes: `automations:write`, `emails:send`.
- The app's assistant always asks first.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.
- `stepKey` (`string`, required, 1 to 64 characters): The key of the email step, from the definition getAutomation returns.
- `to` (`string`, up to 320 characters, format `email`): Where the test goes, when not to the user themselves.

Also available in: API [`POST /automations/{id}/test`](https://nextmail.sh/docs/api/reference/automations#post-automations-id-test); TypeScript [`nextmail.automations.sendTest()`](https://nextmail.sh/docs/sdk/reference/automations#sendTest); Python [`automations.send_test()`](https://nextmail.sh/docs/python/reference/automations#sendTest); Ruby [`automations.send_test`](https://nextmail.sh/docs/ruby/reference/automations#sendTest); PHP [`automations->sendTest`](https://nextmail.sh/docs/php/reference/automations#sendTest); Go [`Automations.SendTest`](https://nextmail.sh/docs/go/reference/automations#sendTest); Java [`automations().sendTest`](https://nextmail.sh/docs/java/reference/automations#sendTest); C# [`Automations.SendTestAsync`](https://nextmail.sh/docs/csharp/reference/automations#sendTest).

### `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.

- Scopes: `automations:read`.
- The app's assistant runs it without asking.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.
- `includeDefinitions` (`boolean`, default `false`)

Also available in: API [`GET /automations/{id}/versions`](https://nextmail.sh/docs/api/reference/automations#get-automations-id-versions); TypeScript [`nextmail.automations.listVersions()`](https://nextmail.sh/docs/sdk/reference/automations#listVersions); Python [`automations.list_versions()`](https://nextmail.sh/docs/python/reference/automations#listVersions); Ruby [`automations.list_versions`](https://nextmail.sh/docs/ruby/reference/automations#listVersions); PHP [`automations->listVersions`](https://nextmail.sh/docs/php/reference/automations#listVersions); Go [`Automations.ListVersions`](https://nextmail.sh/docs/go/reference/automations#listVersions); Java [`automations().listVersions`](https://nextmail.sh/docs/java/reference/automations#listVersions); C# [`Automations.ListVersionsAsync`](https://nextmail.sh/docs/csharp/reference/automations#listVersions).

### `restoreAutomationVersion`

Copy the definition of an earlier version back into the draft, replacing what the draft holds. Nothing that is running changes until publishAutomation.

- Scopes: `automations:write`.
- The app's assistant asks first unless you asked for it.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.
- `version` (`integer`, required, at least 1): The version number, from listAutomationVersions.

Also available in: API [`POST /automations/{id}/versions/{version}/restore`](https://nextmail.sh/docs/api/reference/automations#post-automations-id-versions-version-restore); TypeScript [`nextmail.automations.restoreVersion()`](https://nextmail.sh/docs/sdk/reference/automations#restoreVersion); Python [`automations.restore_version()`](https://nextmail.sh/docs/python/reference/automations#restoreVersion); Ruby [`automations.restore_version`](https://nextmail.sh/docs/ruby/reference/automations#restoreVersion); PHP [`automations->restoreVersion`](https://nextmail.sh/docs/php/reference/automations#restoreVersion); Go [`Automations.RestoreVersion`](https://nextmail.sh/docs/go/reference/automations#restoreVersion); Java [`automations().restoreVersion`](https://nextmail.sh/docs/java/reference/automations#restoreVersion); C# [`Automations.RestoreVersionAsync`](https://nextmail.sh/docs/csharp/reference/automations#restoreVersion).

### `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.

- Scopes: `automations:read`.
- The app's assistant runs it without asking.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.
- `since` (`string`, format `date-time`): Where the window starts, as an ISO 8601 instant.
- `until` (`string`, format `date-time`): Where the window ends, as an ISO 8601 instant. Left out, now.
- `includeDaily` (`boolean`, default `false`)

Also available in: API [`GET /automations/{id}/stats`](https://nextmail.sh/docs/api/reference/automations#get-automations-id-stats); TypeScript [`nextmail.automations.stats()`](https://nextmail.sh/docs/sdk/reference/automations#stats); Python [`automations.stats()`](https://nextmail.sh/docs/python/reference/automations#stats); Ruby [`automations.stats`](https://nextmail.sh/docs/ruby/reference/automations#stats); PHP [`automations->stats`](https://nextmail.sh/docs/php/reference/automations#stats); Go [`Automations.Stats`](https://nextmail.sh/docs/go/reference/automations#stats); Java [`automations().stats`](https://nextmail.sh/docs/java/reference/automations#stats); C# [`Automations.StatsAsync`](https://nextmail.sh/docs/csharp/reference/automations#stats).

### `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.

- Scopes: `automations:read`.
- The app's assistant runs it without asking.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.
- `status` (`string`, one of `"active"`, `"completed"`, `"exited"`)
- `stepKey` (`string`, 1 to 64 characters)
- `q` (`string`, up to 200 characters)
- `limit` (`integer`, at least 1, at most 200)
- `cursor` (`string`, 1 to 64 characters)

Also available in: API [`GET /automations/{id}/enrollments`](https://nextmail.sh/docs/api/reference/automations#get-automations-id-enrollments); TypeScript [`nextmail.automations.listEnrollments()`](https://nextmail.sh/docs/sdk/reference/automations#listEnrollments), [`nextmail.automations.listAllEnrollments()`](https://nextmail.sh/docs/sdk/reference/automations#listAllEnrollments), [`nextmail.automations.iterateEnrollments()`](https://nextmail.sh/docs/sdk/reference/automations#iterateEnrollments); Python [`automations.list_enrollments()`](https://nextmail.sh/docs/python/reference/automations#listEnrollments), [`automations.list_all_enrollments()`](https://nextmail.sh/docs/python/reference/automations#listAllEnrollments), [`automations.iterate_enrollments()`](https://nextmail.sh/docs/python/reference/automations#iterateEnrollments); Ruby [`automations.list_enrollments`](https://nextmail.sh/docs/ruby/reference/automations#listEnrollments), [`automations.list_all_enrollments`](https://nextmail.sh/docs/ruby/reference/automations#listAllEnrollments), [`automations.iterate_enrollments`](https://nextmail.sh/docs/ruby/reference/automations#iterateEnrollments); PHP [`automations->listEnrollments`](https://nextmail.sh/docs/php/reference/automations#listEnrollments), [`automations->listAllEnrollments`](https://nextmail.sh/docs/php/reference/automations#listAllEnrollments), [`automations->iterateEnrollments`](https://nextmail.sh/docs/php/reference/automations#iterateEnrollments); Go [`Automations.ListEnrollments`](https://nextmail.sh/docs/go/reference/automations#listEnrollments), [`Automations.ListAllEnrollments`](https://nextmail.sh/docs/go/reference/automations#listAllEnrollments), [`Automations.IterateEnrollments`](https://nextmail.sh/docs/go/reference/automations#iterateEnrollments); Java [`automations().listEnrollments`](https://nextmail.sh/docs/java/reference/automations#listEnrollments), [`automations().listAllEnrollments`](https://nextmail.sh/docs/java/reference/automations#listAllEnrollments), [`automations().iterateEnrollments`](https://nextmail.sh/docs/java/reference/automations#iterateEnrollments); C# [`Automations.ListEnrollmentsAsync`](https://nextmail.sh/docs/csharp/reference/automations#listEnrollments), [`Automations.ListAllEnrollmentsAsync`](https://nextmail.sh/docs/csharp/reference/automations#listAllEnrollments), [`Automations.IterateEnrollmentsAsync`](https://nextmail.sh/docs/csharp/reference/automations#iterateEnrollments).

### `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.

- Scopes: `automations:read`.
- The app's assistant runs it without asking.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.
- `enrollmentId` (`string`, required, 1 to 64 characters): The enrollment, by id (aen_...), from listAutomationEnrollments.

Also available in: API [`GET /automations/{id}/enrollments/{enrollmentId}`](https://nextmail.sh/docs/api/reference/automations#get-automations-id-enrollments-enrollmentid); TypeScript [`nextmail.automations.getEnrollment()`](https://nextmail.sh/docs/sdk/reference/automations#getEnrollment); Python [`automations.get_enrollment()`](https://nextmail.sh/docs/python/reference/automations#getEnrollment); Ruby [`automations.get_enrollment`](https://nextmail.sh/docs/ruby/reference/automations#getEnrollment); PHP [`automations->getEnrollment`](https://nextmail.sh/docs/php/reference/automations#getEnrollment); Go [`Automations.GetEnrollment`](https://nextmail.sh/docs/go/reference/automations#getEnrollment); Java [`automations().getEnrollment`](https://nextmail.sh/docs/java/reference/automations#getEnrollment); C# [`Automations.GetEnrollmentAsync`](https://nextmail.sh/docs/csharp/reference/automations#getEnrollment).

### `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.

- Scopes: `automations:write`.
- The app's assistant always asks first.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.
- `email` (`string`, required, up to 320 characters, format `email`): The contact to enroll, by email address.
- `data` (`Record<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: API [`POST /automations/{id}/enrollments`](https://nextmail.sh/docs/api/reference/automations#post-automations-id-enrollments); TypeScript [`nextmail.automations.enroll()`](https://nextmail.sh/docs/sdk/reference/automations#enroll); Python [`automations.enroll()`](https://nextmail.sh/docs/python/reference/automations#enroll); Ruby [`automations.enroll`](https://nextmail.sh/docs/ruby/reference/automations#enroll); PHP [`automations->enroll`](https://nextmail.sh/docs/php/reference/automations#enroll); Go [`Automations.Enroll`](https://nextmail.sh/docs/go/reference/automations#enroll); Java [`automations().enroll`](https://nextmail.sh/docs/java/reference/automations#enroll); C# [`Automations.EnrollAsync`](https://nextmail.sh/docs/csharp/reference/automations#enroll).

### `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.

- Scopes: `automations:write`.
- The app's assistant asks first unless you asked for it.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.
- `enrollmentId` (`string`, required, 1 to 64 characters): The enrollment, by id (aen_...), from listAutomationEnrollments.

Also available in: API [`POST /automations/{id}/enrollments/{enrollmentId}/exit`](https://nextmail.sh/docs/api/reference/automations#post-automations-id-enrollments-enrollmentid-exit); TypeScript [`nextmail.automations.exitEnrollment()`](https://nextmail.sh/docs/sdk/reference/automations#exitEnrollment); Python [`automations.exit_enrollment()`](https://nextmail.sh/docs/python/reference/automations#exitEnrollment); Ruby [`automations.exit_enrollment`](https://nextmail.sh/docs/ruby/reference/automations#exitEnrollment); PHP [`automations->exitEnrollment`](https://nextmail.sh/docs/php/reference/automations#exitEnrollment); Go [`Automations.ExitEnrollment`](https://nextmail.sh/docs/go/reference/automations#exitEnrollment); Java [`automations().exitEnrollment`](https://nextmail.sh/docs/java/reference/automations#exitEnrollment); C# [`Automations.ExitEnrollmentAsync`](https://nextmail.sh/docs/csharp/reference/automations#exitEnrollment).

### `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.

- Scopes: `contacts:write`.
- The app's assistant always asks first.
- Toolkit: `automations`.

**Inputs**

- `name` (`string`, required, 1 to 100 characters): What happened, such as order.placed: letters, digits, dots, colons, dashes and underscores. Names are matched exactly, case included.
- `email` (`string`, required, up to 320 characters, format `email`): The contact the event is about, by email address.
- `properties` (`Record<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.
- `occurredAt` (`string`, format `date-time`): When it happened, as an ISO 8601 instant. Left out, it is now. Not in the future, and at most 90 days ago.
- `createContact` (`boolean`): true adds the address to the contacts when nobody has it yet.
- `contactName` (`string`, up to 200 characters): The name to give a contact that createContact adds.

### `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.

- Scopes: `contacts:write`.
- The app's assistant always asks first.
- Toolkit: `automations`.

**Inputs**

- `events` (`object[]`, required, 1 to 100 items)
  - `name` (`string`, required, 1 to 100 characters): What happened, such as order.placed: letters, digits, dots, colons, dashes and underscores. Names are matched exactly, case included.
  - `email` (`string`, required, up to 320 characters, format `email`): The contact the event is about, by email address.
  - `properties` (`Record<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.
  - `occurredAt` (`string`, format `date-time`): When it happened, as an ISO 8601 instant. Left out, it is now. Not in the future, and at most 90 days ago.
  - `createContact` (`boolean`): true adds the address to the contacts when nobody has it yet.
  - `contactName` (`string`, up to 200 characters): The name to give a contact that createContact adds.

### `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.

- Scopes: `automations:read`.
- The app's assistant runs it without asking.
- Toolkit: `automations`.

**Inputs**

Takes no input.

Also available in: API [`GET /events/names`](https://nextmail.sh/docs/api/reference/events#get-events-names); TypeScript [`nextmail.events.listNames()`](https://nextmail.sh/docs/sdk/reference/events#listNames); Python [`events.list_names()`](https://nextmail.sh/docs/python/reference/events#listNames); Ruby [`events.list_names`](https://nextmail.sh/docs/ruby/reference/events#listNames); PHP [`events->listNames`](https://nextmail.sh/docs/php/reference/events#listNames); Go [`Events.ListNames`](https://nextmail.sh/docs/go/reference/events#listNames); Java [`events().listNames`](https://nextmail.sh/docs/java/reference/events#listNames); C# [`Events.ListNamesAsync`](https://nextmail.sh/docs/csharp/reference/events#listNames).

### `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.

- Scopes: `contacts:read`.
- The app's assistant runs it without asking.
- Toolkit: `automations`.

**Inputs**

- `email` (`string`, required, 3 to 320 characters): The contact the event is about, by email address.
- `name` (`string`, 1 to 100 characters)
- `limit` (`integer`, at least 1, at most 200)
- `cursor` (`string`, 1 to 64 characters)

Also available in: API [`GET /contacts/{email}/events`](https://nextmail.sh/docs/api/reference/events#get-contacts-email-events); TypeScript [`nextmail.contacts.listEvents()`](https://nextmail.sh/docs/sdk/reference/contacts#listEvents), [`nextmail.contacts.listAllEvents()`](https://nextmail.sh/docs/sdk/reference/contacts#listAllEvents), [`nextmail.contacts.iterateEvents()`](https://nextmail.sh/docs/sdk/reference/contacts#iterateEvents); Python [`contacts.list_events()`](https://nextmail.sh/docs/python/reference/contacts#listEvents), [`contacts.list_all_events()`](https://nextmail.sh/docs/python/reference/contacts#listAllEvents), [`contacts.iterate_events()`](https://nextmail.sh/docs/python/reference/contacts#iterateEvents); Ruby [`contacts.list_events`](https://nextmail.sh/docs/ruby/reference/contacts#listEvents), [`contacts.list_all_events`](https://nextmail.sh/docs/ruby/reference/contacts#listAllEvents), [`contacts.iterate_events`](https://nextmail.sh/docs/ruby/reference/contacts#iterateEvents); PHP [`contacts->listEvents`](https://nextmail.sh/docs/php/reference/contacts#listEvents), [`contacts->listAllEvents`](https://nextmail.sh/docs/php/reference/contacts#listAllEvents), [`contacts->iterateEvents`](https://nextmail.sh/docs/php/reference/contacts#iterateEvents); Go [`Contacts.ListEvents`](https://nextmail.sh/docs/go/reference/contacts#listEvents), [`Contacts.ListAllEvents`](https://nextmail.sh/docs/go/reference/contacts#listAllEvents), [`Contacts.IterateEvents`](https://nextmail.sh/docs/go/reference/contacts#iterateEvents); Java [`contacts().listEvents`](https://nextmail.sh/docs/java/reference/contacts#listEvents), [`contacts().listAllEvents`](https://nextmail.sh/docs/java/reference/contacts#listAllEvents), [`contacts().iterateEvents`](https://nextmail.sh/docs/java/reference/contacts#iterateEvents); C# [`Contacts.ListEventsAsync`](https://nextmail.sh/docs/csharp/reference/contacts#listEvents), [`Contacts.ListAllEventsAsync`](https://nextmail.sh/docs/csharp/reference/contacts#listAllEvents), [`Contacts.IterateEventsAsync`](https://nextmail.sh/docs/csharp/reference/contacts#iterateEvents).

### `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.

- Scopes: `automations:read`.
- The app's assistant runs it without asking.
- Toolkit: `automations`.

**Inputs**

- `ids` (`string[]`, up to 50 items)
- `since` (`string`, format `date-time`): Where the window starts, as an ISO 8601 instant.
- `until` (`string`, format `date-time`): Where the window ends, as an ISO 8601 instant. Left out, now.
- `includeDaily` (`boolean`, default `false`)

Also available in: API [`GET /automations/analytics`](https://nextmail.sh/docs/api/reference/automations#get-automations-analytics); TypeScript [`nextmail.automations.analytics()`](https://nextmail.sh/docs/sdk/reference/automations#analytics); Python [`automations.analytics()`](https://nextmail.sh/docs/python/reference/automations#analytics); Ruby [`automations.analytics`](https://nextmail.sh/docs/ruby/reference/automations#analytics); PHP [`automations->analytics`](https://nextmail.sh/docs/php/reference/automations#analytics); Go [`Automations.Analytics`](https://nextmail.sh/docs/go/reference/automations#analytics); Java [`automations().analytics`](https://nextmail.sh/docs/java/reference/automations#analytics); C# [`Automations.AnalyticsAsync`](https://nextmail.sh/docs/csharp/reference/automations#analytics).

### `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.

- Scopes: `automations:read`.
- The app's assistant runs it without asking.
- Toolkit: `automations`.

**Inputs**

- `id` (`string`, required, 1 to 64 characters): The automation, by id (aut_...). listAutomations finds it by name.
- `event` (`string`, one of `"entered"`, `"step"`, `"completed"`, `"exited"`)
- `stepKey` (`string`, 1 to 64 characters)
- `outcome` (`string`, one of `"sent"`, `"skipped"`, `"waited"`, `"yes"`, `"no"`, `"added"`, `"removed"`, `"updated"`, `"called"`, `"exited"`, `"failed"`)
- `limit` (`integer`, at least 1, at most 200)
- `cursor` (`string`, 1 to 120 characters)

Also available in: API [`GET /automations/{id}/runs`](https://nextmail.sh/docs/api/reference/automations#get-automations-id-runs); TypeScript [`nextmail.automations.listRuns()`](https://nextmail.sh/docs/sdk/reference/automations#listRuns), [`nextmail.automations.listAllRuns()`](https://nextmail.sh/docs/sdk/reference/automations#listAllRuns), [`nextmail.automations.iterateRuns()`](https://nextmail.sh/docs/sdk/reference/automations#iterateRuns); Python [`automations.list_runs()`](https://nextmail.sh/docs/python/reference/automations#listRuns), [`automations.list_all_runs()`](https://nextmail.sh/docs/python/reference/automations#listAllRuns), [`automations.iterate_runs()`](https://nextmail.sh/docs/python/reference/automations#iterateRuns); Ruby [`automations.list_runs`](https://nextmail.sh/docs/ruby/reference/automations#listRuns), [`automations.list_all_runs`](https://nextmail.sh/docs/ruby/reference/automations#listAllRuns), [`automations.iterate_runs`](https://nextmail.sh/docs/ruby/reference/automations#iterateRuns); PHP [`automations->listRuns`](https://nextmail.sh/docs/php/reference/automations#listRuns), [`automations->listAllRuns`](https://nextmail.sh/docs/php/reference/automations#listAllRuns), [`automations->iterateRuns`](https://nextmail.sh/docs/php/reference/automations#iterateRuns); Go [`Automations.ListRuns`](https://nextmail.sh/docs/go/reference/automations#listRuns), [`Automations.ListAllRuns`](https://nextmail.sh/docs/go/reference/automations#listAllRuns), [`Automations.IterateRuns`](https://nextmail.sh/docs/go/reference/automations#iterateRuns); Java [`automations().listRuns`](https://nextmail.sh/docs/java/reference/automations#listRuns), [`automations().listAllRuns`](https://nextmail.sh/docs/java/reference/automations#listAllRuns), [`automations().iterateRuns`](https://nextmail.sh/docs/java/reference/automations#iterateRuns); C# [`Automations.ListRunsAsync`](https://nextmail.sh/docs/csharp/reference/automations#listRuns), [`Automations.ListAllRunsAsync`](https://nextmail.sh/docs/csharp/reference/automations#listAllRuns), [`Automations.IterateRunsAsync`](https://nextmail.sh/docs/csharp/reference/automations#iterateRuns).
