# Automations

19 calls. Every request needs the `Authorization` header: see [the overview](https://docs.maitento.com/reference.md).

## `automations.list`

```http
GET /automated-actions
```

Every definition of the tenant, or of one namespace with `{ namespace }`.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=GET%20%2Fautomated-actions).

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md)`[]` (200)

```bash title="curl"
curl -X GET "https://api.maitento.com/automated-actions" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
const automations = await mt.automations.list();
```
```python title="Python"
mt.automations.list()
```

## `automations.delete`

```http
DELETE /automated-actions/by-id/{id}
```

Deletes the definition (refused with a 400 while something still uses it or a run of it is going).

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=DELETE%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |

**Response:** no body (204)

```bash title="curl"
curl -X DELETE "https://api.maitento.com/automated-actions/by-id/<id>" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
await mt.automations.delete("3d813cbb-47fb-42ba-91df-831e1593ac29");
```
```python title="Python"
mt.automations.delete("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b")
```

## `automations.get`

```http
GET /automated-actions/by-id/{id}
```

The definition with this id. Throws `NotFoundError` when there is none.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=GET%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md) (200)

```bash title="curl"
curl -X GET "https://api.maitento.com/automated-actions/by-id/<id>" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
const automation = await mt.automations.get("3d813cbb-47fb-42ba-91df-831e1593ac29");
```
```python title="Python"
mt.automations.get("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b")
```

## `automations.update`

```http
PUT /automated-actions/by-id/{id}
```

Replaces an automation's name, description and actions.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=PUT%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |

