# List Monitors

### Endpoint

**POST** `/api/monitors/list`

### Authentication

This endpoint requires API Key authentication via the Authorization header.

### Headers

| Header          | Required | Description                    |
| --------------- | -------- | ------------------------------ |
| `Authorization` | Yes      | Bearer token with your API key |
| `Content-Type`  | Yes      | Must be `application/json`     |
| `Accept`        | Yes      | Must be `application/json`     |

### Request Body

The request body supports filtering by sources:

```json
{
  "sources": []
}
```

**Parameters**

| Parameter | Type  | Required | Description                                       |
| --------- | ----- | -------- | ------------------------------------------------- |
| `sources` | array | No       | Source filters (empty array returns all monitors) |

### Response

#### Response Schema

```json
{
  "monitors": [
    {
      "uuid": "string",
      "title": "string",
      "type": "string"
    }
  ]
}
```

**Field Descriptions**

| Field      | Type   | Description                            |
| ---------- | ------ | -------------------------------------- |
| `monitors` | array  | Array of monitor objects               |
| `uuid`     | string | Unique identifier for the monitor      |
| `title`    | string | Monitor name/description               |
| `type`     | string | Monitor type (see monitor types below) |

**Monitor Types**

| Type        | Description                                   |
| ----------- | --------------------------------------------- |
| `"metrics"` | Metrics-based monitoring                      |
| `"traces"`  | Distributed tracing monitoring                |
| `"logs"`    | Log-based monitoring                          |
| `"events"`  | Event-based monitoring                        |
| `"infra"`   | Infrastructure monitoring                     |
| `""`        | (empty string) General/unspecified monitoring |

### Examples

#### Basic Request

Get all monitors:

```bash
curl -L \
  --request POST \
  --url 'https://api.groundcover.com/api/monitors/list' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data-raw '{"sources":[]}'
```

#### Response Example

```json
{
  "monitors": [
    {
      "uuid": "xxxx-xxxx-xxxx-xxxx-xxxx",
      "title": "PVC usage above threshold (90%)",
      "type": "metrics"
    },
    {
      "uuid": "xxxx-xxxx-xxxx-xxxx-xxxx",
      "title": "HTTP API Errors Monitor",
      "type": "traces"
    },
    {
      "uuid": "xxxxx-xxxx-xxxx-xxxx-xxxx",
      "title": "Error Logs Monitor",
      "type": "logs"
    },
    {
      "uuid": "xxxxx-xxxx-xxxx-xxxx-xxxx",
      "title": "Node CPU Usage Average is Above 85%",
      "type": "infra"
    },
    {
      "uuid": "xxxx-xxxx-xxxx-xxxx-xxxx",
      "title": "Rolling Update Triggered",
      "type": "events"
    },
    {
      "uuid": "xxxx-xxxx-xxxx-xxxx-xxxx",
      "title": "Deployment Partially Not Ready - 5m",
      "type": "events"
    }
  ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.groundcover.com/use-groundcover/remote-access-and-apis/api-examples/list-monitors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
