# Get alerts

`GET /v2/environments/{environmentId}/alerts`

Available as MCP tool `get-alerts-v2` (Read).

Alert endpoints allow you to review or manage traffic alert rules, which monitor your integrations for healthy traffic. [Learn about alert rules](https://docs.redoxengine.com/permalink/RqjicoYocYtUDfFmaaoSt/#monitor-data-exchange-health) or [manage alert rules in the Redox dashboard](https://docs.redoxengine.com/permalink/39Lf3qtqeHmCZkFaKf5jKz).

There are different types of traffic alert rules: 

<details>
<summary>No traffic alert rule</summary>

A <u>No traffic</u> alert rule monitors whether traffic is flowing appropriately in a given subscription. 

With this type of alert rule, you receive a notification when no logs reach a terminal state (i.e., `Succeeded`, `Filtered`, `Failed`) during a given time period (i.e., as little as 30 minutes up to 72 hours). 

This type of alert isn’t meant for tracking errors since failed logs count as completed traffic. 

> **Pending logs not included**
>
> This doesn’t include pending logs since they aren’t in a terminal state.

</details>

<details>
<summary>Low traffic alert rule</summary>

A <u>Low traffic</u> alert rule monitors whether traffic is flowing as anticipated in a given subscription. 

With this type of alert rule, you receive a notification if less than X number of logs reach a terminal state (i.e., `Succeeded`, `Filtered`, `Failed`) within a specified time (i.e., as little as 30 minutes up to 72 hours).

This type of alert rule is one step more preemptive than a <u>no traffic</u> alert type since it can help you catch an unexpected dip in traffic before reaching no traffic at all. However, it still isn’t meant for tracking errors since failed logs count as completed traffic. 

> **Pending logs not included**
>
> This doesn’t include pending logs since they aren’t in a terminal state.

</details>

<details>
<summary>Error threshold alert rules</summary>

An <u>Error Threshold</u> alert rule monitors the number of errors in a given subscription. 

With this type of alert rule, you receive a notification if X number of logs reach a terminal state of `Failed` and will no longer be retried within a specified time (i.e., as little as 15 minutes up to 24 hours).

</details>

<details>
<summary>Retry threshold alert rule</summary>

A <u>Retry threshold</u> alert rule monitors the number of retries for any log in a given subscription. 

With this type of alert rule, you receive a notification if one or more logs has been retried more than X number of times within 15 minutes (this is a static lookback time).

For example, if you configure an alert rule with a retry threshold of 10, the alert rule triggers if one or more logs have reached at least 10 retries within the last 15 minutes. These logs might continue retrying, but the alert rule doesn’t clear until all logs for the linked subscription reach a terminal state or have fewer than 10 retries within 15 minutes. 

> **What’s not included**
>
> A <u>Retry threshold</u> alert doesn’t measure the cumulative number of retries for all logs combined, nor does it measure the number of individual logs that are retrying.

</details>

You can retrieve an alert rule, as well as create, update, or delete it. Alternatively, you can retrieve a list of alert rules. An alert rule response contains details about any related subscription links.  

You can also retrieve a subscription link for an alert rule, as well as create, pause, or delete it.

 

### Get alerts

Retrieve a list of existing traffic alert rules for a specific environment within a Redox organization. You can only retrieve a list of alerts for one environment per query.

## Request parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `environmentId` | path | string | Yes | Identifies the specific environment that you're operating in or on behalf of. |

## Request example

```bash
curl 'https://api.redoxengine.com/platform/v2/environments/{environmentId}/alerts' \
--request GET \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'accept: application/json'
```

## Responses

### 200

Contains a payload object with a list of any alerts for the specified environment.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `meta` | object | No |  |
| `meta.version` | string | No | Lists the major and minor version number for the format of the returned payload. The payload format or shape may change between minor versions, like including additional or extended fields in later versions. We include the version data in each response so that you have the option to handle the signaled differences. |
| `payload` | object | No |  |
| `payload.alerts` | Array of object | No |  |
| `payload.alerts[].id` | string (uuid) | No | Displays the unique identifier of the link for a given alert. |
| `payload.alerts[].name` | string | No | Displays the name of the alert. |
| `payload.alerts[].environment` | object | No | Contains metadata about the environment within the associated Redox organization. |
| `payload.alerts[].environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.alerts[].organization` | object | No | Contains metadata about the Redox organization. |
| `payload.alerts[].organization.id` | number | No | Contains the unique identifier of the Redox organization. |
| `payload.alerts[].organization.name` | string, nullable | No | Contains the human-readable name of the Redox organization. |
| `payload.alerts[].alertType` | object | No | Specifies the type of alert. |
| `payload.alerts[].alertType.code` | string | No | Describes the alert type. Possible values: no-traffic, error-threshold, low-traffic, retry-threshold |
| `payload.alerts[].alertConfiguration` | No Traffic or Error Threshold or Low Traffic or Retry Threshold | No | Contains the alert configuration fields for the specified type of traffic alert rule. |
| `payload.alerts[].alertConfiguration (No Traffic).alertLookbackISODuration` | string | No | Specifies the ISO duration or time range that the traffic alert rule should evaluate for the trigger condition. For example, whether the condition is met in the most recent 2 hours. Possible values: PT30M, PT1H, PT2H, PT6H, PT12H, PT24H, PT48H, PT72H |
| `payload.alerts[].alertConfiguration (Error Threshold).alertLookbackISODuration` | string | No | Specifies the ISO duration or time range that the traffic alert rule should evaluate for the trigger condition. For example, whether the condition is met in the most recent 2 hours. Possible values: PT15M, PT30M, PT1H, PT2H, PT6H, PT12H, PT24H |
| `payload.alerts[].alertConfiguration (Error Threshold).errorThreshold` | number | No | Defines the allowable number of failed logs during the designated time frame before a notification is sent. For example, if set to 5, a notification is sent when 5 logs have failed. |
| `payload.alerts[].alertConfiguration (Low Traffic).alertLookbackISODuration` | string | No | Specifies the ISO duration or time range that the traffic alert rule should evaluate for the trigger condition. For example, whether the condition is met in the most recent 2 hours. Possible values: PT30M, PT1H, PT2H, PT6H, PT12H, PT24H, PT48H, PT72H |
| `payload.alerts[].alertConfiguration (Low Traffic).trafficThreshold` | number | No | Defines the least amount of desired logs during the designated time frame before a notification is sent. For example, if set to 5 within 30 minutes, a notification is sent when less than 5 logs have processed during a given 30-minute block. |
| `payload.alerts[].alertConfiguration (Retry Threshold).retryThreshold` | number | No | Defines the number of retries on a single log during the designated time frame before a notification is sent. For example, if set to 5, a notification is sent if a log has been retried at least 5 times during the static lookback time of 15 minutes. |
| `payload.alerts[].notification` | object | No | Contains the notification configuration fields for the specified type of traffic alert rule. |
| `payload.alerts[].notification.id` | string (uuid) | No | Displays the unique identifier of this notification configuration. |
| `payload.alerts[].notification.type` | any | No | Value: email |
| `payload.alerts[].notification.configuration` | object | No | Contains the configuration field for the traffic alert rule. |
| `payload.alerts[].notification.configuration.to` | Array of string | No | Defines the list of email addresses that a notification is sent to whenever the traffic alert rule is either triggered or resolved. At least one email must be listed. |
| `payload.alerts[].ignoreDaysOfWeek` | Array of string | No | Designates the days of the week that your organization won't receive notifications for this alert if triggered. Possible values: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY |
| `payload.alerts[].ignoreHolidays` | boolean | No | Indicates whether your organization will receive notifications for this alert on holidays, as specified by Redox. |
| `payload.alerts[].timeZone` | string, nullable | No | Indicates the time zone that will be used for ignored days. Redox doesn't send alert notifications on ignored days. Set to `null` if you want to use the default time zone, which is the time zone designated by your connection's organization settings. If not designated, U.S. Central time will be the default instead. Possible values: America/Adak, America/Anchorage, America/Chicago, America/Denver, America/Edmonton, America/Halifax, America/Los_Angeles, America/New_York, America/Phoenix, America/Regina, America/St_Johns, America/Toronto, America/Vancouver, America/Winnipeg, Pacific/Honolulu, UTC |
| `payload.alerts[].alertLinks` | Array of object | No | Contains any links related to this alert. |
| `payload.alerts[].alertLinks[].id` | string (uuid) | No | Displays the unique identifier of the link for a specified alert. |
| `payload.alerts[].alertLinks[].assignment` | object | No | Specifies the alert this link is assigned to. |
| `payload.alerts[].alertLinks[].assignment.id` | string | No | Contains the unique identifier of the alert. |
| `payload.alerts[].alertLinks[].assignment.kind` | string | No | Identifies what kind of link is assigned. Value: alert |
| `payload.alerts[].alertLinks[].subscription` | object | No | Identifies the subscription that the alert is linked to. |
| `payload.alerts[].alertLinks[].subscription.id` | number | No | Contains the unique identifier of subscription. |
| `payload.alerts[].alertLinks[].subscription.dataModel` | string | No | Identifies the Redox data model that the link applies to. |
| `payload.alerts[].alertLinks[].subscription.source` | object | No | Specifies the source of the subscription that the alert is linked to. |
| `payload.alerts[].alertLinks[].subscription.source.id` | string | No | Contains the unique identifier of the source. |
| `payload.alerts[].alertLinks[].subscription.source.name` | string, nullable | No | Displays the human-readable name of the source. |
| `payload.alerts[].alertLinks[].subscription.destination` | object | No | Specifies the destination of the subscription that the alert is linked to. |
| `payload.alerts[].alertLinks[].subscription.destination.id` | string | No | Contains the unique identifier of the destination. |
| `payload.alerts[].alertLinks[].subscription.destination.name` | string, nullable | No | Displays the human-readable name of the destination. |
| `payload.alerts[].alertLinks[].subscription.serviceRegion` | string | No | Identifies the region that the subscription is operating in. Possible values: AWS_USA_EAST_1, AWS_CAN_CENTRAL, GCP_USA_CENTRAL_1 |
| `payload.alerts[].alertLinks[].connectingOrganization` | object | No | Specifies the organization the asset is connected to when the subscription relates to a partner organization. |
| `payload.alerts[].alertLinks[].connectingOrganization.id` | number | No | Contains the unique identifier of the Redox organization. |
| `payload.alerts[].alertLinks[].connectingOrganization.name` | string, nullable | No | Contains the human-readable name of the Redox organization. |
| `payload.alerts[].alertLinks[].latestStatus` | object | No | Contains the code and timestamp for the current status of the alert for this link. |
| `payload.alerts[].alertLinks[].latestStatus.code` | string | No | Describes the current status of the alert. Possible values: triggered, okay, paused, unknown |
| `payload.alerts[].alertLinks[].latestStatus.timestamp` | string | No | Contains date and time for the current status update. |
| `payload.alerts[].alertLinks[].environment` | object | No | Contains metadata about the environment within the associated Redox organization. |
| `payload.alerts[].alertLinks[].environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.alerts[].alertLinks[].createdAt` | string | No | Displays the date and time that the asset was originally created in ISO 8601 format. |
| `payload.alerts[].alertLinks[].createdBy` | object | No | Contains the metadata about the user who created the asset. |
| `payload.alerts[].alertLinks[].createdBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.alerts[].alertLinks[].createdBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.alerts[].alertLinks[].createdBy.email` | string, nullable | No | Displays the user's email address. |
| `payload.alerts[].alertLinks[].updatedAt` | string | No | Displays the date and time that the asset was last updated in ISO 8601 format. |
| `payload.alerts[].alertLinks[].updatedBy` | object | No | Contains the metadata about the user who last updated the asset. |
| `payload.alerts[].alertLinks[].updatedBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.alerts[].alertLinks[].updatedBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.alerts[].alertLinks[].updatedBy.email` | string, nullable | No | Displays the user's email address. |
| `payload.alerts[].createdAt` | string | No | Displays the date and time that the asset was originally created in ISO 8601 format. |
| `payload.alerts[].createdBy` | object | No | Contains the metadata about the user who created the asset. |
| `payload.alerts[].createdBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.alerts[].createdBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.alerts[].createdBy.email` | string, nullable | No | Displays the user's email address. |
| `payload.alerts[].updatedAt` | string | No | Displays the date and time that the asset was last updated in ISO 8601 format. |
| `payload.alerts[].updatedBy` | object | No | Contains the metadata about the user who last updated the asset. |
| `payload.alerts[].updatedBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.alerts[].updatedBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.alerts[].updatedBy.email` | string, nullable | No | Displays the user's email address. |

_Generated from the schema: the values are placeholders, not a real payload._

```json
{
  "meta": {
    "version": "1.0.0"
  },
  "payload": {
    "alerts": [
      {
        "id": "dc5d2a43-df19-459c-b14f-450584ce1c55",
        "name": "My important alert",
        "environment": {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        },
        "organization": {
          "id": 122,
          "name": "string"
        },
        "alertType": {
          "code": "no-traffic"
        },
        "alertConfiguration": {
          "alertLookbackISODuration": "PT12H"
        },
        "notification": {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "type": "email",
          "configuration": {
            "to": [
              "exampleEmail@example.com"
            ]
          }
        },
        "ignoreDaysOfWeek": [
          "MONDAY"
        ],
        "ignoreHolidays": false,
        "timeZone": "America/Adak",
        "alertLinks": [
          {
            "id": "dc5d2a43-df19-459c-b14f-450584ce1c55",
            "assignment": {
              "id": "1ee1d994-652f-44b5-9342-4b3e8b9918ee",
              "kind": "alert"
            },
            "subscription": {
              "id": "8675309",
              "dataModel": "PatientAdmin",
              "source": {
                "id": "1ee1d994-652f-44b5-9342-4b3e8b9918ee",
                "name": "string"
              },
              "destination": {
                "id": "39a858ea-4474-4d04-b37e-88862fe4054d",
                "name": "string"
              },
              "serviceRegion": "AWS_USA_EAST_1"
            },
            "connectingOrganization": {
              "id": 122,
              "name": "string"
            },
            "latestStatus": {
              "code": "triggered",
              "timestamp": "2024-04-28T19:17:16.719Z"
            },
            "environment": {
              "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
            },
            "createdAt": "2024-04-25T18:17:16.719Z",
            "createdBy": {
              "id": 0,
              "name": "string",
              "email": "string"
            },
            "updatedAt": "2024-04-25T18:17:16.719Z",
            "updatedBy": {
              "id": 0,
              "name": "string",
              "email": "string"
            }
          }
        ],
        "createdAt": "2024-04-25T18:17:16.719Z",
        "createdBy": {
          "id": 0,
          "name": "string",
          "email": "string"
        },
        "updatedAt": "2024-04-25T18:17:16.719Z",
        "updatedBy": {
          "id": 0,
          "name": "string",
          "email": "string"
        }
      }
    ]
  }
}
```

### 400

Bad Request

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.error` | object | No | Contains the error message details. |
| `payload.error.id` | string | No | Contains a unique identifier for the given error instance. |
| `payload.error.title` | string | No | Displays the high-level error message, typically something succinct like `Bad Request`. |
| `payload.error.code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |
| `payload.error.detail` | string | No | Contains the specific error details for this message. |
| `payload.error.status` | number | No | Displays the corresponding HTTP status code for the error. |
| `payload.error.transient` | boolean | No | Describes whether the error will resolve itself. If `true`, no further action needs to be taken. If `false`, you may need to troubleshoot on your end to resolve the issue before the error can be processed. |

```json
{
  "payload": {
    "error": {
      "title": "Bad Request",
      "code": "validation.error.bad.request",
      "detail": "Error details",
      "status": 400,
      "transient": false
    }
  }
}
```

### 403

Forbidden

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.errors` | Array of object | No |  |
| `payload.errors[].title` | string | No | Displays the high-level error message, typically something succinct like `Forbidden`. |
| `payload.errors[].code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |

```json
{
  "payload": {
    "errors": [
      {
        "title": "Forbidden",
        "code": "authorization.forbidden"
      }
    ]
  }
}
```

### 500

Internal Server Error

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.error` | object | No | Contains the error message details. |
| `payload.error.title` | string | No | Displays the high-level error message, typically something succinct like `Failed in step X`. |
| `payload.error.code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |
| `payload.error.detail` | string | No | Contains the specific error details for this message. |
| `payload.error.status` | number | No | Displays the corresponding HTTP status code for the error. |
| `payload.error.transient` | boolean | No | Describes whether the error will resolve itself. If `true`, no further action needs to be taken. If `false`, you may need to troubleshoot on your end to resolve the issue before the error can be processed. |

```json
{
  "payload": {
    "error": {
      "title": "Internal Server Error",
      "code": "failed.db.lookup",
      "detail": "Error details",
      "status": 500,
      "transient": true
    }
  }
}
```
