OpenUptime

API reference

Manage monitors, incidents, alert channels and status pages programmatically. The API is JSON over HTTPS.

Getting started

Base URL: https://openuptime.app/api

Create an API key in the app under API keys, then send it with every request, either as an x-api-key header or as Authorization: Bearer <key>. A key belongs to one workspace and can optionally be limited to specific projects.

curl https://openuptime.app/api/monitors \
  -H "x-api-key: ou_..."

Connecting an AI agent? See the MCP guide.

Project scoping

Most resources live in a project. Choose the project with the x-project-id header (a project id from GET /projects). If it is missing, the key's first permitted project, or else the workspace's oldest project, is used. A key limited to some projects gets 403 for any project it may not use, including an unknown id. Send x-project-id: all to read across every permitted project: GET /monitors, GET /incidents and GET /counts then cover all of them, GET /projects/overview returns per-project totals, and writes to project resources return 400. GET /workspaces lists the workspaces you belong to and GET /usage the current workspace's usage.

Errors

Errors return a JSON body { "error": "message" } with a matching status: 400 invalid request, 401 missing or invalid credentials, 403 not permitted, 404 not found or not in your project, 409 conflict, 429 too many requests, 5xx server error. Request bodies that fail validation return 400 with a JSON description of the invalid fields. Deletes return 204 with no body. Timestamps are ISO 8601 UTC; ids are UUIDs.

HTTP request bodies accept raw UTF-8 text (up to 16 KiB), including JSON or form data. Set Content-Type in headers; Content-Length is calculated by the runtime. The form displays UTF-8 byte usage and blocks oversized bodies. Checks repeat on schedule: use a safe test endpoint. Bodies are masked for members; changing the target, method, headers or body while retaining stored secrets requires an owner or admin. A masked export cannot restore a body: provide the original. On a redirect to another origin the custom headers (API keys, tokens, cookies) are not forwarded, a 307 or 308 that would resend the body there is refused, and a 301, 302 or 303 turns the request into a GET without the body; an http to https upgrade on the same host keeps the body. Upgrade remote probes to advertise http-request-body-v1; a probe's capability is checked before such a request and remembered for 30 seconds, so a rolled-back probe can still receive bodies for up to that long. Older probes are unavailable for these checks, and the scheduler falls back locally if none can answer.

HTTP 请求体支持最多 16 KiB 的 UTF-8 文本(如 JSON 或表单数据),请在请求头设置 Content-Type;Content-Length 由运行时计算。表单按 UTF-8 字节显示大小并阻止提交超限请求体。检测会周期性执行,请使用安全的测试接口。成员只能看到请求体掩码;保留已有密钥时,只有所有者和管理员可以修改目标、方法、请求头或请求体。掩码导出无法恢复请求体,需要补充原始内容。重定向到其他源时,自定义请求头(API 密钥、令牌、Cookie)不会被转发;会重新发送请求体的 307 或 308 跨源重定向会被拒绝,301、302、303 会改为不带请求体的 GET;同一主机从 http 升级到 https 时保留请求体。远程探针需升级并声明 http-request-body-v1 能力,发送此类请求前会确认探针能力并缓存 30 秒,因此探针回滚后最多 30 秒内仍可能收到请求体。旧探针对这些检测不可用;所有探针不可用时,调度器回退到本地检测。

Import preview / 导入预览

POST /monitors/import/preview with an array or { source: "backup:production", monitors: [...] }. Review the report, then send the same data to /monitors/import, including the preview's destination to reject workspace/project changes. Preview never creates monitors or sends alerts; it can resolve target DNS. Capacity and targets are revalidated when executing. Imports inherit the destination's auto-enabled channels.

先向 /monitors/import/preview 提交数组,或包含 source 和 monitors 的对象。检查报告后,将同一数据发送到 /monitors/import,并附上预览返回的 destination,防止工作区或项目切换后误导入。预览不创建监控项或发送告警,但会进行目标 DNS 验证。执行时重新验证容量和目标,导入项继承目标项目自动启用的通知渠道。

Each record can specify source and sourceId (or id). Identity is scoped to workspace, project and source. Repeated or concurrent imports skip existing identities; they never update or delete monitors. Without an ID, type/name/target determine a stable hash: changing those fields creates another monitor. Reuse a namespace for retries and choose a different namespace for a different source account. Native exports preserve provenance. Deleting an imported monitor permits importing it again. Preview is advisory and reserves no capacity. Invalid rows are skipped; exceeding plan capacity blocks the entire batch with 402.

每条记录可指定 source 和 sourceId(或 id)。标识在工作区、项目和来源范围内唯一。重复或并发导入会跳过已有标识,不会更新或删除监控项。无 ID 时按类型、名称和目标生成稳定哈希;修改这些字段会创建新项。重试复用来源标识,不同来源账号使用不同标识。本系统导出会保留来源信息。删除已导入项后可重新导入。预览不会预留容量;无效记录会跳过,超出套餐容量则整批拒绝并返回 402。

Reports include unsupported fields, removed channel/dependency references and interval/region adjustments. Masked headers and unsupported authentication/body fields (any field named like a credential, for example basic_auth_user or oauth_token) are rejected instead of creating an unauthenticated check. Supported credential headers are retained but never echoed in preview. MCP exposes preview_monitor_import and import_monitors; read-only OAuth grants can preview, while execution needs write scope.

报告包含不支持的字段、被移除的渠道或依赖引用,以及间隔和区域调整。掩码请求头和不支持的认证或请求体字段会被拒绝(名称像凭据的字段,例如 basic_auth_user、oauth_token,也同样拒绝),避免创建丢失认证的检测。支持的凭据请求头会保留,但不会在预览中回显。MCP 提供 preview_monitor_import 和 import_monitors;只读 OAuth 授权可预览,执行需要写入权限。

MCP server monitors / MCP 服务监控

Create a mcp monitor with the MCP endpoint in target and authentication in headers or mcpConfig.oauth. Transport can be auto, streamable-http or sse. Required tool names match exactly; optional listPrompts/listResources discover only catalogs. Optional schemaCheck compares approved input/output schemas with a down, degraded or record driftPolicy. Tool calls require explicit enabled: true and may incur charges or write data. Assertions use JSON Pointer into tools/call results. See the MCP monitor guide for OAuth fields and policy details.

创建 mcp 监控,target 填 MCP 端点,通过 headers 或 mcpConfig.oauth 鉴权。传输方式支持 auto、streamable-http、sse。必需工具按名称完全匹配;可选 listPrompts/listResources 只发现目录。schemaCheck 比较已批准的输入/输出 schema,driftPolicy 可选 down、degraded、record。工具调用必须显式 enabled: true,可能产生费用或写入数据。断言通过 JSON Pointer 读取 tools/call 结果。OAuth 字段和策略详见 MCP 监控指南。

POST /monitors/mcp/preview accepts target, headers, timeoutMs, mcpConfig, optional region (default auto) and monitorId; it never calls tools or establishes a baseline. OAuth preview may refresh credentials; refresh-token preview needs the saved monitor's monitorId (otherwise 400 mcp_refresh_requires_saved_monitor) and stores the rotated token on it. refreshToken is write-only and never returned. On PATCH, omit mcpConfig.oauth to preserve current credentials, or send null to remove them; inside oauth, omit refreshToken to keep the stored token. Exports omit refreshToken and clientSecret, and imports refuse rows with mcpConfig.oauth.

