---
type: api
title: Get all alerts for a case
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-getcasealertsdefaultspace
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-getcasealertsdefaultspace
products:
  - Kibana
---

# Get all alerts for a case

Availability:

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

## Paths

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

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#basicauth)

#### Path Parameters

- `caseId` (string)
  The identifier for the case. To retrieve case IDs, use the search cases (`_find)` API. All non-ASCII characters must be URL encoded.

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

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`

- `attached_at` (string)
- `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 /api/cases/{caseId}/alerts
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/cases/{caseId}/alerts"
```

## Response Examples

#### Retrieves all alerts attached to a case

```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.

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

