# MessageTrigger

A trigger that starts an automation when another run changes and matches a filter.

**Kind:** an object, used in requests and responses. In a request it is called `MessageTriggerInput`.

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

```json
{
  "id": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "name": "...",
  "isEnabled": false,
  "triggerType": "AppProcessUpdated",
  "eventFilter": "..."
}
```

## In a response

Every field is present in a response; empty ones are `null`.

| Field | Type | 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. |

```json
{
  "id": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "name": "...",
  "isEnabled": false,
  "triggerType": "AppProcessUpdated",
  "eventFilter": "..."
}
```

## Where it's used

- [`automations.addMessageTrigger`](https://docs.maitento.com/reference/api/automations.md) (`POST /automated-actions/by-id/{id}/message-triggers`)
- [`automations.updateMessageTrigger`](https://docs.maitento.com/reference/api/automations.md) (`PUT /automated-actions/by-id/{id}/message-triggers/{triggerId}`)
- Inside [`AutomatedAction`](https://docs.maitento.com/reference/types/automated-action.md)