POST /monitors/mcp/preview 接受 target、headers、timeoutMs、mcpConfig、可选 region(默认 auto)和 monitorId,不调用工具或建立基线。OAuth 预览可能刷新凭据;刷新令牌模式的预览需要已保存监控的 monitorId(否则返回 400 mcp_refresh_requires_saved_monitor),轮换后的令牌写回该监控。refreshToken 只写不读,从不返回。PATCH 时省略 mcpConfig.oauth 可保留当前凭据,传 null 才会移除;在 oauth 内省略 refreshToken 则保留已存储的令牌。导出不含 refreshToken 和 clientSecret,导入会拒绝带 mcpConfig.oauth 的条目。

GET monitor detail includes mcpBaseline and mcpObservation with id, schemaHash, stage, timings, catalogs and drift severity. POST /monitors/:id/mcp-baseline/accept with observationId and schemaHash accepts only that current reviewed discovery. GET /monitors/:id/mcp-history?days=7 (7 or 30) returns result diagnostics, overall/per-stage p50/p95 and change events. Schemas, OAuth settings, observations and MCP history require owner/admin access; other readers receive mcpConfigRedacted: true and can still read normal health/check history.

详情包含 mcpBaseline 和 mcpObservation(id、schemaHash、阶段、耗时、目录及变化级别)。向 /monitors/:id/mcp-baseline/accept 提交 observationId 与 schemaHash,只接受当前已审阅的准确发现版本。/monitors/:id/mcp-history?days=7(7 或 30 天)返回检测诊断、整体/各阶段 p50/p95 及变化事件。Schema、OAuth 配置、观测详情和 MCP 历史仅限所有者/管理员读取;其他读者收到 mcpConfigRedacted: true,仍可读取常规健康状态和检测历史。

Domain registration expiry / 域名注册到期

Create a domain monitor with the explicit registered domain (for example example.co.uk), domainExpiryWarnDays from 1 to 365 (default 30), and preferably intervalSec: 86400. Intervals are bounded to 3600–86400 seconds. No parent domain is inferred. IANA RDAP discovery selects the registry; only exact domain responses with a usable top-level expiration event count as known. This is the registry date, not necessarily the registrar billing deadline or proof that a website is available.

创建 domain 监控项并填写准确的注册域名(如 example.co.uk)。domainExpiryWarnDays 范围为 1 至 365 天,默认 30 天,建议设置 intervalSec: 86400;间隔限制在 3600 至 86400 秒。不自动推测父域名。检测通过 IANA 发现注册局 RDAP 服务,仅接受域名完全匹配且包含可用注册到期事件的响应。该日期不一定等于注册商账单截止日,也不代表网站是否可用。

Known dates have a 26-hour freshness deadline, but lookups refresh when less than 24 hours remain: cache reuse is approximately two hours, and daily checks normally refetch. Unknown registry results are cached for fifteen minutes, IANA discovery for 24 hours. Concurrent fills of the same key are serialized. Manual checks use the same cache; expired data is never treated as healthy. Endpoints must be public HTTPS, redirects are refused, requests use the monitor timeout, and responses are capped at 1 MiB. Unsupported suffixes, missing dates and registry rate limits produce unknown results. Local DNS/egress failures confirmed as probe faults are inconclusive: they are not cached, counted as failures or used to open incidents. No WHOIS fallback is attempted. Registration warnings retain their own incidents and configured reminders; verified renewal clears them.

已知日期的有效期为 26 小时,但剩余有效期不足 24 小时即提前刷新,因此通常只复用约两小时,每日检测一般会重新查询。注册局的未知结果缓存十五分钟,IANA 发现数据缓存 24 小时;同一键的并发填充会串行执行。手动检测使用相同缓存,过期数据不会作为正常依据。仅允许公网 HTTPS、不跟随重定向,请求使用监控项超时,响应限制为 1 MiB。不支持的后缀、缺少日期和注册局限流会产生未知结果。经确认属于探测端的本地 DNS 或出站网络故障没有结论,不写缓存、不计失败,也不会据此创建事件。不尝试 WHOIS 回退。注册日期预警保留专用事件和配置的提醒,续期后的日期经验证正常后恢复。

Public pages report unavailable or stale registration data as unknown, and expiry warnings as degraded rather than a service outage. Registration checks do not contribute uptime percentages or suppress alerts for dependent services.

公开状态页将缺失或过期的注册信息显示为未知,将到期预警显示为降级而非服务中断。注册日期检测不参与服务可用率计算,也不抑制依赖服务的告警。

Protocol references: RFC 9224 discovery, RFC 9083 domain events, IANA bootstrap.

Permissions follow workspace roles. Members can read everything and create or edit monitors, incidents and status pages; deleting a monitor or an alert channel, and editing a channel's configuration, need the owner or admin role. For members, channel credentials (webhook URLs, tokens, routing keys) and monitor request headers come back masked as ••••••••; send the mask back unchanged to keep the stored value. Changing a monitor’s target, method or headers while retaining a stored header value requires an owner or admin; members can replace all headers with their own values or remove them. A few endpoints need a browser session and refuse API keys and agents with 403: GET /me/export and PATCH /me/locale. Targets that resolve to private or internal addresses are refused with 400 and "error": "target_not_allowed" unless the operator set ALLOW_PRIVATE_TARGETS.

Rate limiting

Authenticated endpoints have no fixed per-key quota at the application level, but please be considerate and avoid tight polling; use the monitor's interval and alert channels instead. Sign-in, sign-up, password reset and two-factor attempts, the alert-channel test button and public subscription requests are rate limited and return 429 when exceeded.

Native app sign-in (GitHub)

A native app signs in with GitHub inside ASWebAuthenticationSession and ends with a normal cookie session. The browser session owns the OAuth state, so the app must not start the flow with its own HTTP client. Check GET /api/config first: use this flow only when auth.github and auth.nativeHandoff are true.

  1. Open GET https://<host>/api/auth/native/github in ASWebAuthenticationSession with callback scheme openuptime. It answers 302 to GitHub (404 when GitHub is not configured, 429 when rate limited).
  2. The user signs in at GitHub. The server completes the sign-in and redirects the session to openuptime://auth?token=<token>. On failure it redirects to openuptime://auth?error=<code> with no token (for example signup_disabled when registration is closed).
  3. Exchange the token within 60 seconds:
    POST https://<host>/api/auth/one-time-token/verify
    content-type: application/json
    
    { "token": "<token>" }
    
    200 { "session": { "token", "expiresAt", ... }, "user": { "id", "email", "name", ... } }
        + Set-Cookie: better-auth.session_token=...   (__Secure- prefix over HTTPS)
    400 { "message": "Invalid token" }   unknown, already used or expired
  4. Keep the cookie and use it like a browser session for every /api request.

