# Get a project monitor

## `GET /v1/projects/{projectId}/monitors/{alertId}`

Returns a single project monitor. Requires `monitors:read`. An existing `container_cpu` monitor without an effective CPU limit remains visible with `evaluation_unavailable_reason` set to `cpu_limit_missing`.

### Path parameters

- `projectId` (integer, required)
- `alertId` (string (uuid), required)

### Header parameters

- `Authorization` (string, required): `Bearer <token>`. [Authentication](https://spice.ai/docs/cloud/api/management#authentication) lists the tokens it accepts.
- `X-Org-Name` (string, optional): The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but `GET /v1/orgs` (400 `org_assertion_required` otherwise). Pattern: `^[A-Za-z0-9._-]{1,255}$`.

### Example request

```bash
curl "https://api.spice.ai/v1/projects/<projectId>/monitors/<alertId>" \
  -H "Authorization: Bearer <token>"
```

```http
GET /v1/projects/<projectId>/monitors/<alertId> HTTP/1.1
Host: api.spice.ai
Authorization: Bearer <token>
```

### Responses

**200 OK**

Monitor

Content type: `application/json`

A project monitor, as returned by the list, get, create and update operations. Every required property is always present; a nullable one carries null rather than being omitted. `evaluation_unavailable_reason` is present only when an Instance CPU monitor has lost its CPU limit. Fields not listed here are internal to the platform and are not part of the contract.

- `id` (string (uuid), required): Identifier of the monitor or reaction. This is the value the get, update and delete operations take.
- `org_id` (integer, required): Organization that owns the project
- `app_id` (integer, required): Project the monitor or reaction belongs to
- `created_by` (integer | null, required): User who created it, when it was created by a user credential
- `name` (string, required): Display name, unique case-insensitively among the project's live monitors and data reactions
- `description` (string | null, required)
- `kind` (string, required): The monitors endpoints only ever return `runtime`. Value: `runtime`.
- `status` (string, required): Whether it is evaluating. Allowed values: `active`, `disabled`.
- `template_id` (string, required): Template it was created from
- `spec` (object, required): Monitor parameters. Which properties are meaningful is decided by `template_id`. The create operation's request body lists the properties each template reads.
- `target` (object, required): The primary sink (email, then slack, then http). `targets` is the full list. An HTTP sink's `token` is write-only and is never returned.

  One of:
  - **type: email** (object)
    - `type` (string, required): Value: `email`.
    - `recipientUserIds` (array of integer)
    - `emails` (array of string (email))
  - **type: http** (object)
    - `type` (string, required): Value: `http`.
    - `url` (string (uri) | "", required): The sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
    - `method` (string): Allowed values: `POST`, `PUT`, `PATCH`.
  - **type: slack** (object)
    - `type` (string, required): Value: `slack`.
    - `channelId` (string | "", required): The Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
    - `channelName` (string): Minimum length: `1`. Maximum length: `80`.
- `targets` (array of object, required): Every configured sink, ordered email, then slack, then http. `target` is the first of these. An HTTP sink's token is never returned. Minimum items: `1`. Maximum items: `3`.

  One of:
  - **type: email** (object)
    - `type` (string, required): Value: `email`.
    - `recipientUserIds` (array of integer)
    - `emails` (array of string (email))
  - **type: http** (object)
    - `type` (string, required): Value: `http`.
    - `url` (string (uri) | "", required): The sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
    - `method` (string): Allowed values: `POST`, `PUT`, `PATCH`.
  - **type: slack** (object)
    - `type` (string, required): Value: `slack`.
    - `channelId` (string | "", required): The Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
    - `channelName` (string): Minimum length: `1`. Maximum length: `80`.
- `recipient_user_ids` (array of integer, required): Organization members emailed when the monitor fires. Empty when there is no email sink, and for an email sink addressed only by `emails`. When a created email sink named no recipients at all, the API stores the creating user; a machine credential has no user, so it stores none and the monitor emails the organization owner.
- `last_fired_at` (string (date-time) | null, required): When it last fired, or null if it never has
- `last_resolved_at` (string (date-time) | null, required): When it last resolved, or null if it never has
- `created_at` (string (date-time), required)
- `updated_at` (string (date-time), required)
- `evaluation_unavailable_reason` (string): Present when an existing Instance CPU monitor cannot evaluate because its CPU limit was removed. Value: `cpu_limit_missing`.

**400 Bad Request**

Invalid project or monitor ID

**401 Unauthorized**

Unauthorized

**403 Forbidden**

Insufficient scope

**404 Not Found**

Project or monitor not found

**500 Internal Server Error**

Internal server error

## `GET /v1/orgs/{orgId}/projects/{projectId}/monitors/{alertId}`

The org is `orgId` in the path. Returns a single project monitor. Requires `monitors:read`. An existing `container_cpu` monitor without an effective CPU limit remains visible with `evaluation_unavailable_reason` set to `cpu_limit_missing`.

### Path parameters

- `orgId` (integer, required): The org id from GET /v1/orgs. Minimum: `1`.
- `projectId` (integer, required)
- `alertId` (string (uuid), required)

### Header parameters

- `Authorization` (string, required): `Bearer <token>`. [Authentication](https://spice.ai/docs/cloud/api/management#authentication) lists the tokens it accepts.
- `X-Org-Name` (string, optional): When present, X-Org-Name must name the same org as orgId. Otherwise the request returns org\_path\_mismatch (400). Pattern: `^[A-Za-z0-9._-]{1,255}$`.

### Example request

```bash
curl "https://api.spice.ai/v1/orgs/<orgId>/projects/<projectId>/monitors/<alertId>" \
  -H "Authorization: Bearer <token>"
```

```http
GET /v1/orgs/<orgId>/projects/<projectId>/monitors/<alertId> HTTP/1.1
Host: api.spice.ai
Authorization: Bearer <token>
```

### Responses

**200 OK**

Monitor

Content type: `application/json`

A project monitor, as returned by the list, get, create and update operations. Every required property is always present; a nullable one carries null rather than being omitted. `evaluation_unavailable_reason` is present only when an Instance CPU monitor has lost its CPU limit. Fields not listed here are internal to the platform and are not part of the contract.

- `id` (string (uuid), required): Identifier of the monitor or reaction. This is the value the get, update and delete operations take.
- `org_id` (integer, required): Organization that owns the project
- `app_id` (integer, required): Project the monitor or reaction belongs to
- `created_by` (integer | null, required): User who created it, when it was created by a user credential
- `name` (string, required): Display name, unique case-insensitively among the project's live monitors and data reactions
- `description` (string | null, required)
- `kind` (string, required): The monitors endpoints only ever return `runtime`. Value: `runtime`.
- `status` (string, required): Whether it is evaluating. Allowed values: `active`, `disabled`.
- `template_id` (string, required): Template it was created from
- `spec` (object, required): Monitor parameters. Which properties are meaningful is decided by `template_id`. The create operation's request body lists the properties each template reads.
- `target` (object, required): The primary sink (email, then slack, then http). `targets` is the full list. An HTTP sink's `token` is write-only and is never returned.

  One of:
  - **type: email** (object)
    - `type` (string, required): Value: `email`.
    - `recipientUserIds` (array of integer)
    - `emails` (array of string (email))
  - **type: http** (object)
    - `type` (string, required): Value: `http`.
    - `url` (string (uri) | "", required): The sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
    - `method` (string): Allowed values: `POST`, `PUT`, `PATCH`.
  - **type: slack** (object)
    - `type` (string, required): Value: `slack`.
    - `channelId` (string | "", required): The Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
    - `channelName` (string): Minimum length: `1`. Maximum length: `80`.
- `targets` (array of object, required): Every configured sink, ordered email, then slack, then http. `target` is the first of these. An HTTP sink's token is never returned. Minimum items: `1`. Maximum items: `3`.

  One of:
  - **type: email** (object)
    - `type` (string, required): Value: `email`.
    - `recipientUserIds` (array of integer)
    - `emails` (array of string (email))
  - **type: http** (object)
    - `type` (string, required): Value: `http`.
    - `url` (string (uri) | "", required): The sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
    - `method` (string): Allowed values: `POST`, `PUT`, `PATCH`.
  - **type: slack** (object)
    - `type` (string, required): Value: `slack`.
    - `channelId` (string | "", required): The Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
    - `channelName` (string): Minimum length: `1`. Maximum length: `80`.
- `recipient_user_ids` (array of integer, required): Organization members emailed when the monitor fires. Empty when there is no email sink, and for an email sink addressed only by `emails`. When a created email sink named no recipients at all, the API stores the creating user; a machine credential has no user, so it stores none and the monitor emails the organization owner.
- `last_fired_at` (string (date-time) | null, required): When it last fired, or null if it never has
- `last_resolved_at` (string (date-time) | null, required): When it last resolved, or null if it never has
- `created_at` (string (date-time), required)
- `updated_at` (string (date-time), required)
- `evaluation_unavailable_reason` (string): Present when an existing Instance CPU monitor cannot evaluate because its CPU limit was removed. Value: `cpu_limit_missing`.

**400 Bad Request**

Invalid project or monitor ID. orgId is not a valid org id (`invalid_org_id`), or X-Org-Name does not name that org (`org_path_mismatch`).

**401 Unauthorized**

Unauthorized

**403 Forbidden**

Insufficient scope. The caller is not a member of the org (`org_forbidden`). A machine credential named a different org (`org_assertion_mismatch`). The org is deleted (`org_deleted`).

**404 Not Found**

Project or monitor not found

**500 Internal Server Error**

Internal server error

## `GET /v1/apps/{appId}/monitors/{alertId}` (deprecated)

Legacy alias of `/v1/projects/{projectId}/monitors/{alertId}` — projects were previously called apps. Returns a single project monitor. Requires `monitors:read`. An existing `container_cpu` monitor without an effective CPU limit remains visible with `evaluation_unavailable_reason` set to `cpu_limit_missing`.

### Path parameters

- `appId` (integer, required)
- `alertId` (string (uuid), required)

### Header parameters

- `Authorization` (string, required): `Bearer <token>`. [Authentication](https://spice.ai/docs/cloud/api/management#authentication) lists the tokens it accepts.
- `X-Org-Name` (string, optional): The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but `GET /v1/orgs` (400 `org_assertion_required` otherwise). Pattern: `^[A-Za-z0-9._-]{1,255}$`.

### Example request

```bash
curl "https://api.spice.ai/v1/apps/<appId>/monitors/<alertId>" \
  -H "Authorization: Bearer <token>"
```

```http
GET /v1/apps/<appId>/monitors/<alertId> HTTP/1.1
Host: api.spice.ai
Authorization: Bearer <token>
```

### Responses

**200 OK**

Monitor

Content type: `application/json`

A project monitor, as returned by the list, get, create and update operations. Every required property is always present; a nullable one carries null rather than being omitted. `evaluation_unavailable_reason` is present only when an Instance CPU monitor has lost its CPU limit. Fields not listed here are internal to the platform and are not part of the contract.

- `id` (string (uuid), required): Identifier of the monitor or reaction. This is the value the get, update and delete operations take.
- `org_id` (integer, required): Organization that owns the project
- `app_id` (integer, required): Project the monitor or reaction belongs to
- `created_by` (integer | null, required): User who created it, when it was created by a user credential
- `name` (string, required): Display name, unique case-insensitively among the project's live monitors and data reactions
- `description` (string | null, required)
- `kind` (string, required): The monitors endpoints only ever return `runtime`. Value: `runtime`.
- `status` (string, required): Whether it is evaluating. Allowed values: `active`, `disabled`.
- `template_id` (string, required): Template it was created from
- `spec` (object, required): Monitor parameters. Which properties are meaningful is decided by `template_id`. The create operation's request body lists the properties each template reads.
- `target` (object, required): The primary sink (email, then slack, then http). `targets` is the full list. An HTTP sink's `token` is write-only and is never returned.

  One of:
  - **type: email** (object)
    - `type` (string, required): Value: `email`.
    - `recipientUserIds` (array of integer)
    - `emails` (array of string (email))
  - **type: http** (object)
    - `type` (string, required): Value: `http`.
    - `url` (string (uri) | "", required): The sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
    - `method` (string): Allowed values: `POST`, `PUT`, `PATCH`.
  - **type: slack** (object)
    - `type` (string, required): Value: `slack`.
    - `channelId` (string | "", required): The Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
    - `channelName` (string): Minimum length: `1`. Maximum length: `80`.
- `targets` (array of object, required): Every configured sink, ordered email, then slack, then http. `target` is the first of these. An HTTP sink's token is never returned. Minimum items: `1`. Maximum items: `3`.

  One of:
  - **type: email** (object)
    - `type` (string, required): Value: `email`.
    - `recipientUserIds` (array of integer)
    - `emails` (array of string (email))
  - **type: http** (object)
    - `type` (string, required): Value: `http`.
    - `url` (string (uri) | "", required): The sink's URL. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
    - `method` (string): Allowed values: `POST`, `PUT`, `PATCH`.
  - **type: slack** (object)
    - `type` (string, required): Value: `slack`.
    - `channelId` (string | "", required): The Slack channel ID. An empty string means the stored sink no longer passes validation. Update the sink to replace it.
    - `channelName` (string): Minimum length: `1`. Maximum length: `80`.
- `recipient_user_ids` (array of integer, required): Organization members emailed when the monitor fires. Empty when there is no email sink, and for an email sink addressed only by `emails`. When a created email sink named no recipients at all, the API stores the creating user; a machine credential has no user, so it stores none and the monitor emails the organization owner.
- `last_fired_at` (string (date-time) | null, required): When it last fired, or null if it never has
- `last_resolved_at` (string (date-time) | null, required): When it last resolved, or null if it never has
- `created_at` (string (date-time), required)
- `updated_at` (string (date-time), required)
- `evaluation_unavailable_reason` (string): Present when an existing Instance CPU monitor cannot evaluate because its CPU limit was removed. Value: `cpu_limit_missing`.

**400 Bad Request**

Invalid project or monitor ID

**401 Unauthorized**

Unauthorized

**403 Forbidden**

Insufficient scope

**404 Not Found**

Project or monitor not found

**500 Internal Server Error**

Internal server error

OpenAPI: [api.spice.ai/openapi.json](https://api.spice.ai/openapi.json)
