---
title: "Assign Tag to Monitor"
description: "Assigns an existing tag to a monitor. The caller needs read access to the monitor and visibility of the tag. The operation is idempotent."
---

`POST /api/monitor-tags`

## Body

```json
{
  "monitorType": "website",
  "monitorId": 101,
  "tagId": 1
}
```

- `monitorType` (required): Type of the monitor. One of: `website` | `dns` | `icmp` | `smtp` | `ssh` | `tcp` | `ftp` | `imap_pop` | `customer_domain` | `customer_ip`. Use `customer_domain` for domain (SSL/expiry) monitors and `customer_ip` for DNSBL/blacklist monitors.
- `monitorId` (required): Numeric ID of the monitor.
- `tagId` (required): Numeric ID of the tag to assign.

This operation is **idempotent**: calling it again when the tag is already assigned returns the existing assignment without error.

## Example (cURL)

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

curl -X POST "$BASE_URL/api/monitor-tags" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"monitorType":"website","monitorId":101,"tagId":1}'
```

## Response

```json
{
  "monitorType": "website",
  "monitorId": 101,
  "tagId": 1,
  "createdAt": "2026-06-29T12:00:00.000Z"
}
```

## Common errors

- `400 Bad Request` when `monitorType` is not a supported type
- `401 Unauthorized` when you are not logged in
- `403 Forbidden` when you do not have read access to the monitor or cannot see the tag
- `404 Not Found` when the monitor or tag does not exist
