# <a id="bitdrift.public.unary.alerts.v1.IssuesAlertsService"></a>IssuesAlertsService

**Source definition:** [`src/bitdrift/public/unary/alerts/v1/issue_alerts.proto#L355-L368`](<https://github.com/bitdriftlabs/api/blob/main/src/bitdrift/public/unary/alerts/v1/issue_alerts.proto#L355-L368>)

Provides issues alert configuration, listing, and history operations.

### <a id="GetAlertConfig"></a>GetAlertConfig

Gets the alert configuration for an issues view.

<section class="proto-service-table" markdown>

| Request | Response |
| - | - |
| <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">alerts</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">GetIssuesAlertConfigRequest</i>](bitdrift_public_unary_alerts_v1_GetIssuesAlertConfigRequest.md "bitdrift.public.unary.alerts.v1.GetIssuesAlertConfigRequest")</span> | <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">alerts</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">GetIssuesAlertConfigResponse</i>](bitdrift_public_unary_alerts_v1_GetIssuesAlertConfigResponse.md "bitdrift.public.unary.alerts.v1.GetIssuesAlertConfigResponse")</span> |

</section>

<p class="h4">Example Request</p>
**URL:** `https://api-public.bitdrift.io/bitdrift.public.unary.alerts.v1.IssuesAlertsService/GetAlertConfig`

See [calling the API](../api-guide/calling-the-api.md) for authentication and request details.

```json
{
  "view_id": "123"
}
```

<p class="h4">Example Response</p>
```json
{
  "alert_config": {
    "alerts": [
      {
        "alert_uuid": "0197eb79-ef35-72ec-8e9f-91a4123c18c5",
        "common_config": {
          "custom_notification_text": "@checkout-oncall Please investigate.",
          "description": "Triggers when the checkout workflow error rate exceeds the configured threshold.",
          "labels": {
            "key": ""
          },
          "name": "Checkout error rate",
          "notifications": [
            {
              "min_time_between_notifications": "3600s",
              "notification_config": {
                "disabled": false,
                "notification_group": {
                  "name": "engineering-oncall"
                }
              }
            }
          ]
        },
        "condition": {
          "and_conditions": {
            "conditions": [
              {}
            ]
          }
        },
        "disabled": false,
        "per_issue_group": false
      }
    ],
    "new_issue_event_notification": [
      {
        "min_time_between_notifications": "3600s",
        "notification_config": {
          "disabled": false,
          "notification_group": {
            "name": "engineering-oncall"
          }
        }
      }
    ],
    "new_issue_group_notification": [
      {
        "min_time_between_notifications": "3600s",
        "notification_config": {
          "disabled": false,
          "notification_group": {
            "name": "engineering-oncall"
          }
        }
      }
    ]
  },
  "per_alert_info": [
    {
      "alert_uuid": "0197eb79-ef35-72ec-8e9f-91a4123c18c5",
      "last_resolved_at": "2024-01-15T09:30:00Z",
      "last_triggered_at": "2024-01-15T09:30:00Z"
    }
  ]
}
```

### <a id="GetAlertHistory"></a>GetAlertHistory

Gets history for a single issues alert.

<section class="proto-service-table" markdown>

| Request | Response |
| - | - |
| <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">alerts</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">GetIssueAlertHistoryRequest</i>](bitdrift_public_unary_alerts_v1_GetIssueAlertHistoryRequest.md "bitdrift.public.unary.alerts.v1.GetIssueAlertHistoryRequest")</span> | <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">alerts</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">GetIssueAlertHistoryResponse</i>](bitdrift_public_unary_alerts_v1_GetIssueAlertHistoryResponse.md "bitdrift.public.unary.alerts.v1.GetIssueAlertHistoryResponse")</span> |

</section>

<p class="h4">Example Request</p>
**URL:** `https://api-public.bitdrift.io/bitdrift.public.unary.alerts.v1.IssuesAlertsService/GetAlertHistory`

See [calling the API](../api-guide/calling-the-api.md) for authentication and request details.

```json
{
  "alert_uuid": "0197eb79-ef35-72ec-8e9f-91a4123c18c5",
  "end_time": "2024-01-15T09:30:00Z",
  "start_time": "2024-01-15T09:30:00Z",
  "view_id": "123"
}
```