**Request body:** [`UpdateAutomatedActionRequest`](https://docs.maitento.com/reference/types/update-automated-action-request.md)

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | `string` |  | The automation's name, unique within the namespace. |
| `description` | `string \| null` |  | What the automation is for. |
| `actions` | [`AutomatedActionItemInput`](https://docs.maitento.com/reference/types/automated-action-item.md#in-a-request)`[]` |  | What the automation starts each time it fires, at least one: one run per action. Replaces the current list. |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md) (200)

```bash title="curl"
curl -X PUT "https://api.maitento.com/automated-actions/by-id/<id>" \
  -H "Authorization: $MAITENTO_AUTH" \
  -H "Content-Type: application/json" \
  -d '{"name":"...","description":"...","actions":[]}'
```
```ts title="TypeScript"
const automation = await mt.automations.update("3d813cbb-47fb-42ba-91df-831e1593ac29", { name: "nightly-digest", description: "Summarise the day" });
```
```python title="Python"
mt.automations.update("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b", name="nightly-digest", description="Summarise the day")
```

## `automations.history`

```http
GET /automated-actions/by-id/{id}/history
```

The automation's recent executions.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=GET%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D%2Fhistory).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |

**Query parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `limit` | `integer` |  |  |

**Response:** [`ExecutionHistoryEntry`](https://docs.maitento.com/reference/types/execution-history-entry.md)`[]` (200)

```bash title="curl"
curl -X GET "https://api.maitento.com/automated-actions/by-id/<id>/history" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
const history = await mt.automations.history("3d813cbb-47fb-42ba-91df-831e1593ac29", { limit: 20 });
```
```python title="Python"
mt.automations.history("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b", limit=50)
```

## `automations.addMessageTrigger`

```http
POST /automated-actions/by-id/{id}/message-triggers
```

Adds a message trigger.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=POST%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D%2Fmessage-triggers).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |

**Request body:** [`MessageTriggerInput`](https://docs.maitento.com/reference/types/message-trigger.md#in-a-request)

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` |  | The trigger's id. |
| `name` | `string \| null` |  | A name for the trigger. Optional. |
| `isEnabled` | `boolean` |  | Whether the trigger fires. Switch it off to pause it without deleting it. |
| `triggerType` | [`MessageTriggerType`](https://docs.maitento.com/reference/types/message-trigger-type.md) |  | Which kind of run's changes it listens to. |
| `eventFilter` | `string \| null` |  | A JSONPath expression over the change (the run is under `item`, with statuses as numbers): the trigger fires only when it matches. Null or empty: every change fires it, including changes to the runs it starts itself. |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md) (200)

```bash title="curl"
curl -X POST "https://api.maitento.com/automated-actions/by-id/<id>/message-triggers" \
  -H "Authorization: $MAITENTO_AUTH" \
  -H "Content-Type: application/json" \
  -d '{"id":"...","name":"...","isEnabled":false,"triggerType":"AppProcessUpdated","eventFilter":"..."}'
```
```ts title="TypeScript"
await mt.automations.addMessageTrigger("3d813cbb-47fb-42ba-91df-831e1593ac29", { triggerType: "InteractionProcessUpdated", eventFilter: "$[?(@.status == 'Finished')]" });
```
```python title="Python"
mt.automations.add_message_trigger("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b", trigger_type="InteractionProcessUpdated", event_filter="$[?(@.status == 'Finished')]")
```

## `automations.removeMessageTrigger`

```http
DELETE /automated-actions/by-id/{id}/message-triggers/{triggerId}
```

Removes a message trigger.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=DELETE%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D%2Fmessage-triggers%2F%7BtriggerId%7D).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |
| `triggerId` | `uuid` | yes |  |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md) (200)

```bash title="curl"
curl -X DELETE "https://api.maitento.com/automated-actions/by-id/<id>/message-triggers/<triggerId>" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
await mt.automations.removeMessageTrigger("3d813cbb-47fb-42ba-91df-831e1593ac29", "4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f");
```
```python title="Python"
mt.automations.remove_message_trigger("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b", "0a1b2c3d-4e5f-4a6b-9c7d-8e9f0a1b2c3d")
```

## `automations.updateMessageTrigger`

```http
PUT /automated-actions/by-id/{id}/message-triggers/{triggerId}
```

Replaces a message trigger.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=PUT%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D%2Fmessage-triggers%2F%7BtriggerId%7D).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |
| `triggerId` | `uuid` | yes |  |

**Request body:** [`MessageTriggerInput`](https://docs.maitento.com/reference/types/message-trigger.md#in-a-request)

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` |  | The trigger's id. |
| `name` | `string \| null` |  | A name for the trigger. Optional. |
| `isEnabled` | `boolean` |  | Whether the trigger fires. Switch it off to pause it without deleting it. |
| `triggerType` | [`MessageTriggerType`](https://docs.maitento.com/reference/types/message-trigger-type.md) |  | Which kind of run's changes it listens to. |
| `eventFilter` | `string \| null` |  | A JSONPath expression over the change (the run is under `item`, with statuses as numbers): the trigger fires only when it matches. Null or empty: every change fires it, including changes to the runs it starts itself. |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md) (200)

```bash title="curl"
curl -X PUT "https://api.maitento.com/automated-actions/by-id/<id>/message-triggers/<triggerId>" \
  -H "Authorization: $MAITENTO_AUTH" \
  -H "Content-Type: application/json" \
  -d '{"id":"...","name":"...","isEnabled":false,"triggerType":"AppProcessUpdated","eventFilter":"..."}'
```
```ts title="TypeScript"
await mt.automations.updateMessageTrigger("3d813cbb-47fb-42ba-91df-831e1593ac29", "4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f", { triggerType: "AppProcessUpdated" });
```
```python title="Python"
mt.automations.update_message_trigger("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b", "0a1b2c3d-4e5f-4a6b-9c7d-8e9f0a1b2c3d", trigger_type="AppProcessUpdated")
```

## `automations.disableMessageTrigger`

```http
POST /automated-actions/by-id/{id}/message-triggers/{triggerId}/disable
```

Disables a message trigger.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=POST%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D%2Fmessage-triggers%2F%7BtriggerId%7D%2Fdisable).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |
| `triggerId` | `uuid` | yes |  |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md) (200)

```bash title="curl"
curl -X POST "https://api.maitento.com/automated-actions/by-id/<id>/message-triggers/<triggerId>/disable" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
await mt.automations.disableMessageTrigger("3d813cbb-47fb-42ba-91df-831e1593ac29", "4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f");
```
```python title="Python"
mt.automations.disable_message_trigger("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b", "0a1b2c3d-4e5f-4a6b-9c7d-8e9f0a1b2c3d")
```

## `automations.enableMessageTrigger`

```http
POST /automated-actions/by-id/{id}/message-triggers/{triggerId}/enable
```

Enables a message trigger.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=POST%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D%2Fmessage-triggers%2F%7BtriggerId%7D%2Fenable).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |
| `triggerId` | `uuid` | yes |  |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md) (200)

```bash title="curl"
curl -X POST "https://api.maitento.com/automated-actions/by-id/<id>/message-triggers/<triggerId>/enable" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
await mt.automations.enableMessageTrigger("3d813cbb-47fb-42ba-91df-831e1593ac29", "4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f");
```
```python title="Python"
mt.automations.enable_message_trigger("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b", "0a1b2c3d-4e5f-4a6b-9c7d-8e9f0a1b2c3d")
```

## `automations.addSchedule`

```http
POST /automated-actions/by-id/{id}/schedules
```

Adds a cron schedule.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=POST%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D%2Fschedules).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |

**Request body:** [`CronScheduleInput`](https://docs.maitento.com/reference/types/cron-schedule.md#in-a-request)

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` |  | The schedule's id. |
| `name` | `string \| null` |  | A name for the schedule. Optional. |
| `isEnabled` | `boolean` |  | Whether the schedule triggers the automation. Switch it off to pause it without deleting it. |
| `second` | `string \| null` |  | The cron seconds field. Optional: set it for a six-field expression. |
| `minute` | `string` |  | The cron minutes field, such as `0` or `*/15`. |
| `hour` | `string` |  | The cron hours field, in UTC, such as `7`. |
| `dayOfMonth` | `string` |  | The cron day-of-month field. |
| `month` | `string` |  | The cron month field. |
| `dayOfWeek` | `string` |  | The cron day-of-week field, such as `1-5` for weekdays. |
| `nextOccurrence` | `datetime \| null` |  | When the schedule next triggers, in UTC. Set by Maitento. |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md) (200)

```bash title="curl"
curl -X POST "https://api.maitento.com/automated-actions/by-id/<id>/schedules" \
  -H "Authorization: $MAITENTO_AUTH" \
  -H "Content-Type: application/json" \
  -d '{"id":"...","name":"...","isEnabled":false,"second":"...","minute":"...","hour":"...","dayOfMonth":"...","month":"...","dayOfWeek":"...","nextOccurrence":"2026-01-01T00:00:00Z"}'
```
```ts title="TypeScript"
await mt.automations.addSchedule("3d813cbb-47fb-42ba-91df-831e1593ac29", { name: "weekdays-9am", minute: "0", hour: "9", dayOfWeek: "1-5" });
```
```python title="Python"
mt.automations.add_schedule("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b", minute="0", hour="7", day_of_week="1-5")
```

## `automations.removeSchedule`

```http
DELETE /automated-actions/by-id/{id}/schedules/{scheduleId}
```

Removes a schedule.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=DELETE%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D%2Fschedules%2F%7BscheduleId%7D).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |
| `scheduleId` | `uuid` | yes |  |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md) (200)

```bash title="curl"
curl -X DELETE "https://api.maitento.com/automated-actions/by-id/<id>/schedules/<scheduleId>" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
await mt.automations.removeSchedule("3d813cbb-47fb-42ba-91df-831e1593ac29", "8e7d6c5b-4a3f-4e2d-9c1b-0a9f8e7d6c5b");
```
```python title="Python"
mt.automations.remove_schedule("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b", "9f0a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c")
```

## `automations.updateSchedule`

```http
PUT /automated-actions/by-id/{id}/schedules/{scheduleId}
```

Replaces a schedule.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=PUT%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D%2Fschedules%2F%7BscheduleId%7D).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |
| `scheduleId` | `uuid` | yes |  |

**Request body:** [`CronScheduleInput`](https://docs.maitento.com/reference/types/cron-schedule.md#in-a-request)

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` |  | The schedule's id. |
| `name` | `string \| null` |  | A name for the schedule. Optional. |
| `isEnabled` | `boolean` |  | Whether the schedule triggers the automation. Switch it off to pause it without deleting it. |
| `second` | `string \| null` |  | The cron seconds field. Optional: set it for a six-field expression. |
| `minute` | `string` |  | The cron minutes field, such as `0` or `*/15`. |
| `hour` | `string` |  | The cron hours field, in UTC, such as `7`. |
| `dayOfMonth` | `string` |  | The cron day-of-month field. |
| `month` | `string` |  | The cron month field. |
| `dayOfWeek` | `string` |  | The cron day-of-week field, such as `1-5` for weekdays. |
| `nextOccurrence` | `datetime \| null` |  | When the schedule next triggers, in UTC. Set by Maitento. |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md) (200)

```bash title="curl"
curl -X PUT "https://api.maitento.com/automated-actions/by-id/<id>/schedules/<scheduleId>" \
  -H "Authorization: $MAITENTO_AUTH" \
  -H "Content-Type: application/json" \
  -d '{"id":"...","name":"...","isEnabled":false,"second":"...","minute":"...","hour":"...","dayOfMonth":"...","month":"...","dayOfWeek":"...","nextOccurrence":"2026-01-01T00:00:00Z"}'
```
```ts title="TypeScript"
await mt.automations.updateSchedule("3d813cbb-47fb-42ba-91df-831e1593ac29", "8e7d6c5b-4a3f-4e2d-9c1b-0a9f8e7d6c5b", { minute: "30", hour: "8" });
```
```python title="Python"
mt.automations.update_schedule("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b", "9f0a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c", minute="30", hour="6")
```

## `automations.disableSchedule`

```http
POST /automated-actions/by-id/{id}/schedules/{scheduleId}/disable
```

Disables a schedule.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=POST%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D%2Fschedules%2F%7BscheduleId%7D%2Fdisable).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |
| `scheduleId` | `uuid` | yes |  |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md) (200)

```bash title="curl"
curl -X POST "https://api.maitento.com/automated-actions/by-id/<id>/schedules/<scheduleId>/disable" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
await mt.automations.disableSchedule("3d813cbb-47fb-42ba-91df-831e1593ac29", "8e7d6c5b-4a3f-4e2d-9c1b-0a9f8e7d6c5b");
```
```python title="Python"
mt.automations.disable_schedule("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b", "9f0a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c")
```

