> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/cli/commands/alerts.md).

# alerts

Proactive alerts notify people when a flow runs longer than a threshold. An alert has the type `long-runtime` (the only type today) and a `longRuntime.thresholdMinutes` between 5 and 59940. A flow-level alert names `_flowId`, and its integration is inferred; an integration-level alert names `_integrationId` alone and covers every flow in it. There is one alert per type and flow or integration: a second one answers `409 ROUTES_ALERT_DUPLICATE`. The API answers `403` when proactive alerts are not enabled for the account. Alerts are not [notifications](https://developer.celigo.com/cli/commands/notifications.md), which subscribe users to error and connection emails.

Recipients are written as emails (`_recipientEmails`, 1–50) and stored as user ids (`_recipientUserIds`). An address that is not yet a user of the account is **invited**, or granted access to the integration — so creating an alert or adding a recipient can send invitations and widen access, which is why every alert write needs `full` mode. An alert's create, update, and delete also write its threshold onto the flow document or documents it covers.

This command group manages the alerts: the standard verbs plus `audit`, a `set` that changes the threshold or the recipient list and keeps the other, and `add-recipients` / `remove-recipients` for many alerts at once. To choose a threshold, `celigo flows run-stats <flowId>` (see [flows](https://developer.celigo.com/cli/commands/flows.md)) reports how long the flow's runs take and suggests one — the data behind the threshold chart in the UI.

> Added in celigo-cli 2026.10.1.

**REST API**: [Alerts](https://developer.celigo.com/api/api-reference/monitoring/alerts)

```
celigo alerts <subcommand> [args] [flags]
```

Supports all [global flags](https://developer.celigo.com/cli/getting-started/global-flags.md).

***

## Subcommands

| Subcommand                      | Purpose                                                                                               |
| ------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `list`                          | List alerts, with the API's server-side filters (integration, flow, recipient, type, last triggered). |
| `get <id>`                      | Fetch one alert by ID.                                                                                |
| `create`                        | Create an alert from a JSON body (`--file <path>` or stdin).                                          |
| `update <id>`                   | Replace the threshold and the whole recipient list from a JSON body (`--file <path>` or stdin).       |
| `delete <id>`                   | Delete an alert.                                                                                      |
| `audit <id>`                    | Show the audit log (change history) for one alert.                                                    |
| `set <id> key=value …`          | Change `longRuntime.thresholdMinutes` or `_recipientEmails` and keep the other.                       |
| `add-recipients <emails...>`    | Add recipients to the alerts you name, or to every alert of one integration.                          |
| `remove-recipients <emails...>` | Remove recipients from the alerts you name, or from every alert of one integration.                   |

***

## `celigo alerts list`

List the account's alerts, filtered server-side by the flags below. Without `--populate`, `_recipientUserIds` holds user ids; with it, each recipient becomes `{_id, name, email}` and the `flow` (flow-level alerts) or `integration` (integration-level alerts) summary object is added.

The alerts list documents no field projection, so rows are trimmed client-side: `--fields` changes what is printed, not what is transferred. The default projection keeps the recipients and the `flow` / `integration` summaries.

**Signature**

```bash
celigo alerts list [flags]
```

**Arguments**

None.

**Flags**

| Flag                         | Type           | Default   | Description                                                                                                                                                                                                                                                                                                   |
| ---------------------------- | -------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--integration <id>`         | string         | —         | Only alerts of this integration. Required for tile-level (shared) users. Sent as `_integrationId`.                                                                                                                                                                                                            |
| `--flow <id>`                | string         | —         | Only alerts on this flow. Sent as `_flowId`.                                                                                                                                                                                                                                                                  |
| `--recipient <userId>`       | string         | —         | Only alerts that notify this user — a user id, not an email. Sent as `_recipientUserId`.                                                                                                                                                                                                                      |
| `--type <type>`              | `long-runtime` | —         | Only alerts of this type. Any other value is rejected locally. Sent as `type`.                                                                                                                                                                                                                                |
| `--last-triggered <value>`   | string         | —         | `never`: only alerts that have never fired. Sent as `lastTriggeredAt`.                                                                                                                                                                                                                                        |
| `--last-triggered-gte <iso>` | ISO 8601       | —         | Only alerts last fired at or after this time. Sent as `lastTriggeredAt_gte`.                                                                                                                                                                                                                                  |
| `--last-triggered-lte <iso>` | ISO 8601       | —         | Only alerts last fired at or before this time. Sent as `lastTriggeredAt_lte`.                                                                                                                                                                                                                                 |
| `--populate`                 | boolean        | `false`   | Return each recipient as `{_id, name, email}` and add the `flow` / `integration` summary objects. Sent as `populate=true`.                                                                                                                                                                                    |
| `--fields <spec>`            | string         | `default` | Fields to return per row. `default` returns `_id` and the table columns, plus the recipients and summaries; `all` returns complete documents; a comma-separated list selects specific fields. Applied client-side — see [field projection](https://developer.celigo.com/cli/getting-started/global-flags.md). |
| `--limit <n>`                | integer        | —         | Return at most `<n>` rows, fetching a single page.                                                                                                                                                                                                                                                            |

Since celigo-cli 2026.11.2, `list` refuses these before any request: a `--last-triggered` value other than `never`, a `--last-triggered-gte` or `--last-triggered-lte` that is not a timestamp, a window whose start is after its end, and a blank filter value (an unset shell variable).

Default table columns: `_id`, `type`, `_integrationId`, `_flowId`, `longRuntime.thresholdMinutes`, `lastTriggeredAt`.

**Example**

```bash
celigo alerts list --format table

# One integration's alerts, with each recipient's email
celigo alerts list --integration 5f83a9b2c7d3e8f1a2b3c4d5 --populate \
  --jq '.[] | {_id, minutes: .longRuntime.thresholdMinutes, to: [._recipientUserIds[].email]}'

# Alerts that have never fired
celigo alerts list --last-triggered never
```

**Corresponds to**: [`GET /v1/alerts`](https://developer.celigo.com/api/api-reference/monitoring/alerts) — with the filters above as query parameters.

***

## `celigo alerts get`

Fetch one alert by ID. `--populate` works as on `list`.

**Signature**

```bash
celigo alerts get <id> [--populate]
```

**Arguments**

| Argument | Type   | Required | Description  |
| -------- | ------ | -------- | ------------ |
| `<id>`   | string | Yes      | Alert `_id`. |

**Flags**

| Flag         | Type    | Default | Description                                                                                                                |
| ------------ | ------- | ------- | -------------------------------------------------------------------------------------------------------------------------- |
| `--populate` | boolean | `false` | Return each recipient as `{_id, name, email}` and add the `flow` / `integration` summary objects. Sent as `populate=true`. |

**Example**

```bash
celigo alerts get 64b1c2d3e4f5a6b7c8d9e0f1 --populate
```

**Corresponds to**: [`GET /v1/alerts/{_id}`](https://developer.celigo.com/api/api-reference/monitoring/alerts)

***

## `celigo alerts create`

Create an alert from a JSON body. Read the body from a file with `-f, --file` (recommended), or pipe it on stdin. Every address in `_recipientEmails` that is not yet a user of the account is invited, or granted access to the integration. Requires `full` mode.

**Signature**

```bash
celigo alerts create --file <path>
celigo alerts create < alert.json     # or pipe on stdin
```

**Arguments**

None.

**Flags**

| Flag                | Type   | Default | Description                                                                    |
| ------------------- | ------ | ------- | ------------------------------------------------------------------------------ |
| `-f, --file <path>` | string | —       | Read the JSON body from a file instead of stdin (`--file -` also means stdin). |

**Request body**

| Field                          | Required                       | Description                                                                 |
| ------------------------------ | ------------------------------ | --------------------------------------------------------------------------- |
| `type`                         | Yes                            | `long-runtime`.                                                             |
| `_flowId`                      | For a flow-level alert         | The flow. Its integration is inferred, so `_integrationId` may be left out. |
| `_integrationId`               | For an integration-level alert | The integration; the alert covers every flow in it. Leave out `_flowId`.    |
| `longRuntime.thresholdMinutes` | Yes                            | Minutes a run may take before the alert fires, 5–59940.                     |
| `_recipientEmails`             | Yes                            | 1–50 email addresses.                                                       |

**Example**

```bash
cat > alert.json <<'EOF'
{
  "type": "long-runtime",
  "_flowId": "5f83a9b2c7d3e8f1a2b3c4d5",
  "longRuntime": { "thresholdMinutes": 30 },
  "_recipientEmails": ["ops@example.com"]
}
EOF
celigo alerts create --file alert.json
```

**Corresponds to**: [`POST /v1/alerts`](https://developer.celigo.com/api/api-reference/monitoring/alerts)

***

## `celigo alerts update`

Replace the threshold and the whole recipient list from a JSON body: `{"longRuntime": {...}, "_recipientEmails": [...]}`. `type`, `_flowId`, and `_integrationId` never change. Requires `full` mode.

> ⚠️ **Build the body from `get --populate`.** The PUT takes the recipients as emails, which only a populated read returns. A body built from a plain `get` carries `_recipientUserIds`, which the PUT ignores, and the platform refuses it because the alert would have no recipient. To change one field, use `set`, which rebuilds the body itself.

When the platform refuses a body for its recipients, the CLI adds:

```
Hint: The alert PUT takes its recipients as _recipientEmails, not the _recipientUserIds a plain get returns: build the body from 'celigo alerts get 64b1c2d3e4f5a6b7c8d9e0f1 --populate' (each _recipientUserIds entry carries its email), or change one field with 'celigo alerts set 64b1c2d3e4f5a6b7c8d9e0f1 …', which rebuilds it.
```

**Signature**

```bash
celigo alerts update <id> --file <path>
celigo alerts update <id> < alert.json     # or pipe on stdin
```

**Arguments**

| Argument | Type   | Required | Description  |
| -------- | ------ | -------- | ------------ |
| `<id>`   | string | Yes      | Alert `_id`. |

**Flags**

| Flag                | Type    | Default | Description                                                                               |
| ------------------- | ------- | ------- | ----------------------------------------------------------------------------------------- |
| `-f, --file <path>` | string  | —       | Read the JSON body from a file instead of stdin (`--file -` also means stdin).            |
| `--force`           | boolean | `false` | Submit even if the body contains masked credential values (`"******"`) copied from a GET. |

**Example**

```bash
celigo alerts get 64b1c2d3e4f5a6b7c8d9e0f1 --populate --format json \
  | jq '{longRuntime: {thresholdMinutes: 60}, _recipientEmails: [._recipientUserIds[].email]}' \
  | celigo alerts update 64b1c2d3e4f5a6b7c8d9e0f1
```

**Corresponds to**: [`PUT /v1/alerts/{_id}`](https://developer.celigo.com/api/api-reference/monitoring/alerts)

***

## `celigo alerts delete`

Delete an alert. Its threshold is removed from the flow document or documents it covered. Prompts for confirmation unless `-y` is supplied. Requires `full` mode.

**Signature**

```bash
celigo alerts delete <id> [-y]
```

**Arguments**

| Argument | Type   | Required | Description  |
| -------- | ------ | -------- | ------------ |
| `<id>`   | string | Yes      | Alert `_id`. |

**Flags**

| Flag        | Type    | Default | Description                   |
| ----------- | ------- | ------- | ----------------------------- |
| `-y, --yes` | boolean | `false` | Skip the confirmation prompt. |

**Example**

```bash
celigo alerts delete 64b1c2d3e4f5a6b7c8d9e0f1 -y
```

**Corresponds to**: [`DELETE /v1/alerts/{_id}`](https://developer.celigo.com/api/api-reference/monitoring/alerts)

***

## `celigo alerts audit`

Show the audit log (change history) for one alert. The CLI reads every page.

**Signature**

```bash
celigo alerts audit <id>
```

**Arguments**

| Argument | Type   | Required | Description  |
| -------- | ------ | -------- | ------------ |
| `<id>`   | string | Yes      | Alert `_id`. |

**Flags**

Uses [global flags](https://developer.celigo.com/cli/getting-started/global-flags.md) only.

**Example**

```bash
celigo alerts audit 64b1c2d3e4f5a6b7c8d9e0f1 --format table
```

**Corresponds to**: [`GET /v1/alerts/{_id}/audit`](https://developer.celigo.com/api/api-reference/monitoring/alerts)

***

## `celigo alerts set`

Change an alert's threshold or its recipients and keep the other. Two fields can be set: `longRuntime.thresholdMinutes` (5–59940) and `_recipientEmails` — the whole list, as a JSON array. The API has no PATCH for alerts and its PUT takes recipients as emails, which only a populated read returns, so `set` reads the alert with `populate=true`, rebuilds `{longRuntime, _recipientEmails}` from it, applies your assignments, and PUTs that.

Any other field is refused before any request:

```
Cannot set name on an alert: only longRuntime.thresholdMinutes and _recipientEmails can change (type, _flowId and _integrationId are fixed at create).
```

To add or remove one recipient without restating the list, use `add-recipients` / `remove-recipients`. `set` is blocked in `read` mode, and no alert field is an operational one, so `set` needs `full` mode. See [Profiles & regions](https://developer.celigo.com/cli/getting-started/profiles.md#permission-modes).

**Signature**

```bash
celigo alerts set <id> <key=value> [key=value ...]
```

**Arguments**

| Argument      | Type   | Required | Description                                                               |
| ------------- | ------ | -------- | ------------------------------------------------------------------------- |
| `<id>`        | string | Yes      | Alert `_id`.                                                              |
| `<key=value>` | string | Yes (≥1) | `longRuntime.thresholdMinutes=<minutes>` and/or `_recipientEmails='[…]'`. |

**Flags**

Uses [global flags](https://developer.celigo.com/cli/getting-started/global-flags.md) only.

**Example**

```bash
celigo alerts set 64b1c2d3e4f5a6b7c8d9e0f1 longRuntime.thresholdMinutes=45

# Replace the whole recipient list
celigo alerts set 64b1c2d3e4f5a6b7c8d9e0f1 _recipientEmails='["ops@example.com","oncall@example.com"]'
```

**Corresponds to**: [`GET /v1/alerts/{_id}`](https://developer.celigo.com/api/api-reference/monitoring/alerts) with `populate=true`, then [`PUT /v1/alerts/{_id}`](https://developer.celigo.com/api/api-reference/monitoring/alerts).

***

## `celigo alerts add-recipients`

Add recipients to many alerts in one call: the alerts you list with `--alerts`, or every alert of one integration with `--integration` — exactly one of the two, and one integration per call. An email that is not yet a user of the account is invited, or granted access to the integration. Before sending, the CLI refuses a call that passes both flags or neither, or more than 50 emails. Requires `full` mode.

When every targeted alert changed, the command prints `Added <n> recipient(s).` and exits 0. Otherwise it prints the API's `failed[]` list — each failed alert's `_id`, the `affectedRecipientEmails`, and the `errors` — says on stderr how many alerts could not be updated, and exits 1; the other alerts were updated.

**Signature**

```bash
celigo alerts add-recipients <emails...> (--alerts <ids> | --integration <id>)
```

**Arguments**

| Argument      | Type              | Required | Description                         |
| ------------- | ----------------- | -------- | ----------------------------------- |
| `<emails...>` | string (variadic) | Yes      | Email addresses to add, at most 50. |

**Flags**

| Flag                 | Type   | Default | Description                      |
| -------------------- | ------ | ------- | -------------------------------- |
| `--alerts <ids>`     | string | —       | Comma-separated alert IDs.       |
| `--integration <id>` | string | —       | Every alert of this integration. |

**Example**

```bash
# Every alert of one integration
celigo alerts add-recipients oncall@example.com --integration 5f83a9b2c7d3e8f1a2b3c4d5

# Two named alerts
celigo alerts add-recipients ops@example.com oncall@example.com \
  --alerts 64b1c2d3e4f5a6b7c8d9e0f1,64b1c2d3e4f5a6b7c8d9e0f2
```

**Corresponds to**: [`PATCH /v1/alerts/bulk/recipients`](https://developer.celigo.com/api/api-reference/monitoring/alerts) with `"action": "add"`, the emails as `_recipientEmails`, and `_alertIds` or `_integrationId`.

***

## `celigo alerts remove-recipients`

Remove recipients from many alerts in one call: the alerts you list with `--alerts`, which may span integrations, or every alert of one integration with `--integration` — exactly one of the two. An alert's last recipient cannot be removed: such an alert is listed in `failed[]` (`ROUTES_ALERT_BULK_LAST_RECIPIENT`) and the command exits 1. When every targeted alert changed, it prints `Removed <n> recipient(s).` and exits 0. Requires `full` mode.

**Signature**

```bash
celigo alerts remove-recipients <emails...> (--alerts <ids> | --integration <id>)
```

**Arguments**

| Argument      | Type              | Required | Description                            |
| ------------- | ----------------- | -------- | -------------------------------------- |
| `<emails...>` | string (variadic) | Yes      | Email addresses to remove, at most 50. |

**Flags**

| Flag                 | Type   | Default | Description                      |
| -------------------- | ------ | ------- | -------------------------------- |
| `--alerts <ids>`     | string | —       | Comma-separated alert IDs.       |
| `--integration <id>` | string | —       | Every alert of this integration. |

**Example**

```bash
celigo alerts remove-recipients former.owner@example.com --integration 5f83a9b2c7d3e8f1a2b3c4d5
```

**Corresponds to**: [`PATCH /v1/alerts/bulk/recipients`](https://developer.celigo.com/api/api-reference/monitoring/alerts) with `"action": "remove"`.

***

## Gotchas

* **An alert write can invite people.** Every address in `_recipientEmails` or an `add-recipients` call that is not yet a user of the account is invited, or granted access to the integration. Every alert write — `create`, `update`, `delete`, `set`, `add-recipients`, and `remove-recipients` — needs `full` mode.
* **`update` takes emails; `get` returns user ids.** Build an `update` body from `get <id> --populate`, or use `set`, which does that for you. A body copied from a plain `get` is refused for having no recipients.
* **`--recipient` takes a user id.** `list --recipient` filters on `_recipientUserId`, not on an email; `list --populate` shows which user id belongs to which email.
* **One alert per type and flow or integration.** A second `long-runtime` alert on the same flow, or on the same integration, answers `409 ROUTES_ALERT_DUPLICATE` — change the existing one instead.
* **Proactive alerts must be enabled for the account.** Without the feature, the API answers `403`.
* **`add-recipients` and `remove-recipients` succeed per alert.** A partial failure exits 1 and prints the alerts that failed; the others were changed. An alert's last recipient cannot be removed.
* **Permission modes.** `list`, `get`, and `audit` work in `read` mode. Every other verb needs `full`. See [Profiles & regions](https://developer.celigo.com/cli/getting-started/profiles.md#permission-modes).

## Related

* [flows](https://developer.celigo.com/cli/commands/flows.md) — `flows run-stats <flowId>` reports how long a flow's runs take and suggests a threshold; an alert writes its threshold onto the flows it covers.
* [notifications](https://developer.celigo.com/cli/commands/notifications.md) — error and connection email subscriptions, a separate feature.
* [integrations](https://developer.celigo.com/cli/commands/integrations.md) — an integration-level alert covers every flow of the integration.
* [workspace-users](https://developer.celigo.com/cli/commands/workspace-users.md) — alert recipients are account users; an address that is not one is invited.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.celigo.com/cli/commands/alerts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