The token is random, valid for 60 seconds and works once. Only the exact callback openuptime://auth is accepted; no other scheme or path receives a token. The verify endpoint is rate limited (429). Account actions such as GET /api/auth/list-accounts, POST /api/auth/link-social and POST /api/auth/unlink-account need this cookie session and do not accept API keys. The last way to sign in cannot be unlinked (400).

Push notifications (mobile app)

The mobile app registers its APNs device token with the server it is connected to. These endpoints work with a session cookie or an API key and act on the signed-in person's own devices. Check GET /api/config first: push.apns is true when the server can send push notifications.

PUT /api/push/devices
{ "token": "<hex, 32-200 chars>", "platform": "ios", "environment": "sandbox" | "production",
  "locale": "en" | "zh-CN", "name": "Ada's iPhone", "critical": false }          (locale, name and critical optional, name up to 80 characters)

200 { "id", "token", "platform", "environment", "locale", "name", "critical" }

GET    /api/push/devices           200 [ { "id", "token", "platform", "environment", "locale", "name", "critical" } ]
DELETE /api/push/devices/:token    204

Registering is an upsert by token: a token that was registered by another person moves to the caller. When push is configured, registering also gives every workspace where the caller is owner or admin a Mobile app channel (type push, on for new monitors) if it has none. A push channel alerts every member of its workspace who has a registered device; creating one while push is not configured fails with 400 and code: "push_not_configured". A key limited to some projects registers devices but does not create channels.

critical (boolean, default false) opts the device in to critical alerts. Down alerts then go out with interruption level critical and a critical sound, which can break through Do Not Disturb; without it they are time-sensitive, and recoveries are always active. Leaving critical out when registering again keeps the stored choice. Alerts for one incident share an APNs collapse id, so reminders replace the earlier banner, and notifications are grouped per monitor. A token APNs reports as invalid is removed automatically, and a device that has not registered for 180 days is dropped.

Examples

Create a monitor

curl -X POST https://openuptime.app/api/monitors \
  -H "x-api-key: ou_..." \
  -H "x-project-id: <project id>" \
  -H "content-type: application/json" \
  -d '{"name":"Homepage","type":"http","target":"https://example.com","intervalSec":60}'

List monitors

curl https://openuptime.app/api/monitors \
  -H "Authorization: Bearer ou_..."

Send a heartbeat ping

Create a monitor with "type":"heartbeat" and call its URL from your job. No API key is needed; the token is the secret. Use GET or POST.

curl https://openuptime.app/api/heartbeat/<heartbeatToken>

Returns {"ok":true}, or 404 for an unknown token. A ping resolves an open incident for that monitor.

API 参考

通过程序管理监控项、事件、告警渠道和状态页。API 基于 HTTPS 与 JSON。

快速开始

基础地址:https://openuptime.app/api

在应用的 API 密钥 页面创建密钥,并在每个请求中携带:使用 x-api-key 请求头,或 Authorization: Bearer <key>。密钥属于某个工作区,并可限定到特定项目。

curl https://openuptime.app/api/monitors \
  -H "x-api-key: ou_..."

要接入 AI Agent?请看 MCP 文档。

项目范围

大多数资源属于某个项目。通过 x-project-id 请求头指定项目(取自 GET /projects 的项目 id)。缺失或无效时,使用该密钥被授权的第一个项目,否则使用工作区最早创建的项目。受限密钥访问未授权的项目(包括不存在的 id)将返回 403。传入 x-project-id: all 可跨所有已授权项目读取:GET /monitors、GET /incidents、GET /counts 会汇总全部项目,GET /projects/overview 返回各项目的汇总,对项目资源的写入请求返回 400。GET /workspaces 列出你所属的工作区,GET /usage 返回当前工作区的用量。

错误

错误响应为 JSON { "error": "message" },并带有对应状态码:400 请求无效,401 缺少或无效的凭证,403 无权限,404 不存在或不在你的项目内,409 冲突,429 请求过多,5xx 服务器错误。请求体校验失败返回 400 及无效字段的 JSON 描述。删除成功返回 204,无响应体。时间为 ISO 8601 UTC,id 为 UUID。

权限遵循工作区角色。成员可读取全部内容,并创建或编辑监控项、事件和状态页;删除监控项或告警渠道、修改渠道配置需要所有者或管理员角色。对成员而言,渠道凭证(Webhook 地址、令牌、路由密钥)和监控项的请求头会以 •••••••• 掩码返回,原样回传掩码即保留已存储的值。保留已有请求头值时,修改目标、请求方法或请求头需要所有者或管理员权限;成员可以换成自己提供的全部请求头,或移除请求头。少数接口需要浏览器会话,API 密钥和智能体会得到 403:GET /me/export 与 PATCH /me/locale。解析到私有或内部地址的目标会被拒绝,返回 400 与 "error": "target_not_allowed",除非运维设置了 ALLOW_PRIVATE_TARGETS。

限流

需认证的接口在应用层没有固定的按密钥配额,但请合理使用,避免高频轮询;建议依靠监控项的检测间隔和告警渠道。登录、注册、重置密码与两步验证尝试、告警渠道的测试按钮以及公开的订阅接口都有限流,超出会返回 429。

原生应用登录(GitHub)

原生应用在 ASWebAuthenticationSession 中完成 GitHub 登录,最终得到普通的 Cookie 会话。OAuth 状态保存在发起流程的浏览器会话里,因此应用不能用自己的 HTTP 客户端发起流程。请先请求 GET /api/config:仅当 auth.github 与 auth.nativeHandoff 均为 true 时才使用此流程。

  1. 在 ASWebAuthenticationSession 中打开 GET https://<host>/api/auth/native/github,回调 scheme 为 openuptime。它返回 302 跳转到 GitHub(未配置 GitHub 返回 404,被限流返回 429)。
  2. 用户在 GitHub 登录。服务器完成登录后把会话重定向到 openuptime://auth?token=<token>。失败时重定向到 openuptime://auth?error=<code>,不带令牌(例如注册关闭时为 signup_disabled)。
  3. 在 60 秒内兑换令牌:
    POST https://<host>/api/auth/one-time-token/verify
    content-type: application/json
    
    { "token": "<token>" }
    
    200 { "session": { "token", "expiresAt", ... }, "user": { "id", "email", "name", ... } }
        + Set-Cookie: better-auth.session_token=...   (HTTPS 下带 __Secure- 前缀)
    400 { "message": "Invalid token" }   令牌未知、已使用或已过期
  4. 保存该 Cookie,之后的所有 /api 请求都像浏览器会话一样携带它。

令牌随机生成,有效期 60 秒,只能使用一次。只接受精确的回调地址 openuptime://auth,其他 scheme 或路径都不会得到令牌。兑换接口有限流(429)。GET /api/auth/list-accounts、POST /api/auth/link-social、POST /api/auth/unlink-account 等账号操作需要此 Cookie 会话,不接受 API 密钥。最后一种登录方式无法取消关联(400)。

推送通知(手机 App)

手机 App 会把 APNs 设备令牌注册到它所连接的服务器。这些接口可用会话 Cookie 或 API 密钥调用,只操作当前登录者自己的设备。请先请求 GET /api/config:push.apns 为 true 表示服务器可以发送推送。