## `automations.enableSchedule`

```http
POST /automated-actions/by-id/{id}/schedules/{scheduleId}/enable
```

Enables a schedule.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=POST%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D%2Fschedules%2F%7BscheduleId%7D%2Fenable).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |
| `scheduleId` | `uuid` | yes |  |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md) (200)

```bash title="curl"
curl -X POST "https://api.maitento.com/automated-actions/by-id/<id>/schedules/<scheduleId>/enable" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
await mt.automations.enableSchedule("3d813cbb-47fb-42ba-91df-831e1593ac29", "8e7d6c5b-4a3f-4e2d-9c1b-0a9f8e7d6c5b");
```
```python title="Python"
mt.automations.enable_schedule("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b", "9f0a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c")
```

## `automations.trigger`

```http
POST /automated-actions/by-id/{id}/trigger
```

Runs the automation now. Starts work, so it is never retried. Returns the first run started. Throws a `ValidationError` with code `api:automations:start-failed` (then the cause's own codes) when nothing could start.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=POST%20%2Fautomated-actions%2Fby-id%2F%7Bid%7D%2Ftrigger).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | `uuid` | yes |  |

**Response:** [`TriggerResponse`](https://docs.maitento.com/reference/types/trigger-response.md) (200)

```bash title="curl"
curl -X POST "https://api.maitento.com/automated-actions/by-id/<id>/trigger" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
const { processId } = await mt.automations.trigger("3d813cbb-47fb-42ba-91df-831e1593ac29");
```
```python title="Python"
mt.automations.trigger("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b")
```

## `automations.list`

```http
GET /namespaces/{namespaceName}/automated-actions
```

Every definition of the tenant, or of one namespace with `{ namespace }`.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=GET%20%2Fnamespaces%2F%7BnamespaceName%7D%2Fautomated-actions).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `namespaceName` | `string` | yes |  |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md)`[]` (200)

```bash title="curl"
curl -X GET "https://api.maitento.com/namespaces/<namespaceName>/automated-actions" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
const automations = await mt.automations.list({ namespace: "support" });
```
```python title="Python"
mt.automations.list(namespace="demo")
```

## `automations.create`

```http
POST /namespaces/{namespaceName}/automated-actions
```

Creates an automation in the namespace.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=POST%20%2Fnamespaces%2F%7BnamespaceName%7D%2Fautomated-actions).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `namespaceName` | `string` | yes |  |

**Request body:** [`CreateAutomatedActionRequest`](https://docs.maitento.com/reference/types/create-automated-action-request.md)

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | `string` |  | The automation's name, unique within the namespace. |
| `description` | `string \| null` |  | What the automation is for. |
| `actions` | [`AutomatedActionItemInput`](https://docs.maitento.com/reference/types/automated-action-item.md#in-a-request)`[]` |  | What the automation starts each time it fires, at least one: one run per action. |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md) (200)

```bash title="curl"
curl -X POST "https://api.maitento.com/namespaces/<namespaceName>/automated-actions" \
  -H "Authorization: $MAITENTO_AUTH" \
  -H "Content-Type: application/json" \
  -d '{"name":"...","description":"...","actions":[]}'
```
```ts title="TypeScript"
const automation = await mt.automations.create({ name: "nightly-digest", actions: [{ name: "digest", config: digestConfig }] }, { namespace: "support" });
```
```python title="Python"
mt.automations.create(name="nightly-digest", actions=[{"config": {"$type": "interaction", "version": {"id": "8c3b2a1d-4e5f-4a6b-9c7d-0e1f2a3b4c5d", "version": 1}, "inputs": []}}], namespace="demo")
```

## `automations.getByName`

```http
GET /namespaces/{namespaceName}/automated-actions/by-name/{name}
```

The definition with this name in the namespace. Throws `NotFoundError` when there is none.

**Who can call it:** Admins and members, with an API key or a portal session. [Try it in the API playground](https://docs.maitento.com/playground/?call=GET%20%2Fnamespaces%2F%7BnamespaceName%7D%2Fautomated-actions%2Fby-name%2F%7Bname%7D).

**Path parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `namespaceName` | `string` | yes |  |
| `name` | `string` | yes |  |

**Response:** [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md) (200)

```bash title="curl"
curl -X GET "https://api.maitento.com/namespaces/<namespaceName>/automated-actions/by-name/<name>" \
  -H "Authorization: $MAITENTO_AUTH"
```
```ts title="TypeScript"
const automation = await mt.automations.getByName("nightly-digest", { namespace: "support" });
```
```python title="Python"
mt.automations.get_by_name("nightly-digest", namespace="demo")
```
