> 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/api/api-reference/monitoring/alerts.md). Agents can also search and read this documentation through its [MCP server](https://developer.celigo.com/~gitbook/mcp).

# Alerts

Proactive alerts define long-runtime thresholds and recipients for flows or whole integrations. Create, list, update, and delete alerts; bulk-update recipients across many alerts; and fetch per-alert audit history.

### Alert schema

## The Alert object

```json
{"openapi":"3.2.0","info":{"title":"Alerts","version":"1.0.0"},"components":{"schemas":{"Alert":{"type":"object","description":"Proactive alert configuration. Soft-deleted alerts are omitted from list\nand get responses. With `populate=true` on GET, `_flowId` and\n`_integrationId` stay ObjectId strings and the `flow` / `integration`\nenrichment objects are added alongside them; `_recipientUserIds` entries\nbecome `{ _id, name, email }`. POST and PUT always return the unpopulated\nshape.","required":["_id","type","_userId","_integrationId","longRuntime","_recipientUserIds","createdAt","lastModified"],"properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the alert."},"type":{"type":"string","description":"Alert type.","enum":["long-runtime"]},"_userId":{"type":"string","format":"objectId","readOnly":true,"description":"Account owner user id for the alert."},"_integrationId":{"type":"string","format":"objectId","description":"Integration the alert belongs to. Always an ObjectId string. With\n`populate=true` on an integration-level alert, a sibling `integration`\nobject `{ flowCount }` is added; this id is not replaced."},"_flowId":{"type":"string","format":"objectId","description":"Flow for a flow-level alert; omitted on integration-level alerts.\nAlways an ObjectId string — with `populate=true` the display fields\narrive in the sibling `flow` object instead of replacing this value."},"longRuntime":{"type":"object","description":"Configuration for `long-runtime` alerts.","required":["thresholdMinutes"],"properties":{"thresholdMinutes":{"type":"integer","minimum":5,"maximum":59940,"description":"Runtime threshold in minutes. Runs at or above this duration trigger the alert."}}},"_recipientUserIds":{"type":"array","description":"Recipient user ids. Unpopulated responses return ObjectId strings;\nwith `populate=true`, each entry is `{ _id, name, email }`.","minItems":1,"items":{"oneOf":[{"type":"string","format":"objectId"},{"type":"object","required":["_id"],"properties":{"_id":{"type":"string","format":"objectId"},"name":{"type":"string"},"email":{"type":"string","format":"email"}}}]}},"flow":{"type":"object","readOnly":true,"description":"Flow enrichment object. Present on populated GET responses for\nflow-level alerts only (`populate=true`). Never returned on POST or PUT.\nFields: `name`, `isInstanceFlow`, `flowGroupName`.","properties":{"name":{"type":"string","description":"Flow display name."},"isInstanceFlow":{"type":"boolean","description":"Whether this is an instance of an abstract (Integration App) flow."},"flowGroupName":{"type":"string","description":"Name of the flow group this flow belongs to. Absent when the flow is in no group."}}},"integration":{"type":"object","readOnly":true,"description":"Integration enrichment object. Present on populated GET responses for\nintegration-level alerts only (`populate=true`, no `_flowId`). Only\n`flowCount` is returned (not `name`).","properties":{"flowCount":{"type":"integer","description":"Number of non-deleted flows under this integration."}}},"lastTriggeredAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the alert last fired. Absent until the alert first fires;\nthe list's `lastTriggeredAt=never` filter matches those alerts."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"When the alert was created."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"When the alert was last updated."}}}}}}
```

## List alerts

> Returns proactive alerts for the account. Soft-deleted alerts are excluded.\
> Requires permission \`get:alert:models\`. Returns \`403\` when the\
> \`ENABLE\_PROACTIVE\_ALERTS\` feature flag is off.\
> \
> With \`populate=true\`, nested \`flow\` / \`integration\` summaries and\
> recipient \`{ \_id, name, email }\` objects are returned. Without populate,\
> foreign keys are raw ObjectIds.\
> \
> Tile-level (shared) users must include \`\_integrationId\`.

```json
{"openapi":"3.2.0","info":{"title":"Alerts","version":"1.0.0"},"tags":[{"name":"Alerts","description":"Proactive alerts define long-runtime thresholds and recipients for flows\nor whole integrations. Create, list, update, and delete alerts; bulk-update\nrecipients across many alerts; and fetch per-alert audit history.\n\n## Alert schema\n\n{% openapi-schemas spec=\"alert\" schemas=\"Alert\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Alert":{"type":"object","description":"Proactive alert configuration. Soft-deleted alerts are omitted from list\nand get responses. With `populate=true` on GET, `_flowId` and\n`_integrationId` stay ObjectId strings and the `flow` / `integration`\nenrichment objects are added alongside them; `_recipientUserIds` entries\nbecome `{ _id, name, email }`. POST and PUT always return the unpopulated\nshape.","required":["_id","type","_userId","_integrationId","longRuntime","_recipientUserIds","createdAt","lastModified"],"properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the alert."},"type":{"type":"string","description":"Alert type.","enum":["long-runtime"]},"_userId":{"type":"string","format":"objectId","readOnly":true,"description":"Account owner user id for the alert."},"_integrationId":{"type":"string","format":"objectId","description":"Integration the alert belongs to. Always an ObjectId string. With\n`populate=true` on an integration-level alert, a sibling `integration`\nobject `{ flowCount }` is added; this id is not replaced."},"_flowId":{"type":"string","format":"objectId","description":"Flow for a flow-level alert; omitted on integration-level alerts.\nAlways an ObjectId string — with `populate=true` the display fields\narrive in the sibling `flow` object instead of replacing this value."},"longRuntime":{"type":"object","description":"Configuration for `long-runtime` alerts.","required":["thresholdMinutes"],"properties":{"thresholdMinutes":{"type":"integer","minimum":5,"maximum":59940,"description":"Runtime threshold in minutes. Runs at or above this duration trigger the alert."}}},"_recipientUserIds":{"type":"array","description":"Recipient user ids. Unpopulated responses return ObjectId strings;\nwith `populate=true`, each entry is `{ _id, name, email }`.","minItems":1,"items":{"oneOf":[{"type":"string","format":"objectId"},{"type":"object","required":["_id"],"properties":{"_id":{"type":"string","format":"objectId"},"name":{"type":"string"},"email":{"type":"string","format":"email"}}}]}},"flow":{"type":"object","readOnly":true,"description":"Flow enrichment object. Present on populated GET responses for\nflow-level alerts only (`populate=true`). Never returned on POST or PUT.\nFields: `name`, `isInstanceFlow`, `flowGroupName`.","properties":{"name":{"type":"string","description":"Flow display name."},"isInstanceFlow":{"type":"boolean","description":"Whether this is an instance of an abstract (Integration App) flow."},"flowGroupName":{"type":"string","description":"Name of the flow group this flow belongs to. Absent when the flow is in no group."}}},"integration":{"type":"object","readOnly":true,"description":"Integration enrichment object. Present on populated GET responses for\nintegration-level alerts only (`populate=true`, no `_flowId`). Only\n`flowCount` is returned (not `name`).","properties":{"flowCount":{"type":"integer","description":"Number of non-deleted flows under this integration."}}},"lastTriggeredAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the alert last fired. Absent until the alert first fires;\nthe list's `lastTriggeredAt=never` filter matches those alerts."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"When the alert was created."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"When the alert was last updated."}}},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"400-bad-request":{"description":"Bad request. The server could not understand the request because of malformed syntax or invalid parameters.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401-unauthorized":{"description":"Unauthorized, in one of two shapes.\n\nNo valid bearer token: the auth middleware answers before the endpoint\nhandler runs, with a bare `{message: string}` body — no `code`, no\n`errors` array — so key off the HTTP status and `message`.\n\nAn API token with a custom scope calling an operation its scope does not\ngrant: the token authenticated, and the body is the standard\n`{errors: [...]}` envelope with code `access_restricted`. Observed on\n`GET /v1/connections` and `GET /v1/exports/{_id}`: a full-access API token\npassed both, a personal access token `GET /v1/exports/{_id}`.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"The auth middleware's bare body for a missing or invalid token.","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]},{"$ref":"#/components/schemas/Error"}]}}}},"403-forbidden":{"description":"Forbidden. The authenticated caller does not have permission to perform this operation.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/alerts":{"get":{"operationId":"listAlerts","tags":["Alerts"],"summary":"List alerts","description":"Returns proactive alerts for the account. Soft-deleted alerts are excluded.\nRequires permission `get:alert:models`. Returns `403` when the\n`ENABLE_PROACTIVE_ALERTS` feature flag is off.\n\nWith `populate=true`, nested `flow` / `integration` summaries and\nrecipient `{ _id, name, email }` objects are returned. Without populate,\nforeign keys are raw ObjectIds.\n\nTile-level (shared) users must include `_integrationId`.","parameters":[{"name":"populate","in":"query","required":false,"description":"When `true`, populate flow, integration, and recipient user fields.","schema":{"type":"string","enum":["true"]}},{"name":"type","in":"query","required":false,"description":"Filter by alert type.","schema":{"type":"string","enum":["long-runtime"]}},{"name":"_integrationId","in":"query","required":false,"description":"Filter by integration id. Returns the integration's flow-level alerts and its\nintegration-level alert. Required for tile-level (shared) users.","schema":{"type":"string","format":"objectId"}},{"name":"_flowId","in":"query","required":false,"description":"Filter by flow id. Returns only the flow-level alert on this flow, not the\nintegration-level alert that also covers it; filter by `_integrationId` to get\nboth.","schema":{"type":"string","format":"objectId"}},{"name":"_recipientUserId","in":"query","required":false,"description":"Filter alerts that include this user as a recipient.","schema":{"type":"string","format":"objectId"}},{"name":"lastTriggeredAt","in":"query","required":false,"description":"Returns only alerts that have never fired. For a time range, use\n`lastTriggeredAt_gte` / `lastTriggeredAt_lte` instead.","schema":{"type":"string","enum":["never"]}},{"name":"lastTriggeredAt_gte","in":"query","required":false,"description":"Include alerts last triggered at or after this ISO-8601 timestamp.","schema":{"type":"string","format":"date-time"}},{"name":"lastTriggeredAt_lte","in":"query","required":false,"description":"Include alerts last triggered at or before this ISO-8601 timestamp.","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Array of alerts (empty array when none match).","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Alert"}}}}},"400":{"$ref":"#/components/responses/400-bad-request"},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"$ref":"#/components/responses/403-forbidden"},"422":{"description":"`lastTriggeredAt` is a value other than `never`, or `lastTriggeredAt_gte` /\n`lastTriggeredAt_lte` is not a valid date (`invalid_query_param`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Create an alert

> Creates a proactive alert. Validates type, flow/integration, and duplicate\
> constraints, then resolves \`\_recipientEmails\` to \`\_recipientUserIds\` and\
> dual-writes the long-runtime threshold onto the related flow document(s).\
> A flow read doesn't return that threshold, but the flow's \`lastModified\`\
> moves, and the flow's own audit log gets no entry for it.\
> \
> Requires permission \`put:alert:models\`. Returns \`403\` when\
> \`ENABLE\_PROACTIVE\_ALERTS\` is off. Response is always unpopulated.

```json
{"openapi":"3.2.0","info":{"title":"Alerts","version":"1.0.0"},"tags":[{"name":"Alerts","description":"Proactive alerts define long-runtime thresholds and recipients for flows\nor whole integrations. Create, list, update, and delete alerts; bulk-update\nrecipients across many alerts; and fetch per-alert audit history.\n\n## Alert schema\n\n{% openapi-schemas spec=\"alert\" schemas=\"Alert\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"AlertCreateRequest":{"type":"object","description":"Create a proactive alert. Recipients are supplied as `_recipientEmails`;\nthe API resolves them to `_recipientUserIds` (inviting users or granting\nintegration access when needed). Response never echoes `_recipientEmails`.\n\nEither `_flowId` or `_integrationId` (or both) must be provided. When\n`_flowId` is set, `_integrationId` may be omitted (inferred from the flow).\nIntegration-level alerts require `_integrationId` without `_flowId`.","required":["type","longRuntime","_recipientEmails"],"if":{"not":{"required":["_flowId"]}},"then":{"required":["_integrationId"]},"properties":{"type":{"type":"string","description":"Alert type.","enum":["long-runtime"]},"_flowId":{"type":"string","format":"objectId","description":"Flow id for a flow-level alert. When set, `_integrationId` may be\nomitted and is inferred from the flow."},"_integrationId":{"type":"string","format":"objectId","description":"Integration id. Required for integration-level alerts (no `_flowId`).\nRequired for `long-runtime` unless inferred from `_flowId`."},"longRuntime":{"type":"object","required":["thresholdMinutes"],"properties":{"thresholdMinutes":{"type":"integer","minimum":5,"maximum":59940,"description":"Runtime threshold in minutes."}}},"_recipientEmails":{"type":"array","description":"Recipient email addresses. Trimmed, lowercased, and deduplicated\nserver-side. Minimum 1; maximum controlled by `ALERT_MAX_RECIPIENT_EMAILS`\n(default 50).","minItems":1,"maxItems":50,"items":{"type":"string","format":"email"}}}},"Alert":{"type":"object","description":"Proactive alert configuration. Soft-deleted alerts are omitted from list\nand get responses. With `populate=true` on GET, `_flowId` and\n`_integrationId` stay ObjectId strings and the `flow` / `integration`\nenrichment objects are added alongside them; `_recipientUserIds` entries\nbecome `{ _id, name, email }`. POST and PUT always return the unpopulated\nshape.","required":["_id","type","_userId","_integrationId","longRuntime","_recipientUserIds","createdAt","lastModified"],"properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the alert."},"type":{"type":"string","description":"Alert type.","enum":["long-runtime"]},"_userId":{"type":"string","format":"objectId","readOnly":true,"description":"Account owner user id for the alert."},"_integrationId":{"type":"string","format":"objectId","description":"Integration the alert belongs to. Always an ObjectId string. With\n`populate=true` on an integration-level alert, a sibling `integration`\nobject `{ flowCount }` is added; this id is not replaced."},"_flowId":{"type":"string","format":"objectId","description":"Flow for a flow-level alert; omitted on integration-level alerts.\nAlways an ObjectId string — with `populate=true` the display fields\narrive in the sibling `flow` object instead of replacing this value."},"longRuntime":{"type":"object","description":"Configuration for `long-runtime` alerts.","required":["thresholdMinutes"],"properties":{"thresholdMinutes":{"type":"integer","minimum":5,"maximum":59940,"description":"Runtime threshold in minutes. Runs at or above this duration trigger the alert."}}},"_recipientUserIds":{"type":"array","description":"Recipient user ids. Unpopulated responses return ObjectId strings;\nwith `populate=true`, each entry is `{ _id, name, email }`.","minItems":1,"items":{"oneOf":[{"type":"string","format":"objectId"},{"type":"object","required":["_id"],"properties":{"_id":{"type":"string","format":"objectId"},"name":{"type":"string"},"email":{"type":"string","format":"email"}}}]}},"flow":{"type":"object","readOnly":true,"description":"Flow enrichment object. Present on populated GET responses for\nflow-level alerts only (`populate=true`). Never returned on POST or PUT.\nFields: `name`, `isInstanceFlow`, `flowGroupName`.","properties":{"name":{"type":"string","description":"Flow display name."},"isInstanceFlow":{"type":"boolean","description":"Whether this is an instance of an abstract (Integration App) flow."},"flowGroupName":{"type":"string","description":"Name of the flow group this flow belongs to. Absent when the flow is in no group."}}},"integration":{"type":"object","readOnly":true,"description":"Integration enrichment object. Present on populated GET responses for\nintegration-level alerts only (`populate=true`, no `_flowId`). Only\n`flowCount` is returned (not `name`).","properties":{"flowCount":{"type":"integer","description":"Number of non-deleted flows under this integration."}}},"lastTriggeredAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the alert last fired. Absent until the alert first fires;\nthe list's `lastTriggeredAt=never` filter matches those alerts."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"When the alert was created."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"When the alert was last updated."}}},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized, in one of two shapes.\n\nNo valid bearer token: the auth middleware answers before the endpoint\nhandler runs, with a bare `{message: string}` body — no `code`, no\n`errors` array — so key off the HTTP status and `message`.\n\nAn API token with a custom scope calling an operation its scope does not\ngrant: the token authenticated, and the body is the standard\n`{errors: [...]}` envelope with code `access_restricted`. Observed on\n`GET /v1/connections` and `GET /v1/exports/{_id}`: a full-access API token\npassed both, a personal access token `GET /v1/exports/{_id}`.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"The auth middleware's bare body for a missing or invalid token.","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]},{"$ref":"#/components/schemas/Error"}]}}}},"403-forbidden":{"description":"Forbidden. The authenticated caller does not have permission to perform this operation.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/alerts":{"post":{"operationId":"createAlert","tags":["Alerts"],"summary":"Create an alert","description":"Creates a proactive alert. Validates type, flow/integration, and duplicate\nconstraints, then resolves `_recipientEmails` to `_recipientUserIds` and\ndual-writes the long-runtime threshold onto the related flow document(s).\nA flow read doesn't return that threshold, but the flow's `lastModified`\nmoves, and the flow's own audit log gets no entry for it.\n\nRequires permission `put:alert:models`. Returns `403` when\n`ENABLE_PROACTIVE_ALERTS` is off. Response is always unpopulated.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertCreateRequest"}}}},"responses":{"201":{"description":"Created alert (unpopulated ObjectIds).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Alert"}}}},"400":{"description":"The body failed validation. `invalid_field` covers a threshold out of range and a\nmissing or unsupported `type`; `missing_required_field` covers no recipients and a\nbody with neither `_flowId` nor `_integrationId`; `create_not_allowed` is a\nmalformed recipient email; `invalid_ref` is a `_flowId` or `_integrationId` that\nmatches no flow or integration in the account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"$ref":"#/components/responses/403-forbidden"},"409":{"description":"An alert of the same type already exists for this flow, or for this integration\nwhen `_flowId` is omitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`_flowId` or `_integrationId` is not a valid ObjectId (`invalid_ref`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Bulk update alert recipients

> Adds or removes recipients across many alerts in one call. Provide either\
> \`\_alertIds\` or \`\_integrationId\` (not both). Both \`add\` and \`remove\` accept\
> \`\_recipientEmails\`.\
> \
> Full success returns \`204\` with no body. Partial failure returns \`200\` with\
> \`{ failed: \[...] }\` only — successful alerts are omitted. There is no\
> \`success\` or \`skipped\` array. A \`remove\` never takes an alert's last\
> recipient: that recipient stays, and the alert is listed in \`failed\[]\` with the\
> kept email in \`affectedRecipientEmails\`. An id in \`\_alertIds\` that matches no\
> alert is listed there too, not answered with \`404\`.\
> \
> Requires permission \`put:alert:models\`. Returns \`403\` when\
> \`ENABLE\_PROACTIVE\_ALERTS\` is off. \`add\` is limited to one integration per\
> call; \`remove\` may span integrations.

```json
{"openapi":"3.2.0","info":{"title":"Alerts","version":"1.0.0"},"tags":[{"name":"Alerts","description":"Proactive alerts define long-runtime thresholds and recipients for flows\nor whole integrations. Create, list, update, and delete alerts; bulk-update\nrecipients across many alerts; and fetch per-alert audit history.\n\n## Alert schema\n\n{% openapi-schemas spec=\"alert\" schemas=\"Alert\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"AlertBulkRecipientsRequest":{"type":"object","description":"Add or remove recipients across one or more alerts. Provide exactly one\ntarget: `_alertIds` or `_integrationId` (not both). Both actions use\n`_recipientEmails` (resolved to user ids server-side). `add` is limited to\none integration per call; `remove` may span integrations.\n\nSending both `_alertIds` and `_integrationId` returns `400`.","required":["action","_recipientEmails"],"if":{"required":["_alertIds"]},"then":{"not":{"required":["_integrationId"]}},"else":{"required":["_integrationId"]},"properties":{"action":{"type":"string","description":"Whether to add or remove the listed recipients.","enum":["add","remove"]},"_alertIds":{"type":"array","description":"Explicit alert ids to update. Mutually exclusive with `_integrationId`.","minItems":1,"items":{"type":"string","format":"objectId"}},"_integrationId":{"type":"string","format":"objectId","description":"When set, the operation applies to every alert under this integration.\nMutually exclusive with `_alertIds`."},"_recipientEmails":{"type":"array","description":"Recipient emails to add or remove. Trimmed, lowercased, and deduplicated.","minItems":1,"maxItems":50,"items":{"type":"string","format":"email"}}}},"AlertBulkRecipientsFailed":{"type":"object","description":"Partial-failure body returned with HTTP 200 when at least one alert in the\nbulk recipients call could not be fully updated. Full success returns 204\nwith no body.","required":["failed"],"properties":{"failed":{"type":"array","description":"Per-alert failures. Successful alerts are omitted.","items":{"type":"object","required":["_id","errors"],"properties":{"_id":{"type":"string","format":"objectId","description":"Alert id that failed."},"affectedRecipientEmails":{"type":"array","description":"Emails implicated in this failure (for example, recipients that\ncould not be removed because they are the last remaining recipient).","items":{"type":"string","format":"email"}},"errors":{"type":"array","description":"Error details for this alert.","minItems":1,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable reason, such as `not_allowed` when the change would\nremove the alert's last recipient, or `invalid_ref` when the id matches\nno alert."},"message":{"type":"string","description":"Human-readable explanation of the failure."},"field":{"type":"string"}}}}}}}}},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized, in one of two shapes.\n\nNo valid bearer token: the auth middleware answers before the endpoint\nhandler runs, with a bare `{message: string}` body — no `code`, no\n`errors` array — so key off the HTTP status and `message`.\n\nAn API token with a custom scope calling an operation its scope does not\ngrant: the token authenticated, and the body is the standard\n`{errors: [...]}` envelope with code `access_restricted`. Observed on\n`GET /v1/connections` and `GET /v1/exports/{_id}`: a full-access API token\npassed both, a personal access token `GET /v1/exports/{_id}`.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"The auth middleware's bare body for a missing or invalid token.","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]},{"$ref":"#/components/schemas/Error"}]}}}},"403-forbidden":{"description":"Forbidden. The authenticated caller does not have permission to perform this operation.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/alerts/bulk/recipients":{"patch":{"operationId":"bulkUpdateAlertRecipients","tags":["Alerts"],"summary":"Bulk update alert recipients","description":"Adds or removes recipients across many alerts in one call. Provide either\n`_alertIds` or `_integrationId` (not both). Both `add` and `remove` accept\n`_recipientEmails`.\n\nFull success returns `204` with no body. Partial failure returns `200` with\n`{ failed: [...] }` only — successful alerts are omitted. There is no\n`success` or `skipped` array. A `remove` never takes an alert's last\nrecipient: that recipient stays, and the alert is listed in `failed[]` with the\nkept email in `affectedRecipientEmails`. An id in `_alertIds` that matches no\nalert is listed there too, not answered with `404`.\n\nRequires permission `put:alert:models`. Returns `403` when\n`ENABLE_PROACTIVE_ALERTS` is off. `add` is limited to one integration per\ncall; `remove` may span integrations.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertBulkRecipientsRequest"}}}},"responses":{"200":{"description":"One or more alerts failed. Body contains only `failed[]`; each entry\nincludes `_id`, optional `affectedRecipientEmails`, and `errors[]`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertBulkRecipientsFailed"}}}},"204":{"description":"All targeted alerts updated successfully."},"400":{"description":"Both or neither of `_alertIds` and `_integrationId` were sent, or `action` is not\n`add` or `remove` (`invalid_field`); or `_integrationId` matches no integration in the\naccount (`invalid_ref`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"$ref":"#/components/responses/403-forbidden"},"404":{"description":"The integration named by `_integrationId` has no alerts. Returned for `add` and\n`remove` alike.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"An id in `_alertIds`, or `_integrationId`, is not a valid ObjectId (`invalid_ref`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Get an alert