PUT /api/push/devices
{ "token": "<十六进制,32-200 个字符>", "platform": "ios", "environment": "sandbox" | "production",
  "locale": "en" | "zh-CN", "name": "Ada 的 iPhone", "critical": false }          (locale、name 与 critical 可选,name 最多 80 个字符)

200 { "id", "token", "platform", "environment", "locale", "name", "critical" }

GET    /api/push/devices           200 [ { "id", "token", "platform", "environment", "locale", "name", "critical" } ]
DELETE /api/push/devices/:token    204

注册按令牌做 upsert:之前由其他人注册的令牌会转移给当前调用者。已配置推送时,注册还会为调用者担任所有者或管理员的每个工作区创建一个名为 Mobile app 的渠道(类型 push,对新监控默认开启),已有则不重复创建。push 渠道会通知其工作区中所有已注册设备的成员;未配置推送时创建会返回 400 与 code: "push_not_configured"。仅限部分项目的密钥可以注册设备,但不会创建渠道。

critical(布尔值,默认 false)表示该设备选择接收紧急提醒。开启后,宕机提醒会以 critical 中断级别和紧急提示音发送,可以突破勿扰模式;未开启时为 time-sensitive,恢复通知始终为 active。再次注册时省略 critical 会保留之前的设置。同一事件的提醒共用一个 APNs collapse id,因此提醒会替换设备上之前的横幅,通知按监控分组。APNs 判定无效的令牌会被自动移除,180 天未重新注册的设备也会被清理。

示例

创建监控项

curl -X POST https://openuptime.app/api/monitors \
  -H "x-api-key: ou_..." \
  -H "x-project-id: <project id>" \
  -H "content-type: application/json" \
  -d '{"name":"Homepage","type":"http","target":"https://example.com","intervalSec":60}'

列出监控项

curl https://openuptime.app/api/monitors \
  -H "Authorization: Bearer ou_..."

发送心跳

创建 "type":"heartbeat" 的监控项,并在你的任务中请求其地址。无需 API 密钥,令牌本身即是凭证。可使用 GET 或 POST。

curl https://openuptime.app/api/heartbeat/<heartbeatToken>

成功返回 {"ok":true},令牌无效返回 404。收到心跳会关闭该监控项未结束的事件。

Monitors监控项

EVM monitors call eth_syncing and succeed only when it returns false. Solana monitors call getHealth and succeed only when it returns ok. Both use HTTP(S) RPC URLs and optional request headers; they do not verify chain identity or block freshness. DNS checks query Cloudflare's public DNS-over-HTTPS resolver from auto. At least one answer of the selected record type must exist and match the optional expected value. Unicode targets and DNS hostnames use IDNA. Exact CNAME/NS and MX matching ignores hostname case and trailing dots; IPv6 forms are normalized. Exact IPv4 values trim surrounding whitespace and normalize dotted decimal octets; DNS assertion fields are ignored on other monitor types. Substring matches trim the expected text and ignore case, except for TXT; other exact values are case-sensitive. TXT uses DNS presentation including quotes; MX includes priority (10 mail.example.com.). NXDOMAIN, no matching records, truncated answers and resolver errors fail the check. Existing DNS monitors default to A with no value assertion, so a name that only has a CNAME (no address) or no A record now fails, where any answer used to pass. Recovery threshold controls outage recovery only. Each successful multi-region vote counts once; each accepted heartbeat ping counts once, even when several arrive close together, so a burst of pings can satisfy the threshold. A check run by hand on a paused monitor changes nothing about its status. A failed check resets the streak, including failures suppressed by maintenance. Inconclusive checks do not count. Slow successful responses count and can recover to degraded; latency-only recovery is unchanged. Pausing or resuming resets the success streak. Raw check results and uptime statistics are still recorded immediately.EVM 监控调用 eth_syncing,仅在返回 false 时成功;Solana 监控调用 getHealth,仅在返回 ok 时成功。两者使用 HTTP(S) RPC 地址和可选请求头,不验证链身份或区块新鲜度。DNS 检测从 auto 位置请求 Cloudflare 公共 DNS-over-HTTPS 解析器。必须至少存在一条指定类型的记录,并匹配可选期望值。Unicode 目标及 DNS 域名按 IDNA 规范化。CNAME、NS 和 MX 的完全匹配忽略域名大小写及末尾的点;IPv6 地址会规范化。IPv4 完全匹配忽略首尾空白并规范化点分十进制数值;其他监控类型会忽略 DNS 断言字段。包含匹配会去掉期望值首尾空白,且除 TXT 外忽略大小写;其他完全匹配区分大小写。TXT 使用带引号的 DNS 表示形式;MX 包含优先级(10 mail.example.com.)。域名不存在、无符合类型的记录、响应截断或解析器错误均判定为失败。已有 DNS 监控默认检测 A 记录,不校验具体值;因此只有 CNAME(没有地址)或没有 A 记录的域名现在会判定为失败,而此前任何应答都算通过。恢复阈值仅控制宕机恢复。每轮成功的多区域投票计一次,每次接受的心跳计一次,即使多次心跳间隔很短也各自计数,因此连续快速的心跳可以满足阈值。对已暂停的监控手动执行检测不会改变其状态。失败检测会清零连续成功次数,包括维护期内被抑制的失败;无法判定的检测不计数。慢响应只要成功也计入,可能恢复为性能下降;单独的延迟事故恢复逻辑不变。暂停或恢复检测会清零成功次数。原始检测结果和可用率统计仍即时记录。

GET/monitors

List the project's monitors, with 24-hour uptime, average latency and a latency sparkline.列出当前项目的监控项,附带 24 小时可用率、平均延迟和延迟走势。

[{ id, name, type, target, method, expectedStatus, intervalSec, timeoutMs, failureThreshold, regions,
   status, consecutiveFailures, lastCheckedAt, nextCheckAt, paused, heartbeatToken, keyword, keywordMode,
   headers, graceSec, ..., uptime24h, avgLatency24h, spark }]
POST/monitors

Create a monitor. Omitted fields take their defaults. Returns 201 with the monitor; heartbeat monitors get a heartbeatToken.创建监控项,省略的字段使用默认值。返回 201 和监控项;心跳类型会生成 heartbeatToken。

