> ## Documentation Index
> Fetch the complete documentation index at: https://developers.chameleon.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Alert Groups

> Alert Groups are used for Tours and Microsurveys to notify any relevant Team members when an Experience is in violation of the alert conditions.

In the HTTP Response for [Listing](https://developers.chameleon.io/apis/alert-groups.md#alert-groups-index) and [Showing](https://developers.chameleon.io/apis/alert-groups.md#alert-groups-show) Alert Groups,
the full list of matching [Experiences](https://developers.chameleon.io/concepts/experiences) are returned as the `experiences` key.

***

## Schema

| Property | Type | Description |
| - | - | - |
| `id` | ID | The Chameleon ID |
| `created_at` | timestamp | When this happened or when this was added to the Database |
| `updated_at` | timestamp | The last time any property was updated |
| `name` | string | The name given by an administrator of Chameleon |
| `kind` | string | The kind of matched Experiences for this Alert Group. [More info ↓](https://developers.chameleon.io/apis/alert-groups.md#alert-group-kinds): One of `all`, `tour`, `survey`, `tags`, or `campaigns` |
| `interval` | number | # of days that the alerting condition should wait before triggering a violation |
| `published_at` | timestamp | The time this was most recently published |
| `style` | string | The style of alert condition to evaluate. [More info ↓](https://developers.chameleon.io/apis/alert-groups.md#alert-group-styles): One of `unseen` or `uncompleted` |
| `last_notified_at` | timestamp | Last time this alert was triggered for any Experience |
| `tag_ids` | array | When `kind=tags`, the IDs of the [Tags](https://developers.chameleon.io/apis/tags.md) that Experiences must be tagged with to be included in this Alert Group |
| `campaign_ids` | array | When `kind=campaigns`, the IDs of the [Experiences](https://developers.chameleon.io/concepts/experiences) to be included in this Alert Group |
| `slack_uid` | string | The Slack channel ID to notify on, only when `opt_in_slack_at` has a value |
| `opt_in_slack_at` | timestamp | Whether or not to send triggered alerts to Slack on the `slack_uid` channel |
| `emails` | array | The email address(es) to message, only when `opt_in_email_at` has a value |
| `opt_in_email_at` | timestamp | Whether or not to send triggered alerts to the given list of `emails` |

##### Kinds of Alert Groups (`kind` property)

An Alert Group creates a **dynamic** or **static** group of Experiences. Each experience is checked for violation of the alert conditions.

| Kind | - | Description |
| - | - | - |
| `all` | dynamic | All currently published [Tours](https://developers.chameleon.io/apis/tours.md) + [Microsurveys](https://developers.chameleon.io/apis/surveys.md) |
| `tour` | dynamic | All published [Tours](https://developers.chameleon.io/apis/tours.md) |
| `survey` | dynamic | All published [Microsurveys](https://developers.chameleon.io/apis/surveys.md) |
| `tags` | dynamic | All published [Tours](https://developers.chameleon.io/apis/tours.md) + [Microsurveys](https://developers.chameleon.io/apis/surveys.md) with ***any*** of the specified [Tags](https://developers.chameleon.io/apis/tags.md) in the `tag_ids` list |
| `campaigns` | static | All published [Tours](https://developers.chameleon.io/apis/tours.md) + [Microsurveys](https://developers.chameleon.io/apis/surveys.md) ***explicitly*** in the `campaign_ids` list |

##### Alerting conditions (`style` property)

| Kind | - | Description |
| - | - | - |
| `unseen` | - | An Experience that is not Seen (i.e. displayed to any User) during the `interval` # of days will trigger an alert. |
| `uncompleted` | - | An Experience that is not Completed (i.e. no User finished) during the `interval` # of days will trigger an alert. |

## Listing Alert Groups

Retrieve a list of **all** Alert Groups and **all** currently matching [Experiences](https://developers.chameleon.io/concepts/experiences).
An account typically has 1-5 Alert Groups so this response should be relatively small.

#### HTTP Request

```http title="GET" theme={null}
https://api.chameleon.io/v3/edit/alert_groups
```

#### HTTP Response

```json theme={null}
{
  "alert_groups": [
    {
      "id": "5f3c4232c712de665632a6e2",
      "name": "Research opportunities flow (at least 1 per 2 weeks)",
      "interval": 14,
      "style": "uncompleted",
      "kind": "campaigns",
      "campaign_ids": [
        "5f3c4232c712de665632a6d5",
        "5f3c4232c712de665632a2a3"
      ],
      ...
      "experiences": [
        {
          "id": "5f3c4232c712de665632a6d5",
          "name": "Research: Planed New Feature X",
          ...
        },
        {
          "id": "5f3c4232c712de665632a2a3",
          "name": "Research: New Feature Z",
          ...
        }
      ]
    },
    {
      "id": "5f3c4232c712de665632a6e1",
      "name": "Any Tour/Microsurvey that goes 1 week without a completion",
      "interval": 7,
      "style": "uncompleted",
      "kind": "all",
      ...
      "experiences": [
        ...
      ]
    },
    {
      "id": "5f3c4232c712de665632a6d8",
      "name": "Broken Feature announcements (1 day not Seen)",
      "interval": 1,
      "style": "unseen",
      "kind": "tags",
      "tag_ids": [
        "5f3c4232c712de665632a5d7",
        "5f3c4232c712de665632aa3b"
      ],
      ...
      "experiences": [
        ...
      ]
    },
    ...
  ]
}
```

***

## Showing an Alert Group

Retrieve a single Alert Group and **all** currently matching [Experiences](https://developers.chameleon.io/concepts/experiences).

#### HTTP Request

| param | - | description |
| - | - | - |
| `id` | required | An Alert Group ID to lookup |

```http title="GET" theme={null}
https://api.chameleon.io/v3/edit/alert_groups/:id
```

#### HTTP Response

```json theme={null}
{
  "alert_group": {
    "id": "5f3c4232c712de665632a6e2",
    "name": "Research opportunities flow (at least 1 per 2 weeks)",
    "interval": 14,
    "style": "uncompleted",
    "kind": "campaigns",
    "campaign_ids": [
      "5f3c4232c712de665632a6d5",
      "5f3c4232c712de665632a2a3"
    ],
    "experiences": [
      {
        "id": "5f3c4232c712de665632a6d5",
        "name": "Research: Planed New Feature X",
        ...
      },
      {
        "id": "5f3c4232c712de665632a2a3",
        "name": "Research: New Feature Z",
        ...
      }
    ],
    ...
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.