---
title: "Preview Tag Coverage Count"
description: "Returns how many distinct monitors a set of tags currently covers, for the tag-only (org-wide) maintenance-window mode."
---

`POST /api/maintenance-windows/preview-count`

Used by the maintenance-window form to show "this will cover N monitors" before submitting a
[tag-only (org-wide) window](/docs/api/maintenance-windows/create#tag-only-org-wide-mode).
Coverage is resolved live: it counts every monitor, across every monitor type, currently tagged
with at least one of the given tags, the same dynamic membership the org-wide window itself uses
at check time.

## Body

```json
{
  "tagIds": [7]
}
```

### Fields

| Field | Type | Description |
|-------|------|-------------|
| `tagIds` | number[] | Required, at least one. Tags to count coverage for. Must belong to your organization. |

## Example (cURL)

```bash
BASE_URL="https://uptimeify.io"
TOKEN="<your-api-token>"

curl -X POST "$BASE_URL/api/maintenance-windows/preview-count" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "tagIds": [7] }'
```

## Response

```json
{
  "count": 12
}
```

`count` is the number of distinct `(monitorType, monitorId)` pairs currently carrying at least one
of the given tags, not the number of tags.

## Common errors

| Status | Description |
|--------|-------------|
| `400` (validation) | `tagIds` is missing or empty. Standard Zod validation error body, not `{ data: { code } }`. |
| `401 Unauthorized` | Not logged in. |
| `404` `{ data: { code: "tagNotFound" } }` | A `tagId` does not exist in your organization, or you cannot see it. |