name           string, 1-120 chars (required)
type           "http" | "tcp" | "websocket" | "dns" | "heartbeat" | "postgres" | "mysql" | "redis" | "ssl" | "domain" | "mcp" | "evm" | "solana"   (default "http"; cannot be changed later)
target         string, max 2048   (URL for http, ws:// or wss:// URL for websocket, host:port for tcp/postgres/mysql/redis, hostname for dns, ssl and domain; https URL of the MCP endpoint for mcp; http(s) RPC URL for evm and solana)
method         "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS"
requestBody    string | null (max 16384 UTF-8 bytes; no body for GET/HEAD)
expectedStatus integer 100-599                               (default 200)
intervalSec    integer 30-86400                              (default 60; the plan may set a floor; ssl: 3600-86400, default 21600)
timeoutMs      integer 1000-30000                            (default 10000)
failureThreshold integer 1-10  consecutive failures before an incident opens (default 3)
recoveryThreshold integer 1-10 successful runs or heartbeat pings before recovering from down (default 1)
regions        string[], ids from GET /regions                 (default ["auto"]; http, tcp, websocket and mcp monitors only)
keyword        string | null, max 500                        (default null)
keywordMode    "contains" | "absent"                         (default "contains")
expectedLocation string | null, max 2048  with a 301/302/303/307/308 expectedStatus: the redirect is not followed; Location must equal this URL or path (default null = any)
headers        { [name: string]: string }  http, mcp, or the websocket handshake (default {})
mcpConfig      { transport?: "auto" | "streamable-http" | "sse", oauth?: object | null, listPrompts?: boolean, listResources?: boolean, driftPolicy?: "down" | "degraded" | "record", requiredTools: string[], schemaCheck: boolean, toolCall: null | { enabled: boolean, name: string, arguments: object, assertions: { path: string, operator: "equals" | "contains" | "exists", value?: JSON }[] } } (mcp only; schemaCheck false and toolCall null by default)
wsMessage      string | null, max 2000  websocket: text sent once connected; a message must come back within timeoutMs (default null = handshake only; not a secret)
dnsRecordType  "A" | "AAAA" | "CNAME" | "MX" | "TXT" | "NS" (default "A")
dnsExpectedValue string | null, max 2000 (default null = any answer of selected type)
dnsMatchMode   "exact" | "contains" (default "exact")
graceSec       integer 0-86400, heartbeat grace period       (default 0)
channelIds     uuid[], max 50                                (default [])
tags           string[], max 20 items of up to 32 chars      (default [])
slowThresholdMs integer 100-60000, latency above this marks the monitor "degraded" (default 1500)
slowAlertAfter integer 0-20, open a latency incident after this many consecutive slow checks; 0 = never (default 0)
dependsOnMonitorId uuid | null, another monitor of the same project; while it is down this one opens no incidents and sends no alerts (default null; never itself or a cycle)
minRegionsFailing integer 0-20, several regions: how many must fail before the monitor goes down; 0 = a majority of those that answered (default 0)
GET/monitors/export

Download the project's monitors as JSON ({ version, exportedAt, monitors }). Request headers are included, so treat the file as sensitive.以 JSON 导出当前项目的监控项({ version, exportedAt, monitors })。文件包含请求头,请当作敏感文件保管。

POST/monitors/import/preview

Validate an import without creating monitors. Returns per-row warnings, duplicate identities, plan capacity and destination.验证导入但不创建监控项,返回逐条警告、重复标识、套餐容量和目标信息。

POST/monitors/import

Create monitors from a JSON array (or an object with a monitors array), up to 500 per call. Accepts our export plus common aliases from other tools (name/friendly_name, target/url/hostname, interval in seconds, type https/keyword/port). Invalid items are skipped and reported. Returns 201 when records are created, 200 for an idempotent duplicate-only retry, or 400 when every row is invalid; responses include created, duplicates, skipped and report. Request bodies are limited to 4 MiB.从 JSON 数组(或含 monitors 数组的对象)批量创建监控项,单次最多 500 个。支持本产品的导出格式,以及其他工具常见的字段别名(name/friendly_name、target/url/hostname、interval 秒、type https/keyword/port)。无效项会被跳过并返回。创建新项时返回 201,仅包含重复项的幂等重试返回 200,所有记录无效时返回 400;响应包含 created、duplicates、skipped 和 report。请求体最大为 4 MiB。

{ "monitors": [ { "name": "API", "type": "http", "target": "https://api.example.com", "tags": ["prod"] } ] }
{ created: 1, skipped: [] }
GET/monitors/:id

One monitor with its last 120 check results, last 5 incidents and stats.获取单个监控项,含最近 120 条检测结果、最近 5 个事件和统计数据。

{ ...monitor, results: [{ id, region, ok, statusCode, latencyMs, error, checkedAt }],
  incidents: [...], stats: { uptime24h, uptime7d, avg24h, p95 },
  regionStats: [{ region, checks24h, uptime24h, avgLatency24h, last }] }
GET/monitors/:id/time-coverage?days=7

Authenticated 7- or 30-day UTC time coverage (days defaults to 7). Returns from, to, totalMs, states (up/down/degraded/paused/unknown milliseconds), observedMaintenanceMs and policy. Uses monitor project permissions; responses are not cached. Missing observations are unknown; maintenance is included, not subtracted. This is inferred observation coverage, not exact outage duration or an SLA.需认证的 7 天或 30 天 UTC 时间覆盖报告(days 默认 7)。返回 from、to、totalMs、states(正常/缓慢/宕机/暂停/未知的毫秒数)、observedMaintenanceMs 和 policy。沿用监控项的项目权限,响应不缓存。缺失观测记为未知,维护时间包含在内,不从分母扣除;这是观测推断覆盖,不是精确停机时长或 SLA。

PATCH/monitors/:id

Update the named fields only (same fields as create, except type). Also accepts paused (boolean) to pause or resume. At least one field is required.仅更新传入的字段(与创建相同,但不含 type),另可传 paused(布尔)暂停或恢复。至少需要一个字段。

any of the create fields except "type", plus:
paused  boolean
DELETE/monitors/:id

Delete a monitor and its results. Returns 204.删除监控项及其检测结果。返回 204。

POST/monitors/:id/check

Run a check immediately from the monitor's own regions and record it. Returns { ok: true }. With a region, sends one request from that region instead, as a diagnostic: the result is returned and nothing is recorded or changes the monitor's status. It uses one check of your allowance. 502 probe_unreachable when the region could not be reached.立即按监控项自己的区域执行一次检测并记录,返回 { ok: true }。传入 region 时,改为只从该区域发出一次请求用于诊断:返回结果,但不记录,也不会改变监控状态,消耗 1 次检查额度。区域无法连通时返回 502 probe_unreachable。

(no body)   run from the monitor's regions and record the result
{ "region": "eu-central" }   one-off request from that region
{ ok: true }
{ ok: true, region: "eu-central", result: { ok, statusCode, latencyMs, error } }
GET/monitors/:id/ssl

Certificate check of an https monitor (hosted service, Lite and above; 404 elsewhere). allowed is false on Free and upgradeUrl then points at the pricing page; result is the last reading for the monitor's current host, or null.https 监控的证书检测(托管服务,Lite 及以上;其他部署返回 404)。Free 套餐 allowed 为 false,upgradeUrl 指向定价页;result 为当前主机最近一次读取结果,没有则为 null。

{ supported: true, host: "example.com", allowed: true, configured: true, plan: "lite", upgradeUrl,
  enabled: true, warnDays: 14,
  result: { status: "ok" | "expiring" | "expired" | "invalid" | "error", daysLeft, notAfter, issuer, subject,
            trustError, error, checkedAt } | null }
PUT/monitors/:id/ssl

Turn certificate alerts on or off and set how many days before expiry to warn. Re-reads the certificate right away. 402 plan_required on Free, 400 ssl_unsupported for non-https targets.开关证书提醒,并设置到期前多少天开始提醒;保存后立即重新读取证书。Free 套餐返回 402 plan_required,非 https 目标返回 400 ssl_unsupported。

enabled   boolean
warnDays  integer 1-90 (default 14)
POST/monitors/:id/ssl/check

Read the certificate now (at most once per 20 seconds). Returns the same object as GET.立即读取一次证书(每 20 秒最多一次),返回与 GET 相同的对象。

Regions检测区域

A monitor checks from its own location (auto) unless regions says otherwise; list regions only for http, tcp, websocket and mcp monitors. With several regions a run is down when most of the regions that answered failed, so one region's bad route does not page you. Each region counts as one check of your allowance. Errors: 400 unknown_region, 400 regions_not_supported (other monitor types), 402 regions_not_allowed (more regions than the plan allows).监控项默认从服务自身所在位置(auto)检测,仅当设置 regions 时才走多区域,且只适用于 http、tcp、websocket 与 mcp 类型。多区域时,只有多数应答的区域都失败才判定为故障,单个区域的线路问题不会触发告警。每个区域各计一次检查额度。错误:400 unknown_region、400 regions_not_supported(其他类型)、402 regions_not_allowed(超出套餐允许的区域数)。

GET/regions

The regions this deployment can check from, the monitor types that support them and how many one monitor may list (null: no limit, which is always the case when self-hosting).当前部署可用的检测区域、支持区域检测的监控类型,以及单个监控项最多可选的区域数(null 表示不限,自部署始终不限)。

{ regions: [{ id: "auto", name: "Auto" }, { id: "us-east", name: "US East (Virginia)" }, ...],
  types: ["http", "tcp", "websocket", "mcp"], maxPerMonitor: 3 }   // null: no limit

Incidents事件

GET/incidents

The latest 100 incidents of the project, newest first. Pass q to filter by incident number (INC-12 or 12) or by a word in the title.当前项目最新的 100 个事件,按时间倒序。传入 q 可按事件编号(INC-12 或 12)或标题关键词过滤。

[{ id, number, monitorId, title, status, severity, auto, assigneeId, startedAt, acknowledgedAt, resolvedAt, rootCause, postmortem, monitorName }]
number is sequential inside the project: INC-<number>
POST/incidents

Open an incident manually. Returns 201.手动创建事件。返回 201。

title      string, 1-200 (required)
body       string, max 4000   first update, optional
severity   "minor" | "major"   (default "major")
monitorId  uuid | null        optional
visibility "public" | "internal"   of the first update (default "public")
GET/incidents/:id

An incident with its updates (internal ones included), monitor, assignee and up to 8 failing checks.获取事件详情,含更新记录(包括内部更新)、监控项、负责人和最多 8 条失败检测。

{ ...incident, updates: [{ id, status, body, visibility, authorId, createdAt }], monitor, assignee, checks }
PATCH/incidents/:id

Set or clear the root cause and the postmortem. A field left out stays as it is; null or an empty string clears it. Both stay private until you send publishPostmortem: true; then they are shown on the public status page once the incident is resolved (false takes them back). Returns the incident.设置或清除根因和复盘。未传的字段保持不变,传 null 或空字符串则清除。传 publishPostmortem: true 之前两者保持私有;发布后,事件解决时才会显示在公开状态页上(传 false 可撤回)。返回该事件。

rootCause   string | null, max 500    short cause
postmortem  string | null, max 20000  markdown or plain text
publishPostmortem  boolean   show both on the public page once resolved (sets postmortemPublishedAt)
POST/incidents/:id/updates

Post an update and set the incident status. A public update shows on status pages and is emailed to subscribers; an internal one is visible to your team only and sends nothing. Status "resolved" closes the incident and must be public (400 for an internal one), because subscribers are mailed about it. Returns 201.发布更新并设置事件状态。公开更新会显示在状态页并邮件通知订阅者;内部更新仅团队可见,不会发送任何通知。状态为 "resolved" 时事件关闭,且必须是公开更新(内部更新返回 400),因为订阅者会收到邮件。返回 201。

status      "investigating" | "identified" | "monitoring" | "resolved"
body        string, 1-4000
visibility  "public" | "internal"   (default "public")
POST/incidents/:id/ack

Acknowledge an incident and assign it to the caller. Returns the incident.确认事件并指派给调用者。返回该事件。

Channels告警渠道

config depends on type: email { to }, slack { url }, discord { url }, teams { url }, ntfy { url, topic, token?, priority? (1–5 as a string) }, lark { url, secret? }, webhook { url }, telegram { botToken, chatId }, pagerduty { routingKey }. Channel configs contain secrets and are returned as stored. A channel with autoEnable is added to the channelIds of every monitor created afterwards (in its project, or in any project for a workspace-wide channel), on top of any ids given; a monitor whose channelIds is empty alerts every enabled channel.config 取决于 type:email { to }、slack { url }、discord { url }、teams { url }、ntfy { url, topic, token?, priority?(字符串 1–5) }、lark { url, secret? }、webhook { url }、telegram { botToken, chatId }、pagerduty { routingKey }。渠道配置含敏感信息,按存储内容原样返回。

GET/channels

List the alert channels available in the project: workspace-wide ones (projectId null) and the project's own.列出当前项目可用的告警渠道:工作区级渠道(projectId 为 null)和项目自己的渠道。

[{ id, type, name, config, enabled, autoEnable, createdAt, projectId }]
POST/channels

Create a channel. Returns 201.创建渠道。返回 201。

type     "email" | "slack" | "telegram" | "webhook" | "pagerduty" | "lark" | "discord" | "teams" | "ntfy"
name     string, 1-80
config   object   (default {})
enabled  boolean  (default true)
autoEnable  boolean  (default false)  new monitors start out alerting this channel
scope    "workspace" | "project"  (default "workspace"; a project-limited key always creates a project channel)
PATCH/channels/:id

Update name, enabled, autoEnable or config.更新名称、启用状态、autoEnable 或配置。

name     string, 1-80
enabled  boolean
autoEnable  boolean
config   object
POST/channels/:id/test

Send a test message. Returns { ok: true }, or 502 with the delivery error.发送测试消息。成功返回 { ok: true },失败返回 502 及错误信息。

DELETE/channels/:id

Delete a channel. Returns 204, or 409 (code "channel_in_use", with the monitors) while a monitor still lists it in channelIds.删除渠道。返回 204;仍有监控在 channelIds 中选用它时返回 409(code 为 "channel_in_use",并附监控列表)。

Status pages状态页

GET/status-pages

List the project's status pages.列出当前项目的状态页。

[{ id, slug, title, theme, showLatency, customDomain, externalUrl, hideBranding, uptimeOkPct, uptimeWarnPct, mcpEnabled, maintenanceReminderHours, createdAt, projectId }]
POST/status-pages

Create a status page. The slug must be unused (409 otherwise). Returns 201.创建状态页。slug 不能被占用(否则 409)。返回 201。

slug         string, /^[a-z0-9-]{3,40}$/ (required)
title        string, 1-120 (required)
externalUrl  string | null, http(s) URL up to 2048 (a link shown beside the title, rel=nofollow)
theme        "light" | "dark" | "auto"
showLatency  boolean
hideBranding boolean (hide the OpenUptime mark and "Powered by" line; the header shows the logo of externalUrl via favicon.im; 402 branding_not_allowed when the plan does not include it)
uptimeOkPct  number 1-100, default 99.9 (uptime bars are green from here)
uptimeWarnPct number 1-100, default 98 (amber from here, red below; must be lower than uptimeOkPct, 400 otherwise)
mcpEnabled   boolean, default true (the public read-only MCP tools may read the page; the page, feeds and llms.txt stay public either way)
maintenanceReminderHours integer 0-168, default 24 (0 = no reminder email before maintenance)
monitorIds   uuid[]
components   [{ monitorId: uuid, groupName?: string 1-60 }], max 200 (takes precedence over monitorIds)
GET/status-pages/:id

A status page with its ordered components.获取状态页及其有序组件。

{ ...page, monitorIds: uuid[], components: [{ monitorId, groupName }], branding: { allowed, upgradeUrl? } }
PATCH/status-pages/:id

Update title, theme, showLatency or replace the components. Slug cannot be changed. Returns { ok: true }.更新标题、主题、延迟显示,或替换组件。slug 不可修改。返回 { ok: true }。

title, theme, showLatency, externalUrl, hideBranding, uptimeOkPct, uptimeWarnPct, mcpEnabled, maintenanceReminderHours, monitorIds, components   (all optional, as in create)
DELETE/status-pages/:id

Delete a status page. Returns 204.删除状态页。返回 204。

GET/status-pages/:id/subscribers

Up to 1000 subscribers, newest first.最多 1000 位订阅者,按时间倒序。

[{ id, email, confirmedAt, createdAt }]
DELETE/status-pages/:id/subscribers/:sid

Remove a subscriber. Returns 204.移除订阅者。返回 204。

GET/status-pages/:id/domain

Hosted service only. The page's custom domain and the DNS records to create. A pending domain is refreshed from the certificate provider on every read.仅托管版。状态页的自定义域名及需要添加的 DNS 记录。处于等待状态时,每次读取都会向证书服务商刷新。

{ allowed, configured, target, plan, upgradeUrl, domain: null | { hostname, status: "pending" | "active" | "failed", sslStatus, records: [{ type: "CNAME" | "TXT", name, value }], error } }
PUT/status-pages/:id/domain

Hosted service only, paid plans (402 code "plan_required" otherwise). Connect a hostname; one per page, replacing the previous one. 409 if the hostname is already used by another page. When the workspace drops to the Free plan the domain is released and must be connected again after subscribing. Returns 201.仅托管版,付费套餐可用(否则 402,code 为 "plan_required")。绑定一个域名;每个状态页一个,会替换原有域名。域名已被其他状态页使用时返回 409。工作区降到 Free 后域名会被解除,重新订阅后需再次绑定。返回 201。

hostname  string, e.g. "status.example.com" (required)
DELETE/status-pages/:id/domain

Hosted service only. Disconnect the custom domain. Returns 204.仅托管版。解除自定义域名。返回 204。

Maintenance维护窗口

While a window is active, the monitors it covers keep being checked but open no incidents and send no alerts. An empty monitorIds list covers every monitor in the selected project. Recurrence is daily or weekly in an IANA time zone, through an inclusive until instant within 366 days. Duration is fixed elapsed time (at most 24 hours). The first start is exactly the supplied instant; later starts follow its local wall-clock time. DST gaps shift forward using the prior offset; overlaps use the later instant. All occurrences are created together, each with an independent reminder identity. Canceling does not recall reminders already claimed for delivery or sent.维护窗口生效期间,所覆盖的监控项仍会被检测,但不会创建事件或发送告警。monitorIds 为空表示覆盖当前项目内所有监控项。可按 IANA 时区每天或每周重复,截止时刻包含在内且须在首次开始后 366 天内。每次实际持续时长固定,最多 24 小时。首次开始严格采用传入时刻;后续按当地墙钟时间重复。夏令时跳时使用跳时前偏移量向后顺延,重复时刻选择后一次。所有窗口同时生成,每次有独立提醒标识。取消不会撤回已领取待发送或已发送的提醒。

GET/maintenance

Up to 1000 project windows, active/upcoming first and closest to now first.最多返回 1000 个项目维护窗口,当前及未来窗口优先,并按距离当前时间排序。

[{ id, name, startsAt, endsAt, monitorIds, createdAt, projectId, seriesId, recurrence }]
POST/maintenance

Schedule one window or a bounded recurring series. Returns 201 with the first occurrence; use GET /maintenance to list all.创建一次性窗口或有限周期系列。返回 201 和首次窗口;通过 GET /maintenance 查看全部。

name        string, 1-120
startsAt    ISO 8601 date-time
endsAt      ISO 8601 date-time, after startsAt
monitorIds  uuid[], max 500   (default [])
recurrence  null (default), or { frequency: "daily" | "weekly", timeZone: "America/Toronto", until: "2027-01-01T00:00:00Z" }
POST/maintenance/:id/end

End an active occurrence now, retaining history. Idempotent. Returns { ok: true }.立即结束当前窗口并保留历史。可重复调用,返回 { ok: true }。

DELETE/maintenance/series/:id

Cancel a series by seriesId: remove future occurrences and end active ones, preserving completed windows. Idempotent, returns 204.按 seriesId 取消系列:删除未来窗口并结束当前窗口,保留已完成历史。可重复调用,返回 204。

DELETE/maintenance/:id

Delete one occurrence (skip it); the rest of its series is unchanged. Returns 204.删除单次窗口(跳过本次),不影响系列其他窗口。返回 204。

Projects项目

Creating, renaming and deleting projects is not available to API keys that are limited to specific projects (403).限定了特定项目的 API 密钥不能创建、重命名或删除项目(403)。

GET/projects

The workspace's projects (only the permitted ones for a limited key).列出工作区的项目(受限密钥只能看到被授权的项目)。

[{ id, name, createdAt }]
POST/projects

Create a project. Returns 201.创建项目。返回 201。

name  string, 1-60
PATCH/projects/:id

Rename a project.重命名项目。

name  string, 1-60
DELETE/projects/:id

Delete a project and everything in it. A workspace must keep at least one project (400). Returns 204.删除项目及其全部内容。工作区至少保留一个项目(否则 400)。返回 204。

Settings设置

GET/settings

Workspace preferences.工作区偏好设置。

{ alertLogRetentionDays: 14, checkRetentionDays: 30, monthlyReport: false,
  limits: { alertLogRetentionDays: 14, checkRetentionDays: 30 },   // the most the plan keeps
  plan: { id: "free", name: "Free", upgradeUrl: "/pricing?ws=…" } }   // null without plans
PATCH/settings

Update preferences. Not available to project-limited keys (403). On the hosted service a value above the plan's limit is refused with 402, code "retention_not_allowed".更新偏好设置。受限于项目的密钥不可用(403)。托管版中,超过套餐上限的值返回 402(code 为 "retention_not_allowed")。

alertLogRetentionDays  integer 1-365   (at most limits.alertLogRetentionDays)
checkRetentionDays     integer 1-365   (raw check results; hourly rollups are kept for a year)
monthlyReport          boolean         (email the owners last month's uptime on the first days of each month)

Alert log告警日志

GET/alert-log

Alert delivery history, newest first. Query: limit (1-200, default 50) and before (ISO 8601 date-time cursor, the createdAt of the last row of the previous page).告警投递历史,按时间倒序。查询参数:limit(1-200,默认 50)和 before(ISO 8601 时间游标,取上一页最后一条的 createdAt)。

[{ id, channelId, channelName, channelType, kind, incidentId, monitorName, ok, error, createdAt }]
kind: "incident.opened" | "incident.resolved" | "test" | "subscribers"
      | "ssl.expiring" | "ssl.expired" | "ssl.invalid" | "ssl.renewed"   // hosted service; incidentId is null

Me and counts当前用户与计数

GET/me

The caller, the workspace and the active project.当前调用者、工作区和当前项目。

{ userId, user: { name, email, locale }, organization, projectId }
GET/me/export

Download everything held about the caller as JSON: profile, sessions and the workspaces they own or administer.以 JSON 下载与调用者相关的全部数据:资料、会话,以及其拥有或管理的工作区内容。

PATCH/me/locale

Set the language used for emails to this user.设置发给该用户的邮件所使用的语言。

locale  "en" | "zh-CN"
{ locale }
GET/counts

Sidebar counts for the active project.当前项目的侧边栏计数。

{ monitors, incidents, "status-pages", alerting }

Public status endpoints公开状态接口

These endpoints need no authentication and are what powers public status pages. Paths are under /api/public/status; <slug> is the status page address. Unknown slugs return 404.这些接口无需认证,用于驱动公开状态页。路径位于 /api/public/status 之下,<slug> 为状态页地址。slug 不存在时返回 404。

GET/api/public/status/<slug>

Current status, 90 buckets of uptime history per component (daily, or hourly while history is under four days) and open incidents.当前状态、每个组件 90 个时间桶的可用率历史(按天,历史不足四天时按小时)以及未结束的事件。

{ page: { slug, title, theme, showLatency },
  overall: "operational" | "degraded" | "outage" | "unknown",
  bucket: "day" | "hour",
  components: [{ id, name, group, status, uptime90d, days: [{ day, uptime }] }],
  incidents: [{ id, number, title, status, severity, startedAt, resolvedAt,
                updates: [{ id, body, status, createdAt }] }] }

Only public updates are listed; internal updates never appear here, in the history, in the RSS feed or in subscriber emails. rootCause and postmortem are added to an incident only when it is resolved, they are set, and a person has published them (publishPostmortem); resolving alone never does.这里只列出公开更新;内部更新不会出现在此处、事件历史、RSS 订阅源或订阅者邮件中。仅当事件已解决、已填写、并且有人已发布(publishPostmortem)时,才会附带 rootCause 和 postmortem;仅仅解决事件不会公开它们。

GET/api/public/status/<slug>/incidents?before=<ISO date>

Incident history, newest first, 15 per page. Pass the returned next as before to continue; next is null on the last page.事件历史,按时间倒序,每页 15 条。将返回的 next 作为 before 传入即可翻页;最后一页 next 为 null。

{ items: [{ id, number, title, status, severity, startedAt, resolvedAt, rootCause?, postmortem?, updates: [...] }], next }
GET/api/public/status/<slug>/rss.xml

RSS 2.0 feed of the latest 50 incidents and maintenance windows together (application/rss+xml); titles start with [Incident] or [Maintenance]. /rss is the same feed.最近 50 条事件和维护窗口合并的 RSS 2.0 订阅源(application/rss+xml),标题以 [Incident] 或 [Maintenance] 开头。/rss 是同一个订阅源。

GET/api/public/status/<slug>/badge.svg

SVG badge in the colour of the worst component state, cached for 60 seconds. An unknown or unpublished page gets a grey “unknown” badge. ?lang=zh for Chinese.以最差组件状态着色的 SVG 徽章,缓存 60 秒。不存在或未发布的页面显示灰色“未知”徽章。加 ?lang=zh 显示中文。

GET/api/public/status/<slug>/maintenance

Upcoming and recent maintenance windows as JSON. Window names are public: they show on the page, in the feeds and in subscriber emails, so do not put anything private in one.计划中和近期的维护窗口(JSON)。窗口名称是公开的:会显示在状态页、订阅源和订阅者邮件中,请勿在其中写入私密内容。

GET/api/public/status/<slug>/maintenance.ics

Maintenance windows as an iCalendar feed (up to 100 events, cached for five minutes).维护窗口的 iCalendar 订阅源(最多 100 个事件,缓存 5 分钟)。

GET/api/public/status/<slug>/llms.txt

A short plain-text summary of the page for language models: overall state, components, active incidents, upcoming maintenance and the machine-readable links.面向语言模型的简短纯文本摘要:整体状态、组件、进行中的事件、即将到来的维护,以及机器可读的链接。

POST/api/public/status/<slug>/subscribe

Subscribe an email address to incident updates. A confirmation email is sent; the response is { "ok": true } either way, so it does not reveal who is subscribed. Limited to 10 requests per hour per client IP, 3 per address per page per hour, 5 per address across all pages per hour and 200 per page per hour (429), and 5000 subscribers per page (409).订阅事件通知邮件。系统会发送确认邮件;无论是否已订阅,响应都是 { "ok": true },不会泄露订阅情况。限流:每个客户端 IP 每小时 10 次、每个邮箱每个状态页每小时 3 次、每个邮箱跨所有状态页每小时 5 次、每个状态页每小时 200 次(429),每个状态页最多 5000 位订阅者(409)。

Optional monitorIds (uuid array) limits the subscription to those components; empty or omitted means the whole page. Asking again with the same address replaces the locale and components of a pending address with the newest ones and sends the confirmation email again; a confirmed address gets no mail and no change. The per-address limit is shared by everyone, so someone else repeatedly submitting your address can delay your own confirmation mail until the hour is up.可选的 monitorIds(uuid 数组)把订阅限定在这些组件;留空或不传表示整个页面。用同一邮箱再次请求时,待确认的邮箱会以最新的语言和组件覆盖原有选择,并再次收到确认邮件;已确认的邮箱不会收到邮件,也不会有任何改动。每个邮箱的限流对所有人共用,因此他人反复提交你的邮箱,可能让你自己的确认邮件延迟到下一个小时才能发出。

{ "email": "you@example.com", "monitorIds": [] }
GET/api/public/status/_/confirm?token=<token>
GET/api/public/status/_/unsubscribe?token=<token>
POST/api/public/status/_/unsubscribe?token=<token>

Links used in subscription emails. Confirming redirects to the status page. Unsubscribing asks first: GET shows a small page with a button, and only the POST removes the address, so a mail scanner opening the link changes nothing. Subscriber emails also carry List-Unsubscribe and List-Unsubscribe-Post: List-Unsubscribe=One-Click headers; a mail client's one-click button POSTs to this address and gets 200.订阅邮件中使用的链接。确认链接会重定向到状态页。退订需要二次确认:GET 只显示一个带按钮的小页面,只有 POST 才会移除该邮箱,因此邮件扫描程序打开链接不会产生任何影响。订阅者邮件还带有 List-Unsubscribe 和 List-Unsubscribe-Post: List-Unsubscribe=One-Click 头;邮件客户端的一键退订按钮会向该地址发送 POST 并得到 200。

Last updated 2026-10-17最后更新:2026-10-17