> Returns a single proactive alert by id. Soft-deleted alerts return \`404\`.\
> Requires permission \`get:alert:model\`. Returns \`403\` when\
> \`ENABLE\_PROACTIVE\_ALERTS\` is off.\
> \
> With \`populate=true\`, nested flow / integration / recipient objects are\
> returned; otherwise foreign keys are raw ObjectIds.

```json
{"openapi":"3.2.0","info":{"title":"Alerts","version":"1.0.0"},"tags":[{"name":"Alerts","description":"Proactive alerts define long-runtime thresholds and recipients for flows\nor whole integrations. Create, list, update, and delete alerts; bulk-update\nrecipients across many alerts; and fetch per-alert audit history.\n\n## Alert schema\n\n{% openapi-schemas spec=\"alert\" schemas=\"Alert\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Alert":{"type":"object","description":"Proactive alert configuration. Soft-deleted alerts are omitted from list\nand get responses. With `populate=true` on GET, `_flowId` and\n`_integrationId` stay ObjectId strings and the `flow` / `integration`\nenrichment objects are added alongside them; `_recipientUserIds` entries\nbecome `{ _id, name, email }`. POST and PUT always return the unpopulated\nshape.","required":["_id","type","_userId","_integrationId","longRuntime","_recipientUserIds","createdAt","lastModified"],"properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the alert."},"type":{"type":"string","description":"Alert type.","enum":["long-runtime"]},"_userId":{"type":"string","format":"objectId","readOnly":true,"description":"Account owner user id for the alert."},"_integrationId":{"type":"string","format":"objectId","description":"Integration the alert belongs to. Always an ObjectId string. With\n`populate=true` on an integration-level alert, a sibling `integration`\nobject `{ flowCount }` is added; this id is not replaced."},"_flowId":{"type":"string","format":"objectId","description":"Flow for a flow-level alert; omitted on integration-level alerts.\nAlways an ObjectId string — with `populate=true` the display fields\narrive in the sibling `flow` object instead of replacing this value."},"longRuntime":{"type":"object","description":"Configuration for `long-runtime` alerts.","required":["thresholdMinutes"],"properties":{"thresholdMinutes":{"type":"integer","minimum":5,"maximum":59940,"description":"Runtime threshold in minutes. Runs at or above this duration trigger the alert."}}},"_recipientUserIds":{"type":"array","description":"Recipient user ids. Unpopulated responses return ObjectId strings;\nwith `populate=true`, each entry is `{ _id, name, email }`.","minItems":1,"items":{"oneOf":[{"type":"string","format":"objectId"},{"type":"object","required":["_id"],"properties":{"_id":{"type":"string","format":"objectId"},"name":{"type":"string"},"email":{"type":"string","format":"email"}}}]}},"flow":{"type":"object","readOnly":true,"description":"Flow enrichment object. Present on populated GET responses for\nflow-level alerts only (`populate=true`). Never returned on POST or PUT.\nFields: `name`, `isInstanceFlow`, `flowGroupName`.","properties":{"name":{"type":"string","description":"Flow display name."},"isInstanceFlow":{"type":"boolean","description":"Whether this is an instance of an abstract (Integration App) flow."},"flowGroupName":{"type":"string","description":"Name of the flow group this flow belongs to. Absent when the flow is in no group."}}},"integration":{"type":"object","readOnly":true,"description":"Integration enrichment object. Present on populated GET responses for\nintegration-level alerts only (`populate=true`, no `_flowId`). Only\n`flowCount` is returned (not `name`).","properties":{"flowCount":{"type":"integer","description":"Number of non-deleted flows under this integration."}}},"lastTriggeredAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the alert last fired. Absent until the alert first fires;\nthe list's `lastTriggeredAt=never` filter matches those alerts."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"When the alert was created."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"When the alert was last updated."}}},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"400-invalid-id":{"description":"`_id` is not a valid ObjectId.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401-unauthorized":{"description":"Unauthorized, in one of two shapes.\n\nNo valid bearer token: the auth middleware answers before the endpoint\nhandler runs, with a bare `{message: string}` body — no `code`, no\n`errors` array — so key off the HTTP status and `message`.\n\nAn API token with a custom scope calling an operation its scope does not\ngrant: the token authenticated, and the body is the standard\n`{errors: [...]}` envelope with code `access_restricted`. Observed on\n`GET /v1/connections` and `GET /v1/exports/{_id}`: a full-access API token\npassed both, a personal access token `GET /v1/exports/{_id}`.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"The auth middleware's bare body for a missing or invalid token.","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]},{"$ref":"#/components/schemas/Error"}]}}}},"403-forbidden":{"description":"Forbidden. The authenticated caller does not have permission to perform this operation.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404-alert-not-found":{"description":"No alert with this id exists in the account, or the alert was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/alerts/{_id}":{"get":{"operationId":"getAlertById","tags":["Alerts"],"summary":"Get an alert","description":"Returns a single proactive alert by id. Soft-deleted alerts return `404`.\nRequires permission `get:alert:model`. Returns `403` when\n`ENABLE_PROACTIVE_ALERTS` is off.\n\nWith `populate=true`, nested flow / integration / recipient objects are\nreturned; otherwise foreign keys are raw ObjectIds.","parameters":[{"name":"_id","in":"path","required":true,"description":"Alert id.","schema":{"type":"string","format":"objectId"}},{"name":"populate","in":"query","required":false,"description":"When `true`, populate flow, integration, and recipient user fields.","schema":{"type":"string","enum":["true"]}}],"responses":{"200":{"description":"Alert object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Alert"}}}},"400":{"$ref":"#/components/responses/400-invalid-id"},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"$ref":"#/components/responses/403-forbidden"},"404":{"$ref":"#/components/responses/404-alert-not-found"}}}}}}
```

## Update an alert

> Replace-all update of threshold and recipients. \`type\`, \`\_flowId\`, and\
> \`\_integrationId\` are immutable. Resolves \`\_recipientEmails\` the same way\
> as create, then dual-writes the updated threshold to related flow(s).\
> \
> Requires permission \`put:alert:models\`. Returns \`403\` when\
> \`ENABLE\_PROACTIVE\_ALERTS\` is off. Response is always unpopulated.

```json
{"openapi":"3.2.0","info":{"title":"Alerts","version":"1.0.0"},"tags":[{"name":"Alerts","description":"Proactive alerts define long-runtime thresholds and recipients for flows\nor whole integrations. Create, list, update, and delete alerts; bulk-update\nrecipients across many alerts; and fetch per-alert audit history.\n\n## Alert schema\n\n{% openapi-schemas spec=\"alert\" schemas=\"Alert\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"AlertUpdateRequest":{"type":"object","description":"Replace-all update for an alert. `type`, `_flowId`, and `_integrationId`\nare immutable and ignored if sent. Recipients are replace-all via\n`_recipientEmails` (same resolution/invite behavior as create).","required":["longRuntime","_recipientEmails"],"properties":{"longRuntime":{"type":"object","description":"Long-runtime threshold that replaces the stored one.","required":["thresholdMinutes"],"properties":{"thresholdMinutes":{"type":"integer","minimum":5,"maximum":59940,"description":"Runtime threshold in minutes."}}},"_recipientEmails":{"type":"array","description":"Full replacement recipient email list. Trimmed, lowercased, and\ndeduplicated server-side. Must contain at least one address.","minItems":1,"maxItems":50,"items":{"type":"string","format":"email"}}}},"Alert":{"type":"object","description":"Proactive alert configuration. Soft-deleted alerts are omitted from list\nand get responses. With `populate=true` on GET, `_flowId` and\n`_integrationId` stay ObjectId strings and the `flow` / `integration`\nenrichment objects are added alongside them; `_recipientUserIds` entries\nbecome `{ _id, name, email }`. POST and PUT always return the unpopulated\nshape.","required":["_id","type","_userId","_integrationId","longRuntime","_recipientUserIds","createdAt","lastModified"],"properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the alert."},"type":{"type":"string","description":"Alert type.","enum":["long-runtime"]},"_userId":{"type":"string","format":"objectId","readOnly":true,"description":"Account owner user id for the alert."},"_integrationId":{"type":"string","format":"objectId","description":"Integration the alert belongs to. Always an ObjectId string. With\n`populate=true` on an integration-level alert, a sibling `integration`\nobject `{ flowCount }` is added; this id is not replaced."},"_flowId":{"type":"string","format":"objectId","description":"Flow for a flow-level alert; omitted on integration-level alerts.\nAlways an ObjectId string — with `populate=true` the display fields\narrive in the sibling `flow` object instead of replacing this value."},"longRuntime":{"type":"object","description":"Configuration for `long-runtime` alerts.","required":["thresholdMinutes"],"properties":{"thresholdMinutes":{"type":"integer","minimum":5,"maximum":59940,"description":"Runtime threshold in minutes. Runs at or above this duration trigger the alert."}}},"_recipientUserIds":{"type":"array","description":"Recipient user ids. Unpopulated responses return ObjectId strings;\nwith `populate=true`, each entry is `{ _id, name, email }`.","minItems":1,"items":{"oneOf":[{"type":"string","format":"objectId"},{"type":"object","required":["_id"],"properties":{"_id":{"type":"string","format":"objectId"},"name":{"type":"string"},"email":{"type":"string","format":"email"}}}]}},"flow":{"type":"object","readOnly":true,"description":"Flow enrichment object. Present on populated GET responses for\nflow-level alerts only (`populate=true`). Never returned on POST or PUT.\nFields: `name`, `isInstanceFlow`, `flowGroupName`.","properties":{"name":{"type":"string","description":"Flow display name."},"isInstanceFlow":{"type":"boolean","description":"Whether this is an instance of an abstract (Integration App) flow."},"flowGroupName":{"type":"string","description":"Name of the flow group this flow belongs to. Absent when the flow is in no group."}}},"integration":{"type":"object","readOnly":true,"description":"Integration enrichment object. Present on populated GET responses for\nintegration-level alerts only (`populate=true`, no `_flowId`). Only\n`flowCount` is returned (not `name`).","properties":{"flowCount":{"type":"integer","description":"Number of non-deleted flows under this integration."}}},"lastTriggeredAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the alert last fired. Absent until the alert first fires;\nthe list's `lastTriggeredAt=never` filter matches those alerts."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"When the alert was created."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"When the alert was last updated."}}},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized, in one of two shapes.\n\nNo valid bearer token: the auth middleware answers before the endpoint\nhandler runs, with a bare `{message: string}` body — no `code`, no\n`errors` array — so key off the HTTP status and `message`.\n\nAn API token with a custom scope calling an operation its scope does not\ngrant: the token authenticated, and the body is the standard\n`{errors: [...]}` envelope with code `access_restricted`. Observed on\n`GET /v1/connections` and `GET /v1/exports/{_id}`: a full-access API token\npassed both, a personal access token `GET /v1/exports/{_id}`.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"The auth middleware's bare body for a missing or invalid token.","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]},{"$ref":"#/components/schemas/Error"}]}}}},"403-forbidden":{"description":"Forbidden. The authenticated caller does not have permission to perform this operation.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404-alert-not-found":{"description":"No alert with this id exists in the account, or the alert was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422-unprocessable-entity":{"description":"Unprocessable entity. The request was well-formed but was unable to be followed due to semantic errors.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/alerts/{_id}":{"put":{"operationId":"updateAlert","tags":["Alerts"],"summary":"Update an alert","description":"Replace-all update of threshold and recipients. `type`, `_flowId`, and\n`_integrationId` are immutable. Resolves `_recipientEmails` the same way\nas create, then dual-writes the updated threshold to related flow(s).\n\nRequires permission `put:alert:models`. Returns `403` when\n`ENABLE_PROACTIVE_ALERTS` is off. Response is always unpopulated.","parameters":[{"name":"_id","in":"path","required":true,"description":"Alert id.","schema":{"type":"string","format":"objectId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertUpdateRequest"}}}},"responses":{"200":{"description":"Updated alert (unpopulated ObjectIds).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Alert"}}}},"400":{"description":"The body is empty (`invalid_request`), has no `_recipientEmails`\n(`missing_required_field`), or carries a threshold out of range (`invalid_field`);\nor `_id` is not a valid ObjectId (`invalid_ref`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"$ref":"#/components/responses/403-forbidden"},"404":{"$ref":"#/components/responses/404-alert-not-found"},"422":{"$ref":"#/components/responses/422-unprocessable-entity"}}}}}}
```

## Delete an alert

> Soft-deletes an alert and clears \`\_\_longRuntimeThresholdMinutes\` on the\
> related flow document(s), which moves each flow's \`lastModified\`. A\
> deleted alert reads 404 and has no recycle-bin entry. Requires permission\
> \`put:alert:models\`. Returns\
> \`403\` when \`ENABLE\_PROACTIVE\_ALERTS\` is off.

```json
{"openapi":"3.2.0","info":{"title":"Alerts","version":"1.0.0"},"tags":[{"name":"Alerts","description":"Proactive alerts define long-runtime thresholds and recipients for flows\nor whole integrations. Create, list, update, and delete alerts; bulk-update\nrecipients across many alerts; and fetch per-alert audit history.\n\n## Alert schema\n\n{% openapi-schemas spec=\"alert\" schemas=\"Alert\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"responses":{"400-invalid-id":{"description":"`_id` is not a valid ObjectId.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401-unauthorized":{"description":"Unauthorized, in one of two shapes.\n\nNo valid bearer token: the auth middleware answers before the endpoint\nhandler runs, with a bare `{message: string}` body — no `code`, no\n`errors` array — so key off the HTTP status and `message`.\n\nAn API token with a custom scope calling an operation its scope does not\ngrant: the token authenticated, and the body is the standard\n`{errors: [...]}` envelope with code `access_restricted`. Observed on\n`GET /v1/connections` and `GET /v1/exports/{_id}`: a full-access API token\npassed both, a personal access token `GET /v1/exports/{_id}`.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"The auth middleware's bare body for a missing or invalid token.","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]},{"$ref":"#/components/schemas/Error"}]}}}},"403-forbidden":{"description":"Forbidden. The authenticated caller does not have permission to perform this operation.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404-alert-not-found":{"description":"No alert with this id exists in the account, or the alert was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}}},"paths":{"/v1/alerts/{_id}":{"delete":{"operationId":"deleteAlert","tags":["Alerts"],"summary":"Delete an alert","description":"Soft-deletes an alert and clears `__longRuntimeThresholdMinutes` on the\nrelated flow document(s), which moves each flow's `lastModified`. A\ndeleted alert reads 404 and has no recycle-bin entry. Requires permission\n`put:alert:models`. Returns\n`403` when `ENABLE_PROACTIVE_ALERTS` is off.","parameters":[{"name":"_id","in":"path","required":true,"description":"Alert id.","schema":{"type":"string","format":"objectId"}}],"responses":{"204":{"description":"Alert soft-deleted."},"400":{"$ref":"#/components/responses/400-invalid-id"},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"$ref":"#/components/responses/403-forbidden"},"404":{"$ref":"#/components/responses/404-alert-not-found"}}}}}}
```

## Get audit log for an alert

> Returns the change history for an alert. Each entry records a mutation\
> event with who made the change, when, and which fields were affected.\
> \
> Requires permission to read the alert (\`get:alert:model\`). Returns \`403\`\
> when \`ENABLE\_PROACTIVE\_ALERTS\` is off or the caller lacks access.\
> \
> The history stays readable after the alert is deleted, even though the alert\
> itself then reads 404. The same entries also appear in the integration's audit\
> log (\`GET /v1/integrations/{\_id}/audit\`).

```json
{"openapi":"3.2.0","info":{"title":"Alerts","version":"1.0.0"},"tags":[{"name":"Alerts","description":"Proactive alerts define long-runtime thresholds and recipients for flows\nor whole integrations. Create, list, update, and delete alerts; bulk-update\nrecipients across many alerts; and fetch per-alert audit history.\n\n## Alert schema\n\n{% openapi-schemas spec=\"alert\" schemas=\"Alert\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"From":{"name":"from","in":"query","required":false,"description":"Only return entries at or after this timestamp. On a `platform` license, leaving it out limits\nthe range to the year before `to` (or the last year when `to` is omitted too), and a value older\nthan the audit window — the license's `auditLogRetentionYears` — starts the range at the\nwindow's edge instead of failing. A future value fails with 422 `invalid_time_period`.","schema":{"type":"string","format":"date-time"}},"To":{"name":"to","in":"query","required":false,"description":"Only return entries at or before this timestamp. A future value, or one older than the\naccount's audit window, fails with 422 `invalid_time_period`; the message names the window in\nyears (the license's `auditLogRetentionYears` on a `platform` license). A value earlier than\n`from` fails with 422 `invalid_time_range`.","schema":{"type":"string","format":"date-time"}}},"responses":{"400-bad-request":{"description":"Bad request. The server could not understand the request because of malformed syntax or invalid parameters.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401-unauthorized":{"description":"Unauthorized, in one of two shapes.\n\nNo valid bearer token: the auth middleware answers before the endpoint\nhandler runs, with a bare `{message: string}` body — no `code`, no\n`errors` array — so key off the HTTP status and `message`.\n\nAn API token with a custom scope calling an operation its scope does not\ngrant: the token authenticated, and the body is the standard\n`{errors: [...]}` envelope with code `access_restricted`. Observed on\n`GET /v1/connections` and `GET /v1/exports/{_id}`: a full-access API token\npassed both, a personal access token `GET /v1/exports/{_id}`.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"The auth middleware's bare body for a missing or invalid token.","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]},{"$ref":"#/components/schemas/Error"}]}}}},"403-forbidden":{"description":"Forbidden. The authenticated caller does not have permission to perform this operation.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422-invalid-audit-query":{"description":"A query value is invalid: a filter outside the audit vocabulary (`invalid_audit_field`), a\n`from` or `to` that is not ISO 8601 (`invalid_timestamp_format`), a bound in the future or a `to`\nolder than the account's audit window (`invalid_time_period`), or a `from` later than `to`\n(`invalid_time_range`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}}},"paths":{"/v1/alerts/{_id}/audit":{"get":{"operationId":"getAlertAudit","tags":["Alerts"],"summary":"Get audit log for an alert","description":"Returns the change history for an alert. Each entry records a mutation\nevent with who made the change, when, and which fields were affected.\n\nRequires permission to read the alert (`get:alert:model`). Returns `403`\nwhen `ENABLE_PROACTIVE_ALERTS` is off or the caller lacks access.\n\nThe history stays readable after the alert is deleted, even though the alert\nitself then reads 404. The same entries also appear in the integration's audit\nlog (`GET /v1/integrations/{_id}/audit`).","parameters":[{"name":"_id","in":"path","description":"Alert ID.","required":true,"schema":{"type":"string","format":"objectId"}},{"name":"limit","in":"query","description":"Maximum number of audit entries to return per page.","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":1000}},{"name":"after","in":"query","required":false,"description":"Opaque pagination cursor for the next page. Take it from the `after` value in the `Link`\nresponse header's `rel=\"next\"` URL rather than constructing it.","schema":{"type":"string"}},{"$ref":"#/components/parameters/From"},{"$ref":"#/components/parameters/To"}],"responses":{"200":{"description":"Audit entries for the alert.","headers":{"Link":{"description":"Pagination link header. When more results exist, includes\n`rel=\"next\"` with an `after` cursor.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","format":"objectId","description":"Audit entry id."},"resourceType":{"type":"string","description":"Resource type for this entry.","enum":["alert"]},"_resourceId":{"type":"string","format":"objectId","description":"Alert id."},"resourceName":{"type":"string","description":"Display name of the alert: `<type label> - <flow name>` for a flow-level\nalert, `<type label> - All flows (<integration name>)` for an\nintegration-level alert."},"event":{"type":"string","description":"Mutation event type.","enum":["create","update","delete"]},"source":{"type":"string","description":"How the change was initiated.","enum":["api","ui","system"]},"time":{"type":"string","format":"date-time","description":"When the change occurred."},"byUser":{"type":"object","description":"User who made the change.","properties":{"_id":{"type":"string","format":"objectId","description":"User ID."},"email":{"type":"string","format":"email","description":"User email address."},"name":{"type":"string","description":"User display name."}}},"fieldChanges":{"type":"array","description":"Fields that were modified.","items":{"type":"object","properties":{"fieldPath":{"type":"string","description":"Dot-notation path of the changed field. A recipient change is reported\nas `recipients`, listing the recipients' email addresses instead of user\nids."},"oldValue":{"description":"Previous value (absent on create)."},"newValue":{"description":"New value (absent on delete)."}}}},"deletedInfo":{"type":"object","description":"Metadata about the deleted alert. Once the alert is deleted, every entry in its\nhistory carries it, not only the `delete` entry.","properties":{"name":{"type":"string","description":"Display name of the alert at the time of deletion."},"_integrationId":{"type":"string","format":"objectId","description":"Integration the alert belonged to."}}}}}}}}},"204":{"description":"No audit entries exist for this alert."},"400":{"$ref":"#/components/responses/400-bad-request"},"401":{"$ref":"#/components/responses/401-unauthorized"},"403":{"$ref":"#/components/responses/403-forbidden"},"404":{"$ref":"#/components/responses/404-not-found"},"422":{"$ref":"#/components/responses/422-invalid-audit-query"}}}}}}
```


---

# 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/api/api-reference/monitoring/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.
