---
title: "Retrieve an alert"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.npibase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve an alert

Path: Weather API › Alerts

`GET /alerts/{alert_id}`

URL: `https://api.weather.example/v1/alerts/{alert_id}`

## Authentication

- `bearer`, http bearer, header `Authorization`

## Path parameters

- `alert_id` (`getAlert.path.alert_id`; string, required)

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.weather.example/v1/alerts/<alert_id>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.weather.example/v1/alerts/<alert_id>';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.weather.example/v1/alerts/<alert_id>"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

The alert.

#### Example

```json
{
  "id": "string",
  "headline": "Heat warning for the Lisbon district",
  "severity": "minor",
  "starts_at": "2019-08-24T14:15:22Z",
  "ends_at": "2019-08-24T14:15:22Z"
}
```

- `id` (`getAlert.response.200.id`; string, required)
- `headline` (`getAlert.response.200.headline`; string, required)
- `severity` (`getAlert.response.200.severity`; string, required)
  - one of `"minor"`, `"moderate"`, `"severe"`, `"extreme"`
- `starts_at` (`getAlert.response.200.starts_at`; string, required)
  - format: `date-time`
- `ends_at` (`getAlert.response.200.ends_at`; string, optional)
  - format: `date-time`

### 404

Nothing exists at that id.

#### Example

```json
{
  "code": "not_found",
  "message": "string"
}
```

- `code` (`getAlert.response.404.code`; string, required)
- `message` (`getAlert.response.404.message`; string, required)


Source: https://docs.npibase.com/api/alerts/retrieve/index.md
