---
type: api
title: "Get all alerts for a case"
description: "You must have read privileges for the Cases feature in the Management, Observability, or Security section of the Kibana feature privileges, depending on the owner of the cases you're seeking."
url: https://www.elastic.co/elastic/docs-builder/docs/5066/api/kibana/operation/operation-getcasealertsdefaultspace
resource: https://www.elastic.co/elastic/docs-builder/docs/5066/api/kibana/operation/operation-getcasealertsdefaultspace
products:
  - Kibana
---

# Get all alerts for a case

Authentication: required

Availability: Preview

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/cases/{caseId}/alerts`
- `GET` `/s/{space_id}/api/cases/{caseId}/alerts`

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
- `caseId` (string) — required
  The identifier for the case. To retrieve case IDs, use the search cases (`_find)` API. All non-ASCII characters must be URL encoded.
  Example: `9c235210-6834-11ea-a78c-6ffb38a34414`

## Description

You must have `read` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the cases you're seeking.

## Responses

#### `200`

Indicates a successful call.

`application/json`

Type: `object[]`

An array; each item has these fields:

- `attached_at` (string · format: date-time)
- `id` (string)
  The alert identifier.
- `index` (string)
  The alert index.
#### `401`

Authorization information is missing or invalid.

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (integer)
## Code examples

#### Console

```console
GET kbn:/api/cases/9c235210-6834-11ea-a78c-6ffb38a34414/alerts
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/cases/9c235210-6834-11ea-a78c-6ffb38a34414/alerts" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response examples

#### Retrieves all alerts attached to a case

`application/json`

```json
[
  {
    "attached_at": "2022-07-25T20:09:40.963Z",
    "id": "f6a7d0c3-d52d-432c-b2e6-447cd7fce04d",
    "index": ".alerts-observability.logs.alerts-default"
  }
]
```

#### Authorization information is missing or invalid.

`application/json`

```json
{
  "error": "Unauthorized",
  "message": "Unable to authenticate with the provided credentials.",
  "statusCode": 401
}
```

