---
title: "Attach an alert channel to a monitor"
method: POST
path: "/monitors/{id}/channels/{cid}"
---

# Attach an alert channel to a monitor

`POST /monitors/{id}/channels/{cid}`

## Request

- Base URL: `https://app.yoping.me/api/v1`
- URL: `https://app.yoping.me/api/v1/monitors/{id}/channels/{cid}`
- Auth: API key in cookie `yp_session`

Adds one alert channel to this monitor's routing set without otherwise touching its configuration, and returns the updated monitor. Deliberately not PUT /monitors/{id}: that body is a full replace, so it re-validates interval and regions against the current plan (a monitor grandfathered below its plan's floor could not be routed at all) and a stale material field would reset the schedule and the per-region streaks. Idempotent — attaching an already-attached channel succeeds and changes nothing. A missing or foreign monitor or channel id returns 404; a channel type outside the plan returns 400.

## Path parameters

- `id` string, required
- `cid` string, required

## Response `200`

Channel attached; the monitor's current state.

- object: Uniform success envelope: the payload is always under `data`.
  - `data` Monitor, required: The full monitor object (returned by create, update, pause, and resume).
    - `id` string, required
    - `type` 'http' | 'keyword' | 'ssl' | 'ping' | 'tcp', required
    - `name` string, required
    - `target` string, required
    - `http_method` 'GET' | 'HEAD' | 'POST', required
    - `interval_seconds` integer, required
    - `timeout_ms` integer, required
    - `accepted_statuses` string, required
    - `keyword` string, nullable, required
    - `keyword_mode` 'present' | 'absent' | 'null', nullable, required
    - `paused` boolean, required
    - `paused_reason` 'domain_conflict' | 'plugin_silent' | 'null', nullable, required: Why the system, not the user, paused this monitor; null while it is running or when the user paused it. domain_conflict: disabled because another account monitors this website's domain (free plan). plugin_silent: paused because the YoPingMe WordPress plugin on this site stopped reporting for 30 days; the plugin's next report resumes it automatically.
    - `current_status` 'up' | 'down' | 'confirming' | 'unknown', required
    - `next_due_at` string, date-time, nullable, required
    - `created_at` string, date-time, required
    - `alert_channel_ids` string[], required
    - `regions` string[], nullable, required: Explicit region codes, or null for automatic (the plan-capped prefix of the active fleet).
    - `notification_policy` object, required: v1 shipped this as a reserved empty object; it now carries the DOWN-alert delay and the region-degradation alert delay (seconds) and may grow more fields.
      - `alert_after_seconds` integer, required
      - `region_alert_after_seconds` integer, required: Region-degradation alert delay in seconds. Only meaningful with at least 2 effective regions — a monitor checked from a single region can never see one region disagree with the others, so this can never fire there.

## Other responses

- `400`: Invalid input (code `validation_failed`): malformed JSON, a missing or out-of-range field, bad pagination parameters, or a rejected token.
- `401`: Not authenticated (code `unauthorized`): missing, invalid, or expired session; invalid login credentials; or a Bearer token, which this surface rejects.
- `404`: Not found (code `not_found`). A resource id belonging to another account is indistinguishable from a missing one.
- `429`: Too many requests (code `rate_limited`). A global per-IP budget of 300 requests/minute (burst 60) applies to every endpoint; login, signup, and test alerts have tighter dedicated limits.

---

[API](https://skmtc.dev/yoping/apis/yopingme-api.md) · [All operations](https://skmtc.dev/yoping/apis/yopingme-api/llms.txt) · [OpenAPI document](https://skmtc.dev/yoping/apis/yopingme-api/revisions/76d8deb40173?raw)