<p class="h4">Example Response</p>
```json
{
  "history": [
    {
      "details": {
        "alert_config": {
          "alert_uuid": "0197eb79-ef35-72ec-8e9f-91a4123c18c5",
          "common_config": {
            "custom_notification_text": "@checkout-oncall Please investigate.",
            "description": "Triggers when the checkout workflow error rate exceeds the configured threshold.",
            "labels": {
              "key": ""
            },
            "name": "Checkout error rate",
            "notifications": [
              {
                "min_time_between_notifications": "3600s",
                "notification_config": {
                  "disabled": false,
                  "notification_group": {
                    "name": "engineering-oncall"
                  }
                }
              }
            ]
          },
          "condition": {
            "and_conditions": {
              "conditions": [
                {}
              ]
            }
          },
          "disabled": false,
          "per_issue_group": false
        },
        "issue_group_ids": [
          "12710232306638153143"
        ],
        "notification_failures": [
          "Slack channel not found"
        ]
      },
      "resolved_at": "2024-01-15T09:30:00Z",
      "triggered_at": "2024-01-15T09:30:00Z"
    }
  ],
  "issue_groups": [
    {
      "alert_count": 4,
      "group_id": "12710232306638153143",
      "last_triggered_at": "2024-01-15T09:30:00Z"
    }
  ]
}
```

### <a id="GetAllAlerts"></a>GetAllAlerts

Lists issues alerts for the organization.

<section class="proto-service-table" markdown>

| Request | Response |
| - | - |
| <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">alerts</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">GetAllIssueAlertsRequest</i>](bitdrift_public_unary_alerts_v1_GetAllIssueAlertsRequest.md "bitdrift.public.unary.alerts.v1.GetAllIssueAlertsRequest")</span> | <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">alerts</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">GetAllIssueAlertsResponse</i>](bitdrift_public_unary_alerts_v1_GetAllIssueAlertsResponse.md "bitdrift.public.unary.alerts.v1.GetAllIssueAlertsResponse")</span> |

</section>

<p class="h4">Example Request</p>
**URL:** `https://api-public.bitdrift.io/bitdrift.public.unary.alerts.v1.IssuesAlertsService/GetAllAlerts`

See [calling the API](../api-guide/calling-the-api.md) for authentication and request details.

```json
{
  "filters": [
    {
      "firing": {}
    }
  ],
  "limit": 25,
  "offset": 0,
  "sort": [
    {
      "direction": "DESCENDING",
      "key": "LAST_TRIGGERED"
    }
  ],
  "sort_by": [
    {}
  ]
}
```

<p class="h4">Example Response</p>
```json
{
  "items": [
    {
      "alert_description": "Triggers when crash count exceeds the configured threshold.",
      "alert_name": "Crash volume",
      "alert_uuid": "0197eb79-ef35-72ec-8e9f-91a4123c18c5",
      "disabled": false,
      "last_resolved_at": "2024-01-15T09:30:00Z",
      "last_triggered_at": "2024-01-15T09:30:00Z",
      "view_id": "123",
      "view_name": "iOS production crashes"
    }
  ],
  "total_alerts": 8
}
```

### <a id="UpsertAlertConfig"></a>UpsertAlertConfig

Upserts the alert configuration for an issues view.

<section class="proto-service-table" markdown>

| Request | Response |
| - | - |
| <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">alerts</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">UpsertIssuesAlertConfigRequest</i>](bitdrift_public_unary_alerts_v1_UpsertIssuesAlertConfigRequest.md "bitdrift.public.unary.alerts.v1.UpsertIssuesAlertConfigRequest")</span> | <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">alerts</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">UpsertIssuesAlertConfigResponse</i>](bitdrift_public_unary_alerts_v1_UpsertIssuesAlertConfigResponse.md "bitdrift.public.unary.alerts.v1.UpsertIssuesAlertConfigResponse")</span> |

</section>

<p class="h4">Example Request</p>
**URL:** `https://api-public.bitdrift.io/bitdrift.public.unary.alerts.v1.IssuesAlertsService/UpsertAlertConfig`

See [calling the API](../api-guide/calling-the-api.md) for authentication and request details.

```json
{
  "alert_config": {
    "alerts": [
      {
        "alert_uuid": "0197eb79-ef35-72ec-8e9f-91a4123c18c5",
        "common_config": {
          "custom_notification_text": "@checkout-oncall Please investigate.",
          "description": "Triggers when the checkout workflow error rate exceeds the configured threshold.",
          "labels": {
            "key": ""
          },
          "name": "Checkout error rate",
          "notifications": [
            {
              "min_time_between_notifications": "3600s",
              "notification_config": {
                "disabled": false,
                "notification_group": {
                  "name": "engineering-oncall"
                }
              }
            }
          ]
        },
        "condition": {
          "and_conditions": {
            "conditions": [
              {}
            ]
          }
        },
        "disabled": false,
        "per_issue_group": false
      }
    ],
    "new_issue_event_notification": [
      {
        "min_time_between_notifications": "3600s",
        "notification_config": {
          "disabled": false,
          "notification_group": {
            "name": "engineering-oncall"
          }
        }
      }
    ],
    "new_issue_group_notification": [
      {
        "min_time_between_notifications": "3600s",
        "notification_config": {
          "disabled": false,
          "notification_group": {
            "name": "engineering-oncall"
          }
        }
      }
    ]
  },
  "view_id": "123"
}
```

<p class="h4">Example Response</p>
```json
{}
```

