---
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/4493/api/doc/kibana/v9/operation/operation-getcasealertsdefaultspace
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-getcasealertsdefaultspace
products:
  - Kibana
---

# Get all alerts for a case

Availability: Preview

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

## Paths

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

#### Path parameters

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

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.

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## 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

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

