From c8e19d33be0be21a32e147c09381f6cd3940f7bf Mon Sep 17 00:00:00 2001 From: ysyneu Date: Tue, 30 Jun 2026 16:40:06 +0800 Subject: [PATCH] docs: add ai sre automation api reference --- .agents/skills/api-review/mapping.yaml | 63 +- api-reference/openapi.en.json | 17946 +++++++++++----------- api-reference/openapi.zh.json | 18254 ++++++++++++----------- api-reference/safari.openapi.en.json | 4933 +++--- api-reference/safari.openapi.zh.json | 4951 +++--- docs.json | 26 + en/openapi/api-catalog.mdx | 16 +- zh/openapi/api-catalog.mdx | 16 +- 8 files changed, 25717 insertions(+), 20488 deletions(-) diff --git a/.agents/skills/api-review/mapping.yaml b/.agents/skills/api-review/mapping.yaml index 13b8f06..c5ae112 100644 --- a/.agents/skills/api-review/mapping.yaml +++ b/.agents/skills/api-review/mapping.yaml @@ -543,10 +543,68 @@ modules: path_prefixes: [/push, /kv, /onboarding] providers: [pgy] + safari/session: + priority: 580 + tag_en: "Sessions" + tag_zh: "会话" + icon: "comments" + path_prefixes: [/safari/session] + providers: [safari] + repos: + - name: fc-safari + paths: [cmd/api/sessions, logic/session, types] + + safari/automation: + priority: 590 + tag_en: "Automations" + tag_zh: "自动化" + icon: "clock" + path_prefixes: + - /safari/automation/rule + - /safari/automation/template + - /safari/automation/run + providers: [safari] + repos: + - name: fc-safari + paths: [cmd/api/automation, logic/automation, model/automation, types] + + safari/skill: + priority: 600 + tag_en: "Skills" + tag_zh: "技能" + icon: "wand-magic-sparkles" + path_prefixes: [/safari/skill] + providers: [safari] + repos: + - name: fc-safari + paths: [cmd/api/skills, logic/skill, types] + + safari/mcp: + priority: 610 + tag_en: "MCP servers" + tag_zh: "MCP 服务器" + icon: "plug" + path_prefixes: [/safari/mcp] + providers: [safari] + repos: + - name: fc-safari + paths: [cmd/api/mcp, logic/mcp, types] + + safari/a2a-agent: + priority: 620 + tag_en: "A2A agents" + tag_zh: "A2A 智能体" + icon: "robot" + path_prefixes: [/safari/a2a-agent] + providers: [safari] + repos: + - name: fc-safari + paths: [cmd/api/a2a, logic/a2a, types] + _internal/safari: hidden: true - reason: "AI agent (fc-safari) — separate product surface, not part of the public Flashduty API." - path_prefixes: [/safari, /copilot, /ai] + reason: "Internal AI agent routes that remain non-public or are not yet published." + path_prefixes: [/copilot, /ai] providers: [safari, event] _internal/echo: @@ -571,4 +629,3 @@ modules: reason: "Small unfinished surfaces; revisit when stable." path_prefixes: [/collab, /change, /onboarding] providers: [event, pgy] - diff --git a/api-reference/openapi.en.json b/api-reference/openapi.en.json index a28f35f..e29c8e1 100644 --- a/api-reference/openapi.en.json +++ b/api-reference/openapi.en.json @@ -18,244 +18,165 @@ ], "tags": [ { - "name": "On-call/Incidents", - "description": "" + "name": "AI SRE/Sessions" }, { - "name": "On-call/Channels", - "description": "" + "name": "AI SRE/Automations" }, { - "name": "On-call/Alerts", - "description": "Search, inspect, and act on alerts. Manage card views and alert processing pipelines." + "name": "AI SRE/Skills" }, { - "name": "On-call/Integrations", - "description": "" + "name": "AI SRE/MCP servers" }, { - "name": "On-call/IM integrations", - "description": "IM integration queries, such as which integrations have war room enabled." + "name": "AI SRE/A2A agents" }, { - "name": "On-call/Schedules", - "description": "" + "name": "On-call/Incidents" }, { - "name": "On-call/Calendars", - "description": "" + "name": "On-call/Channels" }, { - "name": "On-call/Notification templates", - "description": "" + "name": "On-call/Alerts" }, { - "name": "On-call/Alert enrichment", - "description": "Custom fields, enrichment rules, and data mapping (schema, data, API)." + "name": "On-call/Integrations" }, { - "name": "On-call/Analytics", - "description": "" + "name": "On-call/IM integrations" }, { - "name": "On-call/Status pages", - "description": "" + "name": "On-call/Schedules" }, { - "name": "Monitors/Alert rules", - "description": "Create, manage, and export monitor alert rules. Query rule counters and audit history." + "name": "On-call/Calendars" }, { - "name": "Monitors/Data sources", - "description": "Manage monitoring data sources used by alert rules to query metrics." + "name": "On-call/Notification templates" }, { - "name": "Monitors/Rule sets", - "description": "Manage shared rule sets (rulesets) in the Monitors rule repository. Rulesets can be shared publicly or within an account." + "name": "On-call/Alert enrichment" }, { - "name": "RUM/Applications", - "description": "Manage Real User Monitoring (RUM) applications." + "name": "On-call/Analytics" }, { - "name": "RUM/Issues", - "description": "Query and manage RUM error tracking issues and preset severity rules." + "name": "On-call/Status pages" }, { - "name": "RUM/Sourcemaps", - "description": "Manage and query RUM sourcemap files for browser, Android, and iOS error symbolication." + "name": "Monitors/Alert rules" }, { - "name": "Platform/Members", - "description": "" + "name": "Monitors/Data sources" }, { - "name": "Platform/Teams", - "description": "" + "name": "Monitors/Rule sets" }, { - "name": "Platform/Roles & permissions", - "description": "" + "name": "RUM/Applications" }, { - "name": "Platform/Audit logs", - "description": "Search and retrieve account operation audit logs." + "name": "RUM/Issues" }, { - "name": "Monitors/Diagnostics", - "description": "Diagnostic and query endpoints used by Flashduty AI SRE — ad-hoc data source queries, log/metric diagnostics, and target-side tool invocation." + "name": "RUM/Sourcemaps" }, { - "name": "Platform/Account", - "description": "Account profile and settings" + "name": "Platform/Members" }, { - "name": "AI SRE/MCP servers", - "description": "MCP (Model Context Protocol) server management." + "name": "Platform/Teams" }, { - "name": "AI SRE/A2A agents", - "description": "A2A (agent-to-agent) remote agent management." + "name": "Platform/Roles & permissions" }, { - "name": "On-call/Changes", - "description": "" + "name": "Platform/Audit logs" }, { - "name": "AI SRE/Skills", - "description": "AI SRE agent skill management." + "name": "Monitors/Diagnostics" }, { - "name": "AI SRE/Sessions", - "description": "AI SRE agent session history — list, inspect, and export transcripts." + "name": "Platform/Account" }, { - "name": "Monitors/Monitor utilities", - "description": "Monitors service activation and data preview utilities." + "name": "On-call/Changes" + }, + { + "name": "Monitors/Monitor utilities" } ], "paths": { - "/incident/list": { + "/account/info": { "post": { - "operationId": "incidentList", - "summary": "List incidents", - "description": "Query a paginated list of incidents with filters by channel, severity, status, responder, and time range.", + "summary": "Get account detail", + "description": "Return the current account's profile and settings.", + "operationId": "account-read-info", "tags": [ - "On-call/Incidents" + "Platform/Account" ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-list", - "metadata": { - "sidebarTitle": "List incidents" + "security": [ + { + "AppKeyAuth": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": {} + } } }, "responses": { "200": { - "description": "Success", + "description": "OK", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/IncidentListResponse" + "$ref": "#/components/schemas/AccountInfo" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "error_code": 0, "data": { - "total": 88, - "has_next_page": true, - "search_after_ctx": "69da451ef77b1b51f40e83eb", - "items": [ - { - "incident_id": "69da451ef77b1b51f40e83ee", - "account_id": 2451002751131, - "channel_id": 2551105804131, - "integration_id": 2490562293131, - "integration_ids": [ - 2490562293131 - ], - "integration_types": [ - "monit.alert" - ], - "dedup_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", - "equals_md5": "", - "start_time": 1775912219, - "end_time": 0, - "last_time": 1775969819, - "ack_time": 0, - "close_time": 0, - "creator_id": 0, - "closer_id": 0, - "owner_id": 0, - "incident_status": "Critical", - "incident_severity": "Critical", - "progress": "Triggered", - "title": "CPU usage high - web-server-01", - "description": "", - "ai_summary": "", - "impact": "", - "root_cause": "", - "resolution": "", - "num": "0E83EE", - "frequency": "frequent", - "created_at": 1775912222, - "updated_at": 1775972145, - "snoozed_before": 0, - "group_method": "n", - "ever_muted": false, - "labels": { - "check": "cpu_usage_high", - "resource": "web-server-01", - "env": "production" - }, - "fields": {}, - "assigned_to": { - "person_ids": [ - 2476444212131 - ], - "escalate_rule_id": "000000000000000000000000", - "layer_idx": 0, - "type": "assign", - "assigned_at": 1775972128, - "id": "MvQfH9Dc8eNS8k79jmrWn6", - "escalate_rule_name": "" - }, - "alert_cnt": 1, - "active_alert_cnt": 1, - "alert_event_cnt": 17, - "responders": [ - { - "person_id": 2476444212131, - "assigned_at": 1775972128, - "acknowledged_at": 0 - } - ], - "account_name": "", - "account_locale": "", - "account_time_zone": "", - "channel_name": "Ops Channel", - "channel_status": "enabled", - "detail_url": "https://app.flashcat.cloud/incident/detail/69da451ef77b1b51f40e83ee", - "silence_url": "https://app.flashcat.cloud/channel/detail/2551105804131?tab=alertSuppression&fromIncidentId=69da451ef77b1b51f40e83ee", - "integration_type": "monit.alert", - "post_mortem_id": "", - "images": null, - "manual_overrides": [ - "title" - ] - } - ] + "account_id": 1001, + "account_name": "acme", + "domain": "acme", + "extra_domains": [ + "acme-corp" + ], + "phone": "138****8000", + "country_code": "86", + "email": "ops@acme.example", + "avatar": "https://cdn.flashcat.cloud/avatar/acme.png", + "locale": "zh-CN", + "time_zone": "Asia/Shanghai", + "created_at": 1716960000, + "restrictions": { + "ips": [ + "203.0.113.0/24" + ], + "email_domains": [ + "acme.example" + ], + "allow_subdomain": true + } } } } @@ -271,45 +192,30 @@ "$ref": "#/components/responses/TooManyRequests" }, "500": { - "$ref": "#/components/responses/ServerError" + "$ref": "#/components/responses/InternalError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListIncidentsRequest" - }, - "example": { - "start_time": 1711900800, - "end_time": 1712000000, - "progress": "Triggered,Processing", - "incident_severity": "Critical,Warning", - "channel_ids": [ - 2551105804131 - ], - "limit": 20, - "p": 1 - } - } - } + "x-mint": { + "metadata": { + "sidebarTitle": "Get account detail" + }, + "content": "| Permission | Description |\n| --- | --- |\n| None | None — any valid app_key can call this operation. |\n\nFind this operation in the [Platform API reference](/en/api-reference/platform/account/account-read-info)." } } }, - "/incident/info": { + "/alert-event/list": { "post": { - "operationId": "incidentInfo", - "summary": "Get incident detail", - "description": "Retrieve detailed information for a single incident including timeline, alerts, responders and custom fields.", + "operationId": "alert-event-read-list", + "summary": "List raw alert events", + "description": "Return a cursor-paginated list of raw alert events across all alerts, with filtering by integration, channel, time range, and severity.", "tags": [ - "On-call/Incidents" + "On-call/Alerts" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- Results are filtered by the caller's channel data-access permissions.\n- `severities` is a comma-separated string, e.g. `\"Critical,Warning\"`.", + "href": "/en/api-reference/on-call/alerts/alert-event-read-list", "metadata": { - "sidebarTitle": "Get incident detail" + "sidebarTitle": "List raw alert events" } }, "responses": { @@ -326,7 +232,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/IncidentInfo" + "$ref": "#/components/schemas/AlertEventGlobalListResponse" } } } @@ -335,81 +241,16 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "incident_id": "69da451ef77b1b51f40e83ee", - "account_id": 2451002751131, - "channel_id": 2551105804131, - "integration_id": 2490562293131, - "integration_ids": [ - 2490562293131 - ], - "integration_types": [ - "monit.alert" - ], - "dedup_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", - "equals_md5": "", - "start_time": 1775912219, - "end_time": 0, - "last_time": 1775969819, - "ack_time": 0, - "close_time": 0, - "creator_id": 0, - "closer_id": 0, - "owner_id": 0, - "incident_status": "Critical", - "incident_severity": "Critical", - "progress": "Triggered", - "title": "CPU usage high - web-server-01", - "description": "", - "ai_summary": "", - "impact": "", - "root_cause": "", - "resolution": "", - "num": "0E83EE", - "frequency": "frequent", - "created_at": 1775912222, - "updated_at": 1775972145, - "snoozed_before": 0, - "group_method": "n", - "ever_muted": false, - "labels": { - "check": "cpu_usage_high", - "resource": "web-server-01", - "env": "production" - }, - "fields": {}, - "assigned_to": { - "person_ids": [ - 2476444212131 - ], - "escalate_rule_id": "000000000000000000000000", - "layer_idx": 0, - "type": "assign", - "assigned_at": 1775972128, - "id": "MvQfH9Dc8eNS8k79jmrWn6", - "escalate_rule_name": "" - }, - "alert_cnt": 1, - "active_alert_cnt": 1, - "alert_event_cnt": 17, - "responders": [ + "total": 1, + "has_next_page": false, + "items": [ { - "person_id": 2476444212131, - "assigned_at": 1775972128, - "acknowledged_at": 0 + "event_id": "663a1b2c3d4e5f6789abc001", + "alert_id": "663a1b2c3d4e5f6789abcdef", + "title": "CPU usage > 90%", + "event_severity": "Critical", + "event_time": 1712650000 } - ], - "account_name": "", - "account_locale": "", - "account_time_zone": "", - "channel_name": "Ops Channel", - "channel_status": "enabled", - "detail_url": "https://app.flashcat.cloud/incident/detail/69da451ef77b1b51f40e83ee", - "silence_url": "https://app.flashcat.cloud/channel/detail/2551105804131?tab=alertSuppression&fromIncidentId=69da451ef77b1b51f40e83ee", - "integration_type": "monit.alert", - "post_mortem_id": "", - "images": null, - "manual_overrides": [ - "title" ] } } @@ -434,29 +275,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IncidentInfoRequest" + "$ref": "#/components/schemas/AlertEventGlobalListRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee" + "start_time": 1712620800, + "end_time": 1712707200, + "limit": 20, + "severities": "Critical" } } } } } }, - "/incident/list-by-ids": { + "/alert/event/list": { "post": { - "operationId": "incidentListByIds", - "summary": "List incidents by IDs", - "description": "Retrieve multiple incidents by their IDs in a single request.", + "operationId": "alert-read-event-list", + "summary": "List events for an alert", + "description": "Return all raw events that have been ingested into a specific alert, in chronological order.", "tags": [ - "On-call/Incidents" + "On-call/Alerts" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-list-by-ids", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- Each alert accumulates raw events from the integration. This endpoint exposes the raw event history for a given alert.", + "href": "/en/api-reference/on-call/alerts/alert-read-event-list", "metadata": { - "sidebarTitle": "List incidents by IDs" + "sidebarTitle": "List events for an alert" } }, "responses": { @@ -473,7 +317,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/IncidentListResponse" + "$ref": "#/components/schemas/AlertEventListResponse" } } } @@ -482,71 +326,17 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 2, - "has_next_page": false, "items": [ { - "incident_id": "69da451ef77b1b51f40e83ee", - "account_id": 2451002751131, - "channel_id": 2551105804131, - "integration_id": 2490562293131, - "integration_ids": [ - 2490562293131 - ], - "integration_types": [ - "monit.alert" - ], - "dedup_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", - "equals_md5": "", - "start_time": 1775912219, - "end_time": 0, - "last_time": 1775969819, - "ack_time": 0, - "close_time": 0, - "creator_id": 0, - "closer_id": 0, - "owner_id": 0, - "incident_status": "Critical", - "incident_severity": "Critical", - "progress": "Triggered", - "title": "CPU usage high - web-server-01", - "description": "", - "ai_summary": "", - "impact": "", - "root_cause": "", - "resolution": "", - "num": "0E83EE", - "frequency": "frequent", - "created_at": 1775912222, - "updated_at": 1775972145, - "snoozed_before": 0, - "group_method": "n", - "ever_muted": false, - "labels": {}, - "fields": {}, - "assigned_to": { - "escalate_rule_id": "000000000000000000000000", - "layer_idx": 0, - "type": "", - "assigned_at": 0, - "id": "", - "escalate_rule_name": "" - }, - "alert_cnt": 1, - "active_alert_cnt": 1, - "alert_event_cnt": 17, - "responders": [], - "account_name": "", - "account_locale": "", - "account_time_zone": "", - "channel_name": "Ops Channel", - "channel_status": "enabled", - "detail_url": "https://app.flashcat.cloud/incident/detail/69da451ef77b1b51f40e83ee", - "silence_url": "https://app.flashcat.cloud/channel/detail/2551105804131?tab=alertSuppression&fromIncidentId=69da451ef77b1b51f40e83ee", - "integration_type": "monit.alert", - "post_mortem_id": "", - "images": null, - "manual_overrides": null + "event_id": "663a1b2c3d4e5f6789abc001", + "alert_id": "663a1b2c3d4e5f6789abcdef", + "title": "CPU usage > 90%", + "event_severity": "Critical", + "event_status": "Critical", + "event_time": 1712650000, + "labels": { + "host": "web-01" + } } ] } @@ -572,32 +362,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListIncidentsByIdsRequest" + "$ref": "#/components/schemas/AlertEventListRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee", - "69da451ef77b1b51f40e83ef" - ] + "alert_id": "663a1b2c3d4e5f6789abcdef" } } } } } }, - "/incident/alert/list": { + "/alert/feed": { "post": { - "operationId": "incidentAlertList", - "summary": "List alerts of incident", - "description": "List all alerts merged into a specific incident.", + "operationId": "alert-read-feed", + "summary": "List alert activity feed", + "description": "Return the activity feed (comments, state changes, merges, silence events) for a single alert, with page-based pagination.", "tags": [ - "On-call/Incidents" + "On-call/Alerts" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-alert-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- Use `p` (page number, starting at 1) and `limit` (max 100, default 20) for pagination.\n- Set `asc` to `true` for chronological order.\n- Use `types` to filter by specific feed types (e.g. `alert_comment`, `alert_merge`).", + "href": "/en/api-reference/on-call/alerts/alert-read-feed", "metadata": { - "sidebarTitle": "List alerts of incident" + "sidebarTitle": "List alert activity feed" } }, "responses": { @@ -614,7 +401,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListIncidentAlertsResponse" + "$ref": "#/components/schemas/AlertFeedResponse" } } } @@ -623,47 +410,16 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 1, + "has_next_page": false, "items": [ { - "alert_id": "69da451df77b1b51f40e83de", - "integration_id": 2490562293131, - "data_source_id": 2490562293131, - "channel_id": 2551105804131, - "account_id": 2451002751131, - "description": "", - "title": "CPU usage high - web-server-01", - "title_rule": "", - "alert_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", - "alert_severity": "Critical", - "alert_status": "Critical", - "start_time": 1775912219, - "last_time": 1775969819, - "end_time": 0, - "labels": { - "check": "cpu_usage_high", - "resource": "web-server-01" - }, - "ever_muted": false, - "created_at": 1775912221, - "updated_at": 1775969821, - "integration_name": "FlashMonit", - "integration_type": "monit.alert", - "integration_ref_id": "a_2451002751131", - "channel_name": "Ops Channel", - "channel_status": "enabled", - "responder_name": "", - "responder_email": "", - "incident": { - "incident_id": "69da451ef77b1b51f40e83ee", - "title": "CPU usage high - web-server-01", - "progress": "Triggered" + "ref_id": "663a1b2c3d4e5f6789abcdef", + "type": "alert_comment", + "detail": { + "comment": "Investigating now." }, - "event_cnt": 17, - "images": null, - "data_source_name": "FlashMonit", - "data_source_type": "monit.alert", - "data_source_ref_id": "a_2451002751131" + "creator_id": 80011, + "created_at": 1712651000 } ] } @@ -689,32 +445,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListIncidentAlertsRequest" + "$ref": "#/components/schemas/AlertFeedRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "is_active": true, - "limit": 100, - "p": 1 + "alert_id": "663a1b2c3d4e5f6789abcdef", + "limit": 20, + "asc": false } } } } } }, - "/incident/feed": { + "/alert/info": { "post": { - "operationId": "incidentFeed", - "summary": "Get incident timeline", - "description": "Retrieve the timeline feed for a specific incident, including state changes, comments and system events.", + "operationId": "alert-read-info", + "summary": "Get alert detail", + "description": "Return the full details of a single alert by its ID, including its associated incident and event count.", "tags": [ - "On-call/Incidents" + "On-call/Alerts" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-feed", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- `alert_id` is an ObjectID hex string returned by `POST /alert/list` or `POST /alert-event/list`.", + "href": "/en/api-reference/on-call/alerts/alert-read-info", "metadata": { - "sidebarTitle": "Get incident timeline" + "sidebarTitle": "Get alert detail" } }, "responses": { @@ -731,7 +486,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListIncidentFeedResponse" + "$ref": "#/components/schemas/AlertItem" } } } @@ -740,42 +495,12 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "has_next_page": true, - "items": [ - { - "ref_id": "69da451ef77b1b51f40e83ee", - "type": "i_new", - "detail": { - "severity": "Critical", - "title": "CPU usage high - web-server-01" - }, - "account_id": 2451002751131, - "creator_id": 0, - "created_at": 1775912222661, - "updated_at": 1775912222661 - }, - { - "ref_id": "69da451ef77b1b51f40e83ee", - "type": "i_notify", - "detail": { - "rid": "5e9ccfabcd154b41a0005fd0f52b674b", - "msg_id": "naFudJYCawBWsChdV6ErPH", - "fire_type": "fire", - "escalate_rule_id": "000000000000000000000000", - "layer_idx": 0, - "by": "email", - "persons": [ - { - "person_id": 2476444212131 - } - ] - }, - "account_id": 2451002751131, - "creator_id": 0, - "created_at": 1775972130174, - "updated_at": 1775972130174 - } - ] + "alert_id": "663a1b2c3d4e5f6789abcdef", + "title": "CPU usage > 90%", + "alert_severity": "Critical", + "alert_status": "Critical", + "start_time": 1712650000, + "event_cnt": 3 } } } @@ -799,31 +524,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListIncidentFeedRequest" + "$ref": "#/components/schemas/AlertInfoRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "p": 1, - "limit": 20 + "alert_id": "663a1b2c3d4e5f6789abcdef" } } } } } }, - "/incident/past/list": { + "/alert/list": { "post": { - "operationId": "incidentPastList", - "summary": "List past incidents", - "description": "List historical incidents related to the current incident for reference during triage.", + "operationId": "alert-read-list", + "summary": "List alerts", + "description": "Return a cursor-paginated list of alerts matching the given filters.", "tags": [ - "On-call/Incidents" + "On-call/Alerts" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **100 requests/minute**; **20 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-past-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- Both `start_time` and `end_time` are required Unix epoch seconds. Maximum span is 31 days.\n- Use `search_after_ctx` from the previous response to fetch the next page.\n- Results are filtered by the caller's channel data-access permissions.\n- Set `is_active` to `true` to retrieve only active (firing) alerts; `false` to retrieve resolved alerts.", + "href": "/en/api-reference/on-call/alerts/alert-read-list", "metadata": { - "sidebarTitle": "List past incidents" + "sidebarTitle": "List alerts" } }, "responses": { @@ -840,7 +563,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListPastIncidentsResponse" + "$ref": "#/components/schemas/AlertListResponse" } } } @@ -849,7 +572,33 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [] + "total": 1, + "has_next_page": false, + "search_after_ctx": "", + "items": [ + { + "alert_id": "663a1b2c3d4e5f6789abcdef", + "integration_id": 10001, + "channel_id": 20001, + "account_id": 10023, + "title": "CPU usage > 90%", + "alert_severity": "Critical", + "alert_status": "Critical", + "start_time": 1712650000, + "last_time": 1712655000, + "end_time": 0, + "labels": { + "host": "web-01" + }, + "ever_muted": false, + "created_at": 1712650000, + "updated_at": 1712655000, + "integration_name": "Prometheus", + "integration_type": "prometheus", + "channel_name": "Production", + "event_cnt": 3 + } + ] } } } @@ -873,30 +622,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListPastIncidentsRequest" + "$ref": "#/components/schemas/AlertListRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "limit": 5 + "start_time": 1712620800, + "end_time": 1712707200, + "limit": 20, + "is_active": true } } } } } }, - "/incident/create": { + "/alert/list-by-ids": { "post": { - "operationId": "incidentCreate", - "summary": "Create incident", - "description": "Manually create a new incident and assign responders.", + "operationId": "alert-read-list-by-ids", + "summary": "List alerts by IDs", + "description": "Return the details of multiple alerts by their IDs in a single request.", "tags": [ - "On-call/Incidents" + "On-call/Alerts" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- All provided `alert_ids` must belong to the caller's account; any invalid ID causes the entire request to fail.", + "href": "/en/api-reference/on-call/alerts/alert-read-list-by-ids", "metadata": { - "sidebarTitle": "Create incident" + "sidebarTitle": "List alerts by IDs" } }, "responses": { @@ -913,7 +664,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CreateIncidentResponse" + "$ref": "#/components/schemas/AlertListResponse" } } } @@ -922,8 +673,14 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "incident_id": "69db2ef1a0fe7db6448b14f1", - "title": "API test incident for docs" + "total": 1, + "has_next_page": false, + "items": [ + { + "alert_id": "663a1b2c3d4e5f6789abcdef", + "title": "CPU usage > 90%" + } + ] } } } @@ -947,36 +704,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateIncidentRequest" + "$ref": "#/components/schemas/AlertListByIDsRequest" }, "example": { - "incident_severity": "Critical", - "title": "Database connection timeout on prod-db-01", - "channel_id": 2551105804131, - "assigned_to": { - "person_ids": [ - 2476444212131 - ] - } + "alert_ids": [ + "663a1b2c3d4e5f6789abcdef" + ] } } } } } }, - "/incident/ack": { + "/alert/merge": { "post": { - "operationId": "incidentAck", - "summary": "Acknowledge incident", - "description": "Acknowledge an incident to indicate you are actively working on it.", + "operationId": "alert-write-merge", + "summary": "Merge alerts into an incident", + "description": "Associate one or more alerts with an existing incident. If a source alert previously belonged to a different incident and that incident becomes empty after the merge, it will be automatically closed.", "tags": [ - "On-call/Incidents" + "On-call/Alerts" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-ack", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- All `alert_ids` and the `incident_id` must belong to the caller's account.\n- Optionally set `title` and `owner_id` to update the target incident at the same time.", + "href": "/en/api-reference/on-call/alerts/alert-write-merge", "metadata": { - "sidebarTitle": "Acknowledge incident" + "sidebarTitle": "Merge alerts into an incident" } }, "responses": { @@ -1024,31 +776,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AckIncidentRequest" + "$ref": "#/components/schemas/AlertMergeRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ] + "alert_ids": [ + "663a1b2c3d4e5f6789abcdef" + ], + "incident_id": "663a000000000000deadbeef" } } } } } }, - "/incident/unack": { + "/alert/pipeline/info": { "post": { - "operationId": "incidentUnack", - "summary": "Unacknowledge incident", - "description": "Remove the acknowledge status from an incident.", + "operationId": "alert-read-pipeline-info", + "summary": "Get alert pipeline", + "description": "Return the alert processing pipeline configured for a specific integration.", "tags": [ - "On-call/Incidents" + "On-call/Alerts" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-unack", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) |\n\n## Usage\n\n- Returns `null` data if no pipeline has been configured for the given integration.\n- Requires the caller to have access to the integration.", + "href": "/en/api-reference/on-call/alerts/alert-read-pipeline-info", "metadata": { - "sidebarTitle": "Unacknowledge incident" + "sidebarTitle": "Get alert pipeline" } }, "responses": { @@ -1065,7 +818,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/AlertPipelineItem" } } } @@ -1073,7 +826,23 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "integration_id": 10001, + "rules": [ + { + "kind": "severity_reset", + "if": null, + "settings": { + "severity": "Warning" + } + } + ], + "status": "enabled", + "creator_id": 80011, + "updated_by": 80011, + "created_at": 1710000000, + "updated_at": 1712000000 + } } } } @@ -1096,31 +865,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UnackIncidentRequest" + "$ref": "#/components/schemas/AlertPipelineInfoRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ] + "integration_id": 10001 } } } } } }, - "/incident/resolve": { + "/alert/pipeline/list": { "post": { - "operationId": "incidentResolve", - "summary": "Resolve incident", - "description": "Mark an incident as resolved.", + "operationId": "alert-read-pipeline-list", + "summary": "List alert pipelines", + "description": "Return the alert processing pipelines configured for multiple integrations.", "tags": [ - "On-call/Incidents" + "On-call/Alerts" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-resolve", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) |\n\n## Usage\n\n- All `integration_ids` must be accessible to the caller.", + "href": "/en/api-reference/on-call/alerts/alert-read-pipeline-list", "metadata": { - "sidebarTitle": "Resolve incident" + "sidebarTitle": "List alert pipelines" } }, "responses": { @@ -1137,7 +904,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/AlertPipelineListResponse" } } } @@ -1145,7 +912,19 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "integration_id": 10001, + "rules": [], + "status": "enabled", + "creator_id": 80011, + "updated_by": 80011, + "created_at": 1710000000, + "updated_at": 1712000000 + } + ] + } } } } @@ -1168,33 +947,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResolveIncidentRequest" + "$ref": "#/components/schemas/AlertPipelineListRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ], - "root_cause": "Memory leak in the connection pool caused by a missing cleanup call.", - "resolution": "Deployed hotfix v2.3.1 and restarted the affected service." + "integration_ids": [ + 10001, + 10002 + ] } } } } } }, - "/incident/reopen": { + "/alert/pipeline/upsert": { "post": { - "operationId": "incidentReopen", - "summary": "Reopen incident", - "description": "Reopen a previously resolved incident.", + "operationId": "alert-write-pipeline-upsert", + "summary": "Create or update alert pipeline", + "description": "Set the alert processing pipeline for an integration. Replaces the existing configuration entirely.", "tags": [ - "On-call/Incidents" + "On-call/Alerts" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-reopen", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Manage** (`on-call`) |\n\n## Usage\n\n- Maximum 50 rules per pipeline.\n- Each rule has a `kind` (one of `title_reset`, `description_reset`, `severity_reset`, `alert_drop`, `alert_inhibit`), an optional `if` filter, and `settings` specific to the kind.\n- The `alert_inhibit` kind requires the Standard license or higher.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/alerts/alert-write-pipeline-upsert", "metadata": { - "sidebarTitle": "Reopen incident" + "sidebarTitle": "Create or update alert pipeline" } }, "responses": { @@ -1242,32 +1020,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReopenIncidentRequest" + "$ref": "#/components/schemas/AlertPipelineUpsertRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ], - "reason": "Monitoring detected the issue recurred after the initial fix." + "integration_id": 10001, + "rules": [ + { + "kind": "severity_reset", + "if": null, + "settings": { + "severity": "Warning" + } + } + ] } } } } } }, - "/incident/snooze": { + "/audit/operation/list": { "post": { - "operationId": "incidentSnooze", - "summary": "Snooze incident", - "description": "Temporarily snooze notifications for an incident until a specified time.", + "operationId": "audit-read-operation-list", + "summary": "List auditable operation types", + "description": "Return all operation names that are recorded in the audit log, for use as `operations` filter values.", "tags": [ - "On-call/Incidents" + "Platform/Audit logs" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-snooze", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Audit Read** (`organization`) |\n\n## Usage\n\n- Use the `name` values from this response as `operations` filter values in `POST /audit/search`.\n- `name_cn` is the human-readable Chinese label shown in the console; `name` is the stable wire value to filter on.", + "href": "/en/api-reference/platform/audit-logs/audit-read-operation-list", "metadata": { - "sidebarTitle": "Snooze incident" + "sidebarTitle": "List auditable operation types" } }, "responses": { @@ -1284,7 +1068,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/AuditOperationListResponse" } } } @@ -1292,7 +1076,22 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "name": "template:write:create", + "name_cn": "创建模板" + }, + { + "name": "template:write:delete", + "name_cn": "删除模板" + }, + { + "name": "incident:write:acknowledge", + "name_cn": "认领故障" + } + ] + } } } } @@ -1315,32 +1114,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SnoozeIncidentRequest" + "$ref": "#/components/schemas/AuditOperationListRequest" }, - "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ], - "minutes": 60 - } + "example": {} } } } } }, - "/incident/wake": { + "/audit/search": { "post": { - "operationId": "incidentWake", - "summary": "Wake incident", - "description": "Cancel the snooze on an incident and resume notifications.", + "operationId": "audit-read-search", + "summary": "Search audit logs", + "description": "Return a cursor-paginated list of audit log entries within a time range.", "tags": [ - "On-call/Incidents" + "Platform/Audit logs" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-wake", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Audit Read** (`organization`) |\n\n## Usage\n\n- Time range is required. Maximum span is 90 days. Both `start_time` and `end_time` are Unix epoch **seconds**.\n- Use `search_after_ctx` from the previous response to fetch the next page. The token is opaque — do not construct it manually.\n- The retention window depends on the account's license. Queries beyond the retention boundary silently return an empty result rather than an error.\n- Default page size is 20 rows; maximum is 99.", + "href": "/en/api-reference/platform/audit-logs/audit-read-search", "metadata": { - "sidebarTitle": "Wake incident" + "sidebarTitle": "Search audit logs" } }, "responses": { @@ -1357,7 +1151,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/AuditSearchResponse" } } } @@ -1365,7 +1159,26 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "total": 2, + "search_after_ctx": "", + "docs": [ + { + "created_at": 1712700123456, + "account_id": 10023, + "member_id": 80011, + "member_name": "Alice", + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "ip": "203.0.113.42", + "operation": "template:write:create", + "operation_name": "创建模板", + "body": "{\"template_name\":\"Prod default\"}", + "params": [], + "is_dangerous": false, + "is_write": true + } + ] + } } } } @@ -1388,11 +1201,15 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WakeIncidentRequest" + "$ref": "#/components/schemas/AuditSearchRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" + "start_time": 1712620800, + "end_time": 1712707200, + "limit": 20, + "operations": [ + "template:write:create", + "template:write:delete" ] } } @@ -1400,19 +1217,19 @@ } } }, - "/incident/merge": { + "/calendar/create": { "post": { - "operationId": "incidentMerge", - "summary": "Merge incidents", - "description": "Merge one or more incidents into a target incident.", + "operationId": "calendarCreate", + "summary": "Create calendar", + "description": "Create a personal service calendar. Each account is limited to 5 calendars unless the Flashcat-Break-Cal-Limit header is set.", "tags": [ - "On-call/Incidents" + "On-call/Calendars" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-merge", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Calendars Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/calendars/calendar-create", "metadata": { - "sidebarTitle": "Merge incidents" + "sidebarTitle": "Create calendar" } }, "responses": { @@ -1429,7 +1246,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalendarCreateResponse" } } } @@ -1437,7 +1254,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "cal_name": "API Test Calendar" + } } } } @@ -1460,34 +1280,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MergeIncidentsRequest" + "$ref": "#/components/schemas/CalendarCreateRequest" }, "example": { - "source_incident_ids": [ - "69da451ef77b1b51f40e83ef", - "69da451ef77b1b51f40e83f0" - ], - "target_incident_id": "69da451ef77b1b51f40e83ee", - "comment": "Merging related database connectivity incidents into one." + "cal_name": "Production On-Call Calendar", + "description": "Calendar for production on-call team", + "timezone": "Asia/Shanghai", + "workdays": [ + 1, + 2, + 3, + 4, + 5 + ] } } } } } }, - "/incident/disable-merge": { + "/calendar/delete": { "post": { - "operationId": "incidentDisableMerge", - "summary": "Disable incident merge", - "description": "Disable automatic merging for a specific incident.", + "operationId": "calendarDelete", + "summary": "Delete calendar", + "description": "Delete a personal service calendar. The call fails when referenced by escalation or silence rules.", "tags": [ - "On-call/Incidents" + "On-call/Calendars" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-disable-merge", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Calendars Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/calendars/calendar-delete", "metadata": { - "sidebarTitle": "Disable incident merge" + "sidebarTitle": "Delete calendar" } }, "responses": { @@ -1504,7 +1328,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalendarEmptyObject" } } } @@ -1535,31 +1359,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DisableIncidentMergeRequest" + "$ref": "#/components/schemas/CalendarIDRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ] + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM" } } } } } }, - "/incident/reset": { + "/calendar/event/delete": { "post": { - "operationId": "incidentReset", - "summary": "Update incident fields", - "description": "Update one or more editable fields of an incident in a single call, including title, description, impact, root cause, resolution, and severity. At least one field must be provided.", + "operationId": "calEventDelete", + "summary": "Delete calendar event", + "description": "Delete a calendar event by calendar ID and event ID.", "tags": [ - "On-call/Incidents" + "On-call/Calendars" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-reset", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Calendars Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/calendars/cal-event-delete", "metadata": { - "sidebarTitle": "Update incident fields" + "sidebarTitle": "Delete calendar event" } }, "responses": { @@ -1576,7 +1398,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalendarEmptyObject" } } } @@ -1607,31 +1429,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateIncidentFieldsRequest" + "$ref": "#/components/schemas/CalEventIDRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "title": "Database connection timeout - prod-db-01 primary", - "incident_severity": "Critical" + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "event_id": "cale.KyG9XWTCU5CucbwukEVBQ4" } } } } } }, - "/incident/remove": { + "/calendar/event/list": { "post": { - "operationId": "incidentRemove", - "summary": "Delete an incident", - "description": "Permanently delete an incident and all associated data.", + "operationId": "calEventList", + "summary": "List calendar events", + "description": "Return events for a personal calendar within a year/month/day scope. When month and day are both omitted the whole year is returned.", "tags": [ - "On-call/Incidents" + "On-call/Calendars" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-remove", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/calendars/cal-event-list", "metadata": { - "sidebarTitle": "Delete an incident" + "sidebarTitle": "List calendar events" } }, "responses": { @@ -1648,7 +1469,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalEventListResponse" } } } @@ -1656,7 +1477,37 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "account_id": 2451002751131, + "creator_id": 2476444212131, + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "event_id": "cale.KyG9XWTCU5CucbwukEVBQ4", + "summary": "Test Holiday", + "description": "A test holiday event", + "start_at": "2026-05-01", + "end_at": "2026-05-02", + "is_off": true, + "created_at": 1775972034, + "updated_at": 1775972034 + }, + { + "account_id": 2451002751131, + "creator_id": 2451002751131, + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "event_id": "non_work.20260502", + "summary": "non-working day (Saturday)", + "description": "", + "start_at": "2026-05-02", + "end_at": "2026-05-03", + "is_off": true, + "created_at": 0, + "updated_at": 0 + } + ], + "total": 11 + } } } } @@ -1679,31 +1530,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RemoveIncidentRequest" + "$ref": "#/components/schemas/CalEventListRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ] + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "year": 2024, + "month": 5 } } } } } }, - "/incident/comment": { + "/calendar/event/upsert": { "post": { - "operationId": "incidentComment", - "summary": "Add comment to incident", - "description": "Add a text comment to the incident timeline.", + "operationId": "calEventUpsert", + "summary": "Upsert calendar event", + "description": "Create or update a calendar event (holiday or workday override). Omit event_id to create a new event.", "tags": [ - "On-call/Incidents" + "On-call/Calendars" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-comment", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Calendars Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/calendars/cal-event-upsert", "metadata": { - "sidebarTitle": "Add comment to incident" + "sidebarTitle": "Upsert calendar event" } }, "responses": { @@ -1720,7 +1571,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalEventUpsertResponse" } } } @@ -1728,7 +1579,11 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "event_id": "cale.KyG9XWTCU5CucbwukEVBQ4", + "summary": "Test Holiday" + } } } } @@ -1751,32 +1606,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CommentIncidentRequest" + "$ref": "#/components/schemas/CalEventUpsertRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ], - "comment": "Identified the root cause. Rolling back the deployment now." - } - } - } - } - } + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "summary": "Labour Day", + "start_at": "2024-05-01", + "end_at": "2024-05-06", + "is_off": true, + "description": "International Workers Day holiday" + } + } + } + } + } }, - "/incident/assign": { + "/calendar/info": { "post": { - "operationId": "incidentAssign", - "summary": "Assign incident", - "description": "Dispatch an incident to a specific escalation level or responder.", + "operationId": "calendarInfo", + "summary": "Get calendar info", + "description": "Return details of a service calendar.", "tags": [ - "On-call/Incidents" + "On-call/Calendars" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-assign", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/calendars/calendar-info", "metadata": { - "sidebarTitle": "Assign incident" + "sidebarTitle": "Get calendar info" } }, "responses": { @@ -1793,7 +1650,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalendarItem" } } } @@ -1801,7 +1658,29 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "account_id": 2451002751131, + "team_id": 2477033058131, + "cal_id": "cal.eh9gvPtWeH3xXgKeVSRxRg", + "cal_name": "Stock Exchange Calendar", + "description": "A stock market trading calendar example", + "timezone": "Asia/Shanghai", + "kind": "personal", + "workdays": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "created_at": 1702455630, + "updated_at": 1775529526, + "creator_id": 2476444212131, + "updated_by": 3790925372131, + "status": "enabled" + } } } } @@ -1824,35 +1703,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AssignIncidentRequest" + "$ref": "#/components/schemas/CalendarIDRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "assigned_to": { - "person_ids": [ - 2476444212131 - ], - "type": "assign" - } + "cal_id": "cal.eh9gvPtWeH3xXgKeVSRxRg" } } } } } }, - "/incident/responder/add": { + "/calendar/list": { "post": { - "operationId": "incidentResponderAdd", - "summary": "Add incident responder", - "description": "Add a responder to an existing incident.", + "operationId": "calendarList", + "summary": "List calendars", + "description": "Return the list of service calendars visible to the current account.", "tags": [ - "On-call/Incidents" + "On-call/Calendars" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-responder-add", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/calendars/calendar-list", "metadata": { - "sidebarTitle": "Add incident responder" + "sidebarTitle": "List calendars" } }, "responses": { @@ -1869,7 +1742,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalendarListResponse" } } } @@ -1877,7 +1750,51 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "account_id": 2451002751131, + "team_id": 2477033058131, + "cal_id": "cal.eh9gvPtWeH3xXgKeVSRxRg", + "cal_name": "Stock Exchange Calendar", + "description": "A stock market trading calendar example", + "timezone": "Asia/Shanghai", + "kind": "personal", + "workdays": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "created_at": 1702455630, + "updated_at": 1775529526, + "creator_id": 2476444212131, + "updated_by": 3790925372131, + "status": "enabled" + }, + { + "account_id": 2451002751131, + "team_id": 0, + "cal_id": "cal.VZYkchxJhGELSF4jzkUAud", + "cal_name": "HK Stock Exchange Calendar", + "description": "Hong Kong Stock Exchange trading days calendar", + "timezone": "Asia/Shanghai", + "kind": "personal", + "extra_cal_ids": [ + "zh-cn.china.official" + ], + "created_at": 1702968470, + "updated_at": 1775188967, + "creator_id": 2451002751131, + "updated_by": 3790925372131, + "status": "enabled" + } + ], + "total": 8 + } } } } @@ -1900,33 +1817,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AddIncidentResponderRequest" + "$ref": "#/components/schemas/CalendarListRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "person_ids": [ - 2476444212131, - 2476444212132 - ] + "kind": "personal" } } } } } }, - "/incident/field/reset": { + "/calendar/update": { "post": { - "operationId": "incidentFieldReset", - "summary": "Update incident custom field", - "description": "Update a custom field value on an incident.", + "operationId": "calendarUpdate", + "summary": "Update calendar", + "description": "Update a personal service calendar. Only non-null fields are updated.", "tags": [ - "On-call/Incidents" + "On-call/Calendars" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-field-reset", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Calendars Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/calendars/calendar-update", "metadata": { - "sidebarTitle": "Update incident custom field" + "sidebarTitle": "Update calendar" } }, "responses": { @@ -1943,7 +1856,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalendarEmptyObject" } } } @@ -1974,31 +1887,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResetIncidentFieldRequest" + "$ref": "#/components/schemas/CalendarUpdateRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "field_name": "affected_service", - "field_value": "payment-service" + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "cal_name": "Production On-Call Calendar (Updated)", + "timezone": "America/New_York", + "workdays": [ + 1, + 2, + 3, + 4, + 5 + ] } } } } } }, - "/incident/custom-action/do": { + "/change/list": { "post": { - "operationId": "incidentCustomActionDo", - "summary": "Execute custom action", - "description": "Execute a custom action configured for an incident.", + "operationId": "change-read-list", + "summary": "List changes", + "description": "Query change records within a time window, with filtering, search, and pagination.", "tags": [ - "On-call/Incidents" + "On-call/Changes" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-custom-action-do", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", + "href": "/en/api-reference/on-call/changes/change-read-list", "metadata": { - "sidebarTitle": "Execute custom action" + "sidebarTitle": "List changes" } }, "responses": { @@ -2015,7 +1935,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DoIncidentCustomActionResponse" + "$ref": "#/components/schemas/ListChangeResponse" } } } @@ -2024,7 +1944,31 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "message": "" + "total": 1, + "has_next_page": false, + "items": [ + { + "change_id": "664a1b2c3d4e5f6a7b8c9d0e", + "account_id": 10001, + "channel_id": 5001, + "channel_name": "Production", + "channel_status": "active", + "integration_id": 362, + "integration_name": "GitHub Deploy", + "title": "Deploy api-server v2.3.1", + "description": "Rolling deploy to production cluster", + "change_key": "deploy-api-server-2311", + "change_status": "Done", + "start_time": 1716962400, + "last_time": 1716962700, + "end_time": 1716963000, + "labels": { + "service": "api-server", + "env": "prod" + }, + "link": "https://github.com/acme/api-server/actions/runs/123" + } + ] } } } @@ -2048,30 +1992,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DoIncidentCustomActionRequest" + "$ref": "#/components/schemas/ListChangeRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "integration_id": 2490562293131 + "start_time": 1716960000, + "end_time": 1717046400, + "p": 1, + "limit": 10, + "integration_ids": [ + 362 + ], + "orderby": "start_time", + "asc": false, + "include_events": false } } } } } }, - "/incident/war-room/detail": { + "/channel/create": { "post": { - "operationId": "incidentWarRoomDetail", - "summary": "Get war room detail", - "description": "Retrieve the war room configuration and members for an incident.", + "operationId": "channelCreate", + "summary": "Create channel", + "description": "Create a new channel for incident management.", "tags": [ - "On-call/Incidents" + "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-war-room-detail", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-create", "metadata": { - "sidebarTitle": "Get war room detail" + "sidebarTitle": "Create channel" } }, "responses": { @@ -2088,7 +2040,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/WarRoom" + "$ref": "#/components/schemas/ChannelCreateResponse" } } } @@ -2097,9 +2049,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "chat_id": "oc_a0553eda9014c2de1b3a8f75b4e0c000", - "chat_name": "Incident #0E83EE war room", - "share_link": "" + "channel_id": 6294542005131, + "channel_name": "API Test Channel" } } } @@ -2123,30 +2074,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetWarRoomDetailRequest" + "$ref": "#/components/schemas/CreateChannelRequest" }, "example": { - "integration_id": 2490562293131, - "chat_id": "oc_a0553eda9014c2de1b3a8f75b4e0c000" + "team_id": 3521074710131, + "channel_name": "Production Alerts", + "description": "Handles all production environment alerts", + "group": { + "method": "p", + "time_window": 10, + "window_type": "tumbling" + }, + "auto_resolve_timeout": 86400, + "auto_resolve_mode": "trigger" } } } } } }, - "/incident/war-room/list": { + "/channel/delete": { "post": { - "operationId": "incidentWarRoomList", - "summary": "List war rooms", - "description": "List all war rooms associated with an incident.", + "operationId": "channelDelete", + "summary": "Delete channel", + "description": "Delete a channel and all associated configuration.", "tags": [ - "On-call/Incidents" + "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-war-room-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-delete", "metadata": { - "sidebarTitle": "List war rooms" + "sidebarTitle": "Delete channel" } }, "responses": { @@ -2163,7 +2122,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListWarRoomsResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -2171,9 +2130,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [] - } + "data": {} } } } @@ -2196,29 +2153,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListWarRoomsRequest" + "$ref": "#/components/schemas/ChannelIDRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee" + "channel_id": 3521074710131 } } } } } }, - "/incident/war-room/create": { + "/channel/disable": { "post": { - "operationId": "incidentWarRoomCreate", - "summary": "Create war room", - "description": "Create a war room channel for collaborative incident response.", + "operationId": "channelDisable", + "summary": "Disable channel", + "description": "Disable a channel to stop incident routing without deleting it.", "tags": [ - "On-call/Incidents" + "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-war-room-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-disable", "metadata": { - "sidebarTitle": "Create war room" + "sidebarTitle": "Disable channel" } }, "responses": { @@ -2235,7 +2192,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/WarRoom" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -2243,11 +2200,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "chat_id": "oc_a0553eda9014c2de1b3a8f75b4e0c000", - "chat_name": "Incident #0E83EE war room", - "share_link": "" - } + "data": {} } } } @@ -2270,31 +2223,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateWarRoomRequest" + "$ref": "#/components/schemas/ChannelIDRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "integration_id": 2490562293131, - "add_observers": true + "channel_id": 3521074710131 } } } } } }, - "/incident/war-room/delete": { + "/channel/enable": { "post": { - "operationId": "incidentWarRoomDelete", - "summary": "Delete war room", - "description": "Delete an incident war room.", + "operationId": "channelEnable", + "summary": "Enable channel", + "description": "Enable a disabled channel to resume incident routing.", "tags": [ - "On-call/Incidents" + "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-war-room-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-enable", "metadata": { - "sidebarTitle": "Delete war room" + "sidebarTitle": "Enable channel" } }, "responses": { @@ -2342,30 +2293,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteWarRoomRequest" + "$ref": "#/components/schemas/ChannelIDRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "integration_id": 2490562293131 + "channel_id": 3521074710131 } } } } } }, - "/incident/post-mortem/info": { - "get": { - "operationId": "incidentPostMortemInfo", - "summary": "Get post-mortem", - "description": "Retrieve a post-mortem report by its `post_mortem_id`. List reports via `/incident/post-mortem/list` first — each row carries the incident it covers — then fetch the full report here by that id.", + "/channel/escalate/rule/create": { + "post": { + "operationId": "channelEscalateRuleCreate", + "summary": "Create escalation rule", + "description": "Create an escalation rule defining who gets notified and when during an incident.", "tags": [ - "On-call/Incidents" + "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-post-mortem-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-escalate-rule-create", "metadata": { - "sidebarTitle": "Get post-mortem" + "sidebarTitle": "Create escalation rule" } }, "responses": { @@ -2382,7 +2332,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PostMortemItem" + "$ref": "#/components/schemas/RuleCreateResponse" } } } @@ -2391,43 +2341,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "meta": { - "account_id": 2451002751131, - "title": "Postmortem1", - "status": "published", - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", - "template_id": "post_mortem_default_tmpl_en-us", - "incident_ids": [ - "69bb9233331067560c718ecd" - ], - "media_count": 0, - "author_ids": [ - 2477273692131 - ], - "team_id": 2477033058131, - "channel_id": 3047621227131, - "is_private": false, - "channel_name": "Ops Channel", - "created_at_seconds": 1773900354, - "updated_at_seconds": 1773909012 - }, - "basics": { - "incidents_highest_severity": "Warning", - "incidents_earliest_start_seconds": 1761133512, - "incidents_latest_close_seconds": 1761133632, - "incidents_total_duration_seconds": 120, - "responders": [ - { - "person_id": 3790925372131, - "assigned_at": 1761133515, - "acknowledged_at": 0 - } - ] - }, - "content": { - "content": "{\"type\":\"doc\",\"content\":[]}" - }, - "follow_ups": "" + "rule_id": "69db2f72a0fe7db6448b1506", + "rule_name": "Test escalation rule" } } } @@ -2446,32 +2361,53 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "post_mortem_id", - "in": "query", - "required": true, - "schema": { - "type": "string" - }, - "description": "Post-mortem ID. Deterministic hash derived from account ID and the set of linked incident IDs." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateEscalationRuleRequest" + }, + "example": { + "channel_id": 3521074710131, + "rule_name": "On-call escalation", + "template_id": "6321aad26c12104586a88916", + "description": "Notify primary on-call, then escalate to secondary after 30 minutes", + "layers": [ + { + "target": { + "person_ids": [ + 3790925372131 + ], + "by": { + "follow_preference": true + } + }, + "max_times": 3, + "notify_step": 10, + "escalate_window": 30, + "force_escalate": false + } + ] + } + } } - ] + } } }, - "/incident/post-mortem/list": { + "/channel/escalate/rule/delete": { "post": { - "operationId": "incidentPostMortemList", - "summary": "List post-mortems", - "description": "List post-mortem reports with optional filters.", + "operationId": "channelEscalateRuleDelete", + "summary": "Delete escalation rule", + "description": "Delete an escalation rule.", "tags": [ - "On-call/Incidents" + "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-post-mortem-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-escalate-rule-delete", "metadata": { - "sidebarTitle": "List post-mortems" + "sidebarTitle": "Delete escalation rule" } }, "responses": { @@ -2488,7 +2424,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListPostMortemsResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -2496,32 +2432,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 3, - "has_next_page": false, - "items": [ - { - "account_id": 2451002751131, - "title": "Postmortem1", - "status": "published", - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", - "template_id": "post_mortem_default_tmpl_en-us", - "incident_ids": [ - "69bb9233331067560c718ecd" - ], - "media_count": 0, - "author_ids": [ - 2477273692131 - ], - "team_id": 2477033058131, - "channel_id": 3047621227131, - "is_private": false, - "channel_name": "Ops Channel", - "created_at_seconds": 1773900354, - "updated_at_seconds": 1773909012 - } - ] - } + "data": {} } } } @@ -2544,31 +2455,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListPostMortemsRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { - "status": "published", - "p": 1, - "limit": 20 + "channel_id": 3521074710131, + "rule_id": "6621b23f4a2c5e0012ab34cd" } } } } } }, - "/incident/post-mortem/delete": { + "/channel/escalate/rule/disable": { "post": { - "operationId": "incidentPostMortemDelete", - "summary": "Delete post-mortem", - "description": "Delete a post-mortem report.", + "operationId": "channelEscalateRuleDisable", + "summary": "Disable escalation rule", + "description": "Disable an escalation rule without deleting it.", "tags": [ - "On-call/Incidents" + "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/incident-post-mortem-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-escalate-rule-disable", "metadata": { - "sidebarTitle": "Delete post-mortem" + "sidebarTitle": "Disable escalation rule" } }, "responses": { @@ -2616,29 +2526,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeletePostMortemRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e" - } + "channel_id": 3521074710131, + "rule_id": "6621b23f4a2c5e0012ab34cd" + } } } } } }, - "/channel/info": { + "/channel/escalate/rule/enable": { "post": { - "operationId": "channelInfo", - "summary": "Get channel detail", - "description": "Retrieve detailed information for a specific channel.", + "operationId": "channelEscalateRuleEnable", + "summary": "Enable escalation rule", + "description": "Enable a disabled escalation rule.", "tags": [ "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/channels/channel-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-escalate-rule-enable", "metadata": { - "sidebarTitle": "Get channel detail" + "sidebarTitle": "Enable escalation rule" } }, "responses": { @@ -2655,7 +2566,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ChannelItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -2663,12 +2574,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "channel_id": 1001, - "channel_name": "Production Alerts", - "status": "enabled", - "team_id": 10 - } + "data": {} } } } @@ -2691,29 +2597,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelInfoRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { - "channel_id": 1001 + "channel_id": 3521074710131, + "rule_id": "6621b23f4a2c5e0012ab34cd" } } } } } }, - "/channel/list": { + "/channel/escalate/rule/info": { "post": { - "operationId": "channelList", - "summary": "List channels", - "description": "List channels accessible to the current user with optional filters.", + "operationId": "channelEscalateRuleInfo", + "summary": "Get escalation rule detail", + "description": "Retrieve detailed information for a specific escalation rule.", "tags": [ "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/channels/channel-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-escalate-rule-info", "metadata": { - "sidebarTitle": "List channels" + "sidebarTitle": "Get escalation rule detail" } }, "responses": { @@ -2730,7 +2637,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListChannelsResponse" + "$ref": "#/components/schemas/EscalateRuleItem" } } } @@ -2739,15 +2646,37 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 42, - "has_next_page": true, - "items": [ + "account_id": 2451002751131, + "channel_id": 6193426913131, + "priority": 0, + "aggr_window": 0, + "rule_name": "Default", + "description": "", + "layers": [ { - "channel_id": 1001, - "channel_name": "Production Alerts", - "status": "enabled" + "max_times": 1, + "notify_step": 10, + "target": { + "person_ids": [ + 3790925372131 + ], + "by": { + "follow_preference": true + }, + "webhooks": null + }, + "escalate_window": 30, + "force_escalate": false } - ] + ], + "time_filters": [], + "filters": [], + "status": "enabled", + "template_id": "6321aad26c12104586a88916", + "rule_id": "69bd0ce95a238693176c1d66", + "updated_by": 3790925372131, + "created_at": 1773997289, + "updated_at": 1773997289 } } } @@ -2771,32 +2700,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListChannelsRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { - "p": 1, - "limit": 20, - "orderby": "created_at", - "asc": false + "channel_id": 1001, + "rule_id": "6621b23f4a2c5e0012ab34d0" } } } } } }, - "/channel/infos": { + "/channel/escalate/rule/list": { "post": { - "operationId": "channelInfos", - "summary": "Batch get channels", - "description": "Retrieve multiple channels by their IDs.", + "operationId": "channelEscalateRuleList", + "summary": "List escalation rules", + "description": "List all escalation rules for a channel.", "tags": [ "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/channels/channel-infos", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-escalate-rule-list", "metadata": { - "sidebarTitle": "Batch get channels" + "sidebarTitle": "List escalation rules" } }, "responses": { @@ -2813,7 +2740,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ChannelInfosResponse" + "$ref": "#/components/schemas/ListEscalationRulesResponse" } } } @@ -2824,9 +2751,37 @@ "data": { "items": [ { - "channel_id": 1001, - "channel_name": "Production Alerts", - "status": "enabled" + "account_id": 2451002751131, + "channel_id": 6193426913131, + "priority": 0, + "aggr_window": 0, + "rule_name": "Default", + "description": "", + "layers": [ + { + "max_times": 1, + "notify_step": 10, + "target": { + "person_ids": [ + 3790925372131 + ], + "by": { + "follow_preference": true + }, + "webhooks": null + }, + "escalate_window": 30, + "force_escalate": false + } + ], + "time_filters": [], + "filters": [], + "status": "enabled", + "template_id": "6321aad26c12104586a88916", + "rule_id": "69bd0ce95a238693176c1d66", + "updated_by": 3790925372131, + "created_at": 1773997289, + "updated_at": 1773997289 } ] } @@ -2852,32 +2807,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelInfosRequest" + "$ref": "#/components/schemas/ChannelScopedListRequest" }, "example": { - "channel_ids": [ - 1001, - 1002 - ] + "channel_id": 1001 } } } } } }, - "/channel/create": { + "/channel/escalate/rule/update": { "post": { - "operationId": "channelCreate", - "summary": "Create channel", - "description": "Create a new channel for incident management.", + "operationId": "channelEscalateRuleUpdate", + "summary": "Update escalation rule", + "description": "Update an existing escalation rule configuration.", "tags": [ "On-call/Channels" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-create", + "href": "/en/api-reference/on-call/channels/channel-escalate-rule-update", "metadata": { - "sidebarTitle": "Create channel" + "sidebarTitle": "Update escalation rule" } }, "responses": { @@ -2894,7 +2846,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ChannelCreateResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -2902,10 +2854,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "channel_id": 6294542005131, - "channel_name": "API Test Channel" - } + "data": {} } } } @@ -2928,38 +2877,49 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateChannelRequest" + "$ref": "#/components/schemas/UpdateEscalationRuleRequest" }, "example": { - "team_id": 3521074710131, - "channel_name": "Production Alerts", - "description": "Handles all production environment alerts", - "group": { - "method": "p", - "time_window": 10, - "window_type": "tumbling" - }, - "auto_resolve_timeout": 86400, - "auto_resolve_mode": "trigger" + "channel_id": 1001, + "rule_id": "6621b23f4a2c5e0012ab34d0", + "template_id": "6621b23f4a2c5e0012ab34d1", + "rule_name": "Default escalation", + "layers": [ + { + "target": { + "person_ids": [ + 42 + ], + "by": { + "critical": [ + "voice" + ], + "warning": [ + "sms" + ] + } + } + } + ] } } } } } }, - "/channel/update": { + "/channel/escalate/webhook/robot/list": { "post": { - "operationId": "channelUpdate", - "summary": "Update channel", - "description": "Update an existing channel's configuration and settings.", + "operationId": "channelEscalateWebhookRobotList", + "summary": "List webhook robots in escalation rules", + "description": "List all IM webhook robots configured in escalation rules across the account. Returns a deduplicated list of robots with references to which channels and escalation rules use them.", "tags": [ "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage Notes\n\nThis endpoint lists all IM webhook robots configured in escalation rules under the current account. The system iterates through all escalation rule layers, extracts webhook configurations (excluding app-type webhooks with `_app` suffix), deduplicates them by `type + token`, and returns the result.\n\nEach robot includes a `referenced_by` list indicating which channels and escalation rules reference it, making it easy to manage robots centrally and assess the impact scope of changes.\n\nUse `type` to filter by robot type (e.g. `feishu`, `dingtalk`, `wecom`, `slack`, `teams`), or `query` to fuzzy-search by alias or token.", + "href": "/en/api-reference/on-call/channels/channel-escalate-webhook-robot-list", "metadata": { - "sidebarTitle": "Update channel" + "sidebarTitle": "List webhook robots" } }, "responses": { @@ -2976,7 +2936,53 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/UpdateChannelResponse" + "type": "object", + "properties": { + "list": { + "type": "array", + "description": "Deduplicated list of webhook robots.", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Robot type, e.g. `feishu`, `dingtalk`, `wecom`, `slack`, `teams`, etc." + }, + "settings": { + "type": "object", + "description": "Robot configuration, including `token` (webhook URL or secret) and `alias` (robot display name) among other fields.", + "additionalProperties": true + }, + "referenced_by": { + "type": "array", + "description": "List of channels and escalation rules referencing this robot.", + "items": { + "type": "object", + "properties": { + "channel_id": { + "type": "integer", + "format": "int64", + "description": "Channel ID." + }, + "channel_name": { + "type": "string", + "description": "Channel name." + }, + "escalate_rule_id": { + "type": "string", + "description": "Escalation rule ID (MongoDB ObjectID)." + }, + "escalate_rule_name": { + "type": "string", + "description": "Escalation rule name." + } + } + } + } + } + } + } + } } } } @@ -2985,7 +2991,44 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "external_report_token": "" + "list": [ + { + "type": "feishu", + "settings": { + "token": "https://open.feishu.cn/open-apis/bot/v2/hook/xxx", + "alias": "Ops Alert Group" + }, + "referenced_by": [ + { + "channel_id": 6193426913131, + "channel_name": "Order System", + "escalate_rule_id": "69bd0ce95a238693176c1d66", + "escalate_rule_name": "Default Escalation" + }, + { + "channel_id": 6193426913132, + "channel_name": "Payment System", + "escalate_rule_id": "69bd0ce95a238693176c1d67", + "escalate_rule_name": "Critical Alerts" + } + ] + }, + { + "type": "dingtalk", + "settings": { + "token": "https://oapi.dingtalk.com/robot/send?access_token=xxx", + "alias": "DBA Group" + }, + "referenced_by": [ + { + "channel_id": 6193426913131, + "channel_name": "Order System", + "escalate_rule_id": "69bd0ce95a238693176c1d66", + "escalate_rule_name": "Default Escalation" + } + ] + } + ] } } } @@ -3009,31 +3052,40 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateChannelRequest" + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "Search keyword. Fuzzy matches against robot alias or token, case-insensitive." + }, + "type": { + "type": "string", + "description": "Filter by robot type, e.g. `feishu`, `dingtalk`, `wecom`, `slack`, `teams`. Omit to return all types." + } + } }, "example": { - "channel_id": 1001, - "channel_name": "Production Alerts (v2)", - "description": "Updated description" + "query": "ops", + "type": "feishu" } } } } } }, - "/channel/delete": { + "/channel/info": { "post": { - "operationId": "channelDelete", - "summary": "Delete channel", - "description": "Delete a channel and all associated configuration.", + "operationId": "channelInfo", + "summary": "Get channel detail", + "description": "Retrieve detailed information for a specific channel.", "tags": [ "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/channels/channel-info", "metadata": { - "sidebarTitle": "Delete channel" + "sidebarTitle": "Get channel detail" } }, "responses": { @@ -3050,7 +3102,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ChannelItem" } } } @@ -3058,7 +3110,12 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "channel_id": 1001, + "channel_name": "Production Alerts", + "status": "enabled", + "team_id": 10 + } } } } @@ -3081,29 +3138,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelIDRequest" + "$ref": "#/components/schemas/ChannelInfoRequest" }, "example": { - "channel_id": 3521074710131 + "channel_id": 1001 } } } } } }, - "/channel/enable": { + "/channel/infos": { "post": { - "operationId": "channelEnable", - "summary": "Enable channel", - "description": "Enable a disabled channel to resume incident routing.", + "operationId": "channelInfos", + "summary": "Batch get channels", + "description": "Retrieve multiple channels by their IDs.", "tags": [ "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-enable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/channels/channel-infos", "metadata": { - "sidebarTitle": "Enable channel" + "sidebarTitle": "Batch get channels" } }, "responses": { @@ -3120,7 +3177,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ChannelInfosResponse" } } } @@ -3128,7 +3185,15 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "channel_id": 1001, + "channel_name": "Production Alerts", + "status": "enabled" + } + ] + } } } } @@ -3151,29 +3216,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelIDRequest" + "$ref": "#/components/schemas/ChannelInfosRequest" }, "example": { - "channel_id": 3521074710131 + "channel_ids": [ + 1001, + 1002 + ] } } } } } }, - "/channel/disable": { + "/channel/inhibit/rule/create": { "post": { - "operationId": "channelDisable", - "summary": "Disable channel", - "description": "Disable a channel to stop incident routing without deleting it.", + "operationId": "channelInhibitRuleCreate", + "summary": "Create inhibit rule", + "description": "Create an inhibit rule to suppress lower-priority alerts when higher-priority ones are firing.", "tags": [ "On-call/Channels" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-disable", + "href": "/en/api-reference/on-call/channels/channel-inhibit-rule-create", "metadata": { - "sidebarTitle": "Disable channel" + "sidebarTitle": "Create inhibit rule" } }, "responses": { @@ -3190,7 +3258,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/RuleCreateResponse" } } } @@ -3198,7 +3266,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "rule_id": "69db2f69a0fe7db6448b1504", + "rule_name": "Test inhibit rule" + } } } } @@ -3221,29 +3292,58 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelIDRequest" + "$ref": "#/components/schemas/CreateInhibitRuleRequest" }, "example": { - "channel_id": 3521074710131 + "channel_id": 3521074710131, + "rule_name": "Suppress Info when Critical fires", + "description": "When a Critical alert fires, suppress matching Info alerts", + "equals": [ + "labels.cluster", + "labels.service" + ], + "source_filters": [ + [ + { + "key": "severity", + "oper": "IN", + "vals": [ + "Critical" + ] + } + ] + ], + "target_filters": [ + [ + { + "key": "severity", + "oper": "IN", + "vals": [ + "Info" + ] + } + ] + ], + "is_directly_discard": false } } } } } }, - "/channel/silence/rule/list": { + "/channel/inhibit/rule/delete": { "post": { - "operationId": "channelSilenceRuleList", - "summary": "List silence rules", - "description": "List all silence rules configured for a channel.", + "operationId": "channelInhibitRuleDelete", + "summary": "Delete inhibit rule", + "description": "Delete an inhibit rule.", "tags": [ "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-silence-rule-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-inhibit-rule-delete", "metadata": { - "sidebarTitle": "List silence rules" + "sidebarTitle": "Delete inhibit rule" } }, "responses": { @@ -3260,7 +3360,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListSilenceRulesResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -3268,41 +3368,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "account_id": 2451002751131, - "channel_id": 5967964835131, - "priority": 0, - "rule_name": "Silence Info alerts", - "description": "", - "from_incident_id": "000000000000000000000000", - "time_filters": [], - "time_filter": { - "start_time": 1773388800, - "end_time": 1773414000 - }, - "filters": [ - [ - { - "key": "severity", - "oper": "IN", - "vals": [ - "Info" - ] - } - ] - ], - "is_directly_discard": true, - "status": "enabled", - "rule_id": "69b3c426b4a6f5abf1f54873", - "updated_by": 3790925372131, - "created_at": 1773388838, - "updated_at": 1773388838, - "is_effective": false - } - ] - } + "data": {} } } } @@ -3325,29 +3391,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelScopedListRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { - "channel_id": 1001 + "channel_id": 3521074710131, + "rule_id": "6621b23f4a2c5e0012ab34cd" } } } } } }, - "/channel/silence/rule/create": { + "/channel/inhibit/rule/disable": { "post": { - "operationId": "channelSilenceRuleCreate", - "summary": "Create silence rule", - "description": "Create a silence rule to suppress notifications matching specified conditions.", + "operationId": "channelInhibitRuleDisable", + "summary": "Disable inhibit rule", + "description": "Disable an inhibit rule without deleting it.", "tags": [ "On-call/Channels" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-silence-rule-create", + "href": "/en/api-reference/on-call/channels/channel-inhibit-rule-disable", "metadata": { - "sidebarTitle": "Create silence rule" + "sidebarTitle": "Disable inhibit rule" } }, "responses": { @@ -3364,7 +3431,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleCreateResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -3372,10 +3439,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "rule_id": "69db2f66a0fe7db6448b1503", - "rule_name": "Test silence rule" - } + "data": {} } } } @@ -3398,134 +3462,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateSilenceRuleRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { "channel_id": 3521074710131, - "rule_name": "Maintenance window silence", - "description": "Silence all Info alerts during planned maintenance", - "time_filter": { - "start_time": 1773388800, - "end_time": 1773414000 - }, - "filters": [ - [ - { - "key": "severity", - "oper": "IN", - "vals": [ - "Info" - ] - } - ] - ], - "is_directly_discard": false - } - } - } - } - } - }, - "/channel/silence/rule/update": { - "post": { - "operationId": "channelSilenceRuleUpdate", - "summary": "Update silence rule", - "description": "Update an existing silence rule configuration.", - "tags": [ - "On-call/Channels" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-silence-rule-update", - "metadata": { - "sidebarTitle": "Update silence rule" - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateSilenceRuleRequest" - }, - "example": { - "channel_id": 1001, - "rule_id": "6621b23f4a2c5e0012ab34cd", - "rule_name": "Mute during maintenance", - "time_filter": { - "start_time": 1710000000, - "end_time": 1710086400 - }, - "filters": [ - [ - { - "key": "labels.service", - "oper": "IN", - "vals": [ - "billing" - ] - } - ] - ] + "rule_id": "6621b23f4a2c5e0012ab34cd" } } } } } }, - "/channel/silence/rule/delete": { + "/channel/inhibit/rule/enable": { "post": { - "operationId": "channelSilenceRuleDelete", - "summary": "Delete silence rule", - "description": "Delete a silence rule.", + "operationId": "channelInhibitRuleEnable", + "summary": "Enable inhibit rule", + "description": "Enable a disabled inhibit rule.", "tags": [ "On-call/Channels" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-silence-rule-delete", + "href": "/en/api-reference/on-call/channels/channel-inhibit-rule-enable", "metadata": { - "sidebarTitle": "Delete silence rule" + "sidebarTitle": "Enable inhibit rule" } }, "responses": { @@ -3584,19 +3544,19 @@ } } }, - "/channel/silence/rule/enable": { + "/channel/inhibit/rule/list": { "post": { - "operationId": "channelSilenceRuleEnable", - "summary": "Enable silence rule", - "description": "Enable a disabled silence rule.", + "operationId": "channelInhibitRuleList", + "summary": "List inhibit rules", + "description": "List all inhibit rules configured for a channel.", "tags": [ "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-silence-rule-enable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-inhibit-rule-list", "metadata": { - "sidebarTitle": "Enable silence rule" + "sidebarTitle": "List inhibit rules" } }, "responses": { @@ -3613,7 +3573,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ListInhibitRulesResponse" } } } @@ -3621,7 +3581,49 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "account_id": 2451002751131, + "channel_id": 5967964835131, + "priority": 0, + "rule_name": "Suppress downstream alerts", + "description": "", + "source_filters": [ + [ + { + "key": "severity", + "oper": "IN", + "vals": [ + "Info" + ] + } + ] + ], + "target_filters": [ + [ + { + "key": "severity", + "oper": "IN", + "vals": [ + "Info" + ] + } + ] + ], + "equals": [ + "data_source_id", + "labels._account_id" + ], + "is_directly_discard": false, + "status": "enabled", + "rule_id": "69bcc630b9e63df36603e425", + "updated_by": 3790925372131, + "created_at": 1773979184, + "updated_at": 1773979184 + } + ] + } } } } @@ -3644,30 +3646,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/ChannelScopedListRequest" }, "example": { - "channel_id": 3521074710131, - "rule_id": "6621b23f4a2c5e0012ab34cd" + "channel_id": 1001 } } } } } }, - "/channel/silence/rule/disable": { + "/channel/inhibit/rule/update": { "post": { - "operationId": "channelSilenceRuleDisable", - "summary": "Disable silence rule", - "description": "Disable a silence rule without deleting it.", + "operationId": "channelInhibitRuleUpdate", + "summary": "Update inhibit rule", + "description": "Update an existing inhibit rule configuration.", "tags": [ "On-call/Channels" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-silence-rule-disable", + "href": "/en/api-reference/on-call/channels/channel-inhibit-rule-update", "metadata": { - "sidebarTitle": "Disable silence rule" + "sidebarTitle": "Update inhibit rule" } }, "responses": { @@ -3715,30 +3716,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/UpdateInhibitRuleRequest" }, "example": { - "channel_id": 3521074710131, - "rule_id": "6621b23f4a2c5e0012ab34cd" + "channel_id": 1001, + "rule_id": "6621b23f4a2c5e0012ab34ce", + "rule_name": "Suppress downstream", + "equals": [ + "labels.cluster" + ] } } } } } }, - "/channel/inhibit/rule/list": { + "/channel/list": { "post": { - "operationId": "channelInhibitRuleList", - "summary": "List inhibit rules", - "description": "List all inhibit rules configured for a channel.", + "operationId": "channelList", + "summary": "List channels", + "description": "List channels accessible to the current user with optional filters.", "tags": [ "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-inhibit-rule-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/channels/channel-list", "metadata": { - "sidebarTitle": "List inhibit rules" + "sidebarTitle": "List channels" } }, "responses": { @@ -3755,7 +3760,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListInhibitRulesResponse" + "$ref": "#/components/schemas/ListChannelsResponse" } } } @@ -3764,45 +3769,13 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "total": 42, + "has_next_page": true, "items": [ { - "account_id": 2451002751131, - "channel_id": 5967964835131, - "priority": 0, - "rule_name": "Suppress downstream alerts", - "description": "", - "source_filters": [ - [ - { - "key": "severity", - "oper": "IN", - "vals": [ - "Info" - ] - } - ] - ], - "target_filters": [ - [ - { - "key": "severity", - "oper": "IN", - "vals": [ - "Info" - ] - } - ] - ], - "equals": [ - "data_source_id", - "labels._account_id" - ], - "is_directly_discard": false, - "status": "enabled", - "rule_id": "69bcc630b9e63df36603e425", - "updated_by": 3790925372131, - "created_at": 1773979184, - "updated_at": 1773979184 + "channel_id": 1001, + "channel_name": "Production Alerts", + "status": "enabled" } ] } @@ -3828,29 +3801,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelScopedListRequest" + "$ref": "#/components/schemas/ListChannelsRequest" }, "example": { - "channel_id": 1001 + "p": 1, + "limit": 20, + "orderby": "created_at", + "asc": false } } } } } }, - "/channel/inhibit/rule/create": { + "/channel/silence/rule/create": { "post": { - "operationId": "channelInhibitRuleCreate", - "summary": "Create inhibit rule", - "description": "Create an inhibit rule to suppress lower-priority alerts when higher-priority ones are firing.", + "operationId": "channelSilenceRuleCreate", + "summary": "Create silence rule", + "description": "Create a silence rule to suppress notifications matching specified conditions.", "tags": [ "On-call/Channels" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-inhibit-rule-create", + "href": "/en/api-reference/on-call/channels/channel-silence-rule-create", "metadata": { - "sidebarTitle": "Create inhibit rule" + "sidebarTitle": "Create silence rule" } }, "responses": { @@ -3876,8 +3852,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "rule_id": "69db2f69a0fe7db6448b1504", - "rule_name": "Test inhibit rule" + "rule_id": "69db2f66a0fe7db6448b1503", + "rule_name": "Test silence rule" } } } @@ -3901,28 +3877,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateInhibitRuleRequest" + "$ref": "#/components/schemas/CreateSilenceRuleRequest" }, "example": { "channel_id": 3521074710131, - "rule_name": "Suppress Info when Critical fires", - "description": "When a Critical alert fires, suppress matching Info alerts", - "equals": [ - "labels.cluster", - "labels.service" - ], - "source_filters": [ - [ - { - "key": "severity", - "oper": "IN", - "vals": [ - "Critical" - ] - } - ] - ], - "target_filters": [ + "rule_name": "Maintenance window silence", + "description": "Silence all Info alerts during planned maintenance", + "time_filter": { + "start_time": 1773388800, + "end_time": 1773414000 + }, + "filters": [ [ { "key": "severity", @@ -3940,19 +3905,19 @@ } } }, - "/channel/inhibit/rule/update": { + "/channel/silence/rule/delete": { "post": { - "operationId": "channelInhibitRuleUpdate", - "summary": "Update inhibit rule", - "description": "Update an existing inhibit rule configuration.", + "operationId": "channelSilenceRuleDelete", + "summary": "Delete silence rule", + "description": "Delete a silence rule.", "tags": [ "On-call/Channels" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-inhibit-rule-update", + "href": "/en/api-reference/on-call/channels/channel-silence-rule-delete", "metadata": { - "sidebarTitle": "Update inhibit rule" + "sidebarTitle": "Delete silence rule" } }, "responses": { @@ -4000,34 +3965,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateInhibitRuleRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { - "channel_id": 1001, - "rule_id": "6621b23f4a2c5e0012ab34ce", - "rule_name": "Suppress downstream", - "equals": [ - "labels.cluster" - ] + "channel_id": 3521074710131, + "rule_id": "6621b23f4a2c5e0012ab34cd" } } } } } }, - "/channel/inhibit/rule/delete": { + "/channel/silence/rule/disable": { "post": { - "operationId": "channelInhibitRuleDelete", - "summary": "Delete inhibit rule", - "description": "Delete an inhibit rule.", + "operationId": "channelSilenceRuleDisable", + "summary": "Disable silence rule", + "description": "Disable a silence rule without deleting it.", "tags": [ "On-call/Channels" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-inhibit-rule-delete", + "href": "/en/api-reference/on-call/channels/channel-silence-rule-disable", "metadata": { - "sidebarTitle": "Delete inhibit rule" + "sidebarTitle": "Disable silence rule" } }, "responses": { @@ -4086,19 +4047,19 @@ } } }, - "/channel/inhibit/rule/enable": { + "/channel/silence/rule/enable": { "post": { - "operationId": "channelInhibitRuleEnable", - "summary": "Enable inhibit rule", - "description": "Enable a disabled inhibit rule.", + "operationId": "channelSilenceRuleEnable", + "summary": "Enable silence rule", + "description": "Enable a disabled silence rule.", "tags": [ "On-call/Channels" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-inhibit-rule-enable", + "href": "/en/api-reference/on-call/channels/channel-silence-rule-enable", "metadata": { - "sidebarTitle": "Enable inhibit rule" + "sidebarTitle": "Enable silence rule" } }, "responses": { @@ -4157,19 +4118,19 @@ } } }, - "/channel/inhibit/rule/disable": { + "/channel/silence/rule/list": { "post": { - "operationId": "channelInhibitRuleDisable", - "summary": "Disable inhibit rule", - "description": "Disable an inhibit rule without deleting it.", + "operationId": "channelSilenceRuleList", + "summary": "List silence rules", + "description": "List all silence rules configured for a channel.", "tags": [ "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-inhibit-rule-disable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-silence-rule-list", "metadata": { - "sidebarTitle": "Disable inhibit rule" + "sidebarTitle": "List silence rules" } }, "responses": { @@ -4186,7 +4147,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ListSilenceRulesResponse" } } } @@ -4194,7 +4155,41 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "account_id": 2451002751131, + "channel_id": 5967964835131, + "priority": 0, + "rule_name": "Silence Info alerts", + "description": "", + "from_incident_id": "000000000000000000000000", + "time_filters": [], + "time_filter": { + "start_time": 1773388800, + "end_time": 1773414000 + }, + "filters": [ + [ + { + "key": "severity", + "oper": "IN", + "vals": [ + "Info" + ] + } + ] + ], + "is_directly_discard": true, + "status": "enabled", + "rule_id": "69b3c426b4a6f5abf1f54873", + "updated_by": 3790925372131, + "created_at": 1773388838, + "updated_at": 1773388838, + "is_effective": false + } + ] + } } } } @@ -4217,30 +4212,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/ChannelScopedListRequest" }, "example": { - "channel_id": 3521074710131, - "rule_id": "6621b23f4a2c5e0012ab34cd" + "channel_id": 1001 } } } } } }, - "/channel/unsubscribe/rule/list": { + "/channel/silence/rule/update": { "post": { - "operationId": "channelUnsubscribeRuleList", - "summary": "List drop rules", - "description": "List drop rules for a channel.", + "operationId": "channelSilenceRuleUpdate", + "summary": "Update silence rule", + "description": "Update an existing silence rule configuration.", "tags": [ "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/channels/channel-unsubscribe-rule-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-silence-rule-update", "metadata": { - "sidebarTitle": "List drop rules" + "sidebarTitle": "Update silence rule" } }, "responses": { @@ -4257,7 +4251,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListDropRulesResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -4265,33 +4259,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "account_id": 2451002751131, - "channel_id": 5967964835131, - "priority": 0, - "rule_name": "Drop test alerts", - "description": "", - "filters": [ - [ - { - "key": "data_source_id", - "oper": "IN", - "vals": [ - "6113996590131" - ] - } - ] - ], - "status": "enabled", - "rule_id": "69bcc530b9e63df36603e421", - "updated_by": 3790925372131, - "created_at": 1773978928, - "updated_at": 1773978928 - } - ] - } + "data": {} } } } @@ -4314,10 +4282,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelScopedListRequest" + "$ref": "#/components/schemas/UpdateSilenceRuleRequest" }, "example": { - "channel_id": 1001 + "channel_id": 1001, + "rule_id": "6621b23f4a2c5e0012ab34cd", + "rule_name": "Mute during maintenance", + "time_filter": { + "start_time": 1710000000, + "end_time": 1710086400 + }, + "filters": [ + [ + { + "key": "labels.service", + "oper": "IN", + "vals": [ + "billing" + ] + } + ] + ] } } } @@ -4411,19 +4396,19 @@ } } }, - "/channel/unsubscribe/rule/update": { + "/channel/unsubscribe/rule/delete": { "post": { - "operationId": "channelUnsubscribeRuleUpdate", - "summary": "Update drop rule", - "description": "Update an existing drop rule configuration.", + "operationId": "channelUnsubscribeRuleDelete", + "summary": "Delete drop rule", + "description": "Delete a drop rule.", "tags": [ "On-call/Channels" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/channels/channel-unsubscribe-rule-update", + "href": "/en/api-reference/on-call/channels/channel-unsubscribe-rule-delete", "metadata": { - "sidebarTitle": "Update drop rule" + "sidebarTitle": "Delete drop rule" } }, "responses": { @@ -4471,42 +4456,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateDropRuleRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { - "channel_id": 1001, - "rule_id": "6621b23f4a2c5e0012ab34cf", - "rule_name": "Drop test alerts", - "filters": [ - [ - { - "key": "labels.env", - "oper": "IN", - "vals": [ - "test" - ] - } - ] - ] + "channel_id": 3521074710131, + "rule_id": "6621b23f4a2c5e0012ab34cd" } } } } } }, - "/channel/unsubscribe/rule/delete": { + "/channel/unsubscribe/rule/disable": { "post": { - "operationId": "channelUnsubscribeRuleDelete", - "summary": "Delete drop rule", - "description": "Delete a drop rule.", + "operationId": "channelUnsubscribeRuleDisable", + "summary": "Disable drop rule", + "description": "Disable a drop rule without deleting it.", "tags": [ "On-call/Channels" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/channels/channel-unsubscribe-rule-delete", + "href": "/en/api-reference/on-call/channels/channel-unsubscribe-rule-disable", "metadata": { - "sidebarTitle": "Delete drop rule" + "sidebarTitle": "Disable drop rule" } }, "responses": { @@ -4636,19 +4609,19 @@ } } }, - "/channel/unsubscribe/rule/disable": { + "/channel/unsubscribe/rule/list": { "post": { - "operationId": "channelUnsubscribeRuleDisable", - "summary": "Disable drop rule", - "description": "Disable a drop rule without deleting it.", + "operationId": "channelUnsubscribeRuleList", + "summary": "List drop rules", + "description": "List drop rules for a channel.", "tags": [ "On-call/Channels" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/channels/channel-unsubscribe-rule-disable", + "href": "/en/api-reference/on-call/channels/channel-unsubscribe-rule-list", "metadata": { - "sidebarTitle": "Disable drop rule" + "sidebarTitle": "List drop rules" } }, "responses": { @@ -4665,7 +4638,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ListDropRulesResponse" } } } @@ -4673,7 +4646,33 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "account_id": 2451002751131, + "channel_id": 5967964835131, + "priority": 0, + "rule_name": "Drop test alerts", + "description": "", + "filters": [ + [ + { + "key": "data_source_id", + "oper": "IN", + "vals": [ + "6113996590131" + ] + } + ] + ], + "status": "enabled", + "rule_id": "69bcc530b9e63df36603e421", + "updated_by": 3790925372131, + "created_at": 1773978928, + "updated_at": 1773978928 + } + ] + } } } } @@ -4696,30 +4695,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/ChannelScopedListRequest" }, "example": { - "channel_id": 3521074710131, - "rule_id": "6621b23f4a2c5e0012ab34cd" + "channel_id": 1001 } } } } } }, - "/channel/escalate/rule/info": { + "/channel/unsubscribe/rule/update": { "post": { - "operationId": "channelEscalateRuleInfo", - "summary": "Get escalation rule detail", - "description": "Retrieve detailed information for a specific escalation rule.", + "operationId": "channelUnsubscribeRuleUpdate", + "summary": "Update drop rule", + "description": "Update an existing drop rule configuration.", "tags": [ "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-escalate-rule-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/channels/channel-unsubscribe-rule-update", "metadata": { - "sidebarTitle": "Get escalation rule detail" + "sidebarTitle": "Update drop rule" } }, "responses": { @@ -4736,7 +4734,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EscalateRuleItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -4744,39 +4742,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "account_id": 2451002751131, - "channel_id": 6193426913131, - "priority": 0, - "aggr_window": 0, - "rule_name": "Default", - "description": "", - "layers": [ - { - "max_times": 1, - "notify_step": 10, - "target": { - "person_ids": [ - 3790925372131 - ], - "by": { - "follow_preference": true - }, - "webhooks": null - }, - "escalate_window": 30, - "force_escalate": false - } - ], - "time_filters": [], - "filters": [], - "status": "enabled", - "template_id": "6321aad26c12104586a88916", - "rule_id": "69bd0ce95a238693176c1d66", - "updated_by": 3790925372131, - "created_at": 1773997289, - "updated_at": 1773997289 - } + "data": {} } } } @@ -4799,30 +4765,42 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/UpdateDropRuleRequest" }, "example": { "channel_id": 1001, - "rule_id": "6621b23f4a2c5e0012ab34d0" + "rule_id": "6621b23f4a2c5e0012ab34cf", + "rule_name": "Drop test alerts", + "filters": [ + [ + { + "key": "labels.env", + "oper": "IN", + "vals": [ + "test" + ] + } + ] + ] } } } } } }, - "/channel/escalate/webhook/robot/list": { + "/channel/update": { "post": { - "operationId": "channelEscalateWebhookRobotList", - "summary": "List webhook robots in escalation rules", - "description": "List all IM webhook robots configured in escalation rules across the account. Returns a deduplicated list of robots with references to which channels and escalation rules use them.", + "operationId": "channelUpdate", + "summary": "Update channel", + "description": "Update an existing channel's configuration and settings.", "tags": [ "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage Notes\n\nThis endpoint lists all IM webhook robots configured in escalation rules under the current account. The system iterates through all escalation rule layers, extracts webhook configurations (excluding app-type webhooks with `_app` suffix), deduplicates them by `type + token`, and returns the result.\n\nEach robot includes a `referenced_by` list indicating which channels and escalation rules reference it, making it easy to manage robots centrally and assess the impact scope of changes.\n\nUse `type` to filter by robot type (e.g. `feishu`, `dingtalk`, `wecom`, `slack`, `teams`), or `query` to fuzzy-search by alias or token.", - "href": "/en/api-reference/on-call/channels/channel-escalate-webhook-robot-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/channel-update", "metadata": { - "sidebarTitle": "List webhook robots" + "sidebarTitle": "Update channel" } }, "responses": { @@ -4839,53 +4817,7 @@ "type": "object", "properties": { "data": { - "type": "object", - "properties": { - "list": { - "type": "array", - "description": "Deduplicated list of webhook robots.", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "Robot type, e.g. `feishu`, `dingtalk`, `wecom`, `slack`, `teams`, etc." - }, - "settings": { - "type": "object", - "description": "Robot configuration, including `token` (webhook URL or secret) and `alias` (robot display name) among other fields.", - "additionalProperties": true - }, - "referenced_by": { - "type": "array", - "description": "List of channels and escalation rules referencing this robot.", - "items": { - "type": "object", - "properties": { - "channel_id": { - "type": "integer", - "format": "int64", - "description": "Channel ID." - }, - "channel_name": { - "type": "string", - "description": "Channel name." - }, - "escalate_rule_id": { - "type": "string", - "description": "Escalation rule ID (MongoDB ObjectID)." - }, - "escalate_rule_name": { - "type": "string", - "description": "Escalation rule name." - } - } - } - } - } - } - } - } + "$ref": "#/components/schemas/UpdateChannelResponse" } } } @@ -4894,44 +4826,7 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "list": [ - { - "type": "feishu", - "settings": { - "token": "https://open.feishu.cn/open-apis/bot/v2/hook/xxx", - "alias": "Ops Alert Group" - }, - "referenced_by": [ - { - "channel_id": 6193426913131, - "channel_name": "Order System", - "escalate_rule_id": "69bd0ce95a238693176c1d66", - "escalate_rule_name": "Default Escalation" - }, - { - "channel_id": 6193426913132, - "channel_name": "Payment System", - "escalate_rule_id": "69bd0ce95a238693176c1d67", - "escalate_rule_name": "Critical Alerts" - } - ] - }, - { - "type": "dingtalk", - "settings": { - "token": "https://oapi.dingtalk.com/robot/send?access_token=xxx", - "alias": "DBA Group" - }, - "referenced_by": [ - { - "channel_id": 6193426913131, - "channel_name": "Order System", - "escalate_rule_id": "69bd0ce95a238693176c1d66", - "escalate_rule_name": "Default Escalation" - } - ] - } - ] + "external_report_token": "" } } } @@ -4955,40 +4850,31 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "query": { - "type": "string", - "description": "Search keyword. Fuzzy matches against robot alias or token, case-insensitive." - }, - "type": { - "type": "string", - "description": "Filter by robot type, e.g. `feishu`, `dingtalk`, `wecom`, `slack`, `teams`. Omit to return all types." - } - } + "$ref": "#/components/schemas/UpdateChannelRequest" }, "example": { - "query": "ops", - "type": "feishu" + "channel_id": 1001, + "channel_name": "Production Alerts (v2)", + "description": "Updated description" } } } } } }, - "/channel/escalate/rule/list": { + "/datasource/im/person/try-link": { "post": { - "operationId": "channelEscalateRuleList", - "summary": "List escalation rules", - "description": "List all escalation rules for a channel.", + "operationId": "datasourceImPersonTryLink", + "summary": "Attempt IM person linking", + "description": "Try to automatically link unbound members to their IM accounts for one integration.", "tags": [ - "On-call/Channels" + "On-call/Integrations" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-escalate-rule-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Manage** (`on-call`) |\n\n## Usage\n\n- The server uses member email and phone values to find matching users in DingTalk, Feishu, or WeCom.\n- If no member can be linked, the response contains an empty `new_linked_person_ids` array.", + "href": "/en/api-reference/on-call/integrations/datasource-im-person-try-link", "metadata": { - "sidebarTitle": "List escalation rules" + "sidebarTitle": "Attempt IM person linking" } }, "responses": { @@ -5005,7 +4891,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListEscalationRulesResponse" + "$ref": "#/components/schemas/TryLinkPersonResponse" } } } @@ -5014,40 +4900,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ - { - "account_id": 2451002751131, - "channel_id": 6193426913131, - "priority": 0, - "aggr_window": 0, - "rule_name": "Default", - "description": "", - "layers": [ - { - "max_times": 1, - "notify_step": 10, - "target": { - "person_ids": [ - 3790925372131 - ], - "by": { - "follow_preference": true - }, - "webhooks": null - }, - "escalate_window": 30, - "force_escalate": false - } - ], - "time_filters": [], - "filters": [], - "status": "enabled", - "template_id": "6321aad26c12104586a88916", - "rule_id": "69bd0ce95a238693176c1d66", - "updated_by": 3790925372131, - "created_at": 1773997289, - "updated_at": 1773997289 - } + "new_linked_person_ids": [ + 5348648172131 ] } } @@ -5072,29 +4926,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelScopedListRequest" + "$ref": "#/components/schemas/TryLinkPersonRequest" }, "example": { - "channel_id": 1001 + "integration_id": 6113996590131 } } } } } }, - "/channel/escalate/rule/create": { + "/datasource/im/war-room-enabled/list": { "post": { - "operationId": "channelEscalateRuleCreate", - "summary": "Create escalation rule", - "description": "Create an escalation rule defining who gets notified and when during an incident.", + "operationId": "im-war-room-enabled-list", + "summary": "List war-room-enabled IM integrations", + "description": "List IM integrations that have the war-room feature enabled for the account.", "tags": [ - "On-call/Channels" + "On-call/IM integrations" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-escalate-rule-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", + "href": "/en/api-reference/on-call/integrations/im-war-room-enabled-list", "metadata": { - "sidebarTitle": "Create escalation rule" + "sidebarTitle": "List war-room-enabled IM integrations" } }, "responses": { @@ -5111,7 +4965,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleCreateResponse" + "$ref": "#/components/schemas/ListWarRoomEnabledResponse" } } } @@ -5120,8 +4974,33 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "rule_id": "69db2f72a0fe7db6448b1506", - "rule_name": "Test escalation rule" + "items": [ + { + "data_source_id": 362, + "account_id": 10001, + "team_id": 0, + "plugin_id": 101, + "name": "Feishu Ops", + "status": "enabled", + "category": "im", + "plugin_type": "feishu", + "plugin_type_name": "Feishu", + "description": "Feishu war-room integration", + "integration_key": "ik_8f3a2b1c9d0e", + "ref_id": "", + "settings": { + "war_room_enabled": true + }, + "no_editable": false, + "creator_id": 20001, + "updated_by": 20001, + "created_at": 1716962400, + "updated_at": 1716962700, + "last_time": 1716963000, + "exclusive_data_source_id": 0, + "integration_id": 362 + } + ] } } } @@ -5145,48 +5024,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateEscalationRuleRequest" + "type": "object" }, - "example": { - "channel_id": 3521074710131, - "rule_name": "On-call escalation", - "template_id": "6321aad26c12104586a88916", - "description": "Notify primary on-call, then escalate to secondary after 30 minutes", - "layers": [ - { - "target": { - "person_ids": [ - 3790925372131 - ], - "by": { - "follow_preference": true - } - }, - "max_times": 3, - "notify_step": 10, - "escalate_window": 30, - "force_escalate": false - } - ] - } + "example": {} } } } } }, - "/channel/escalate/rule/update": { + "/enrichment/info": { "post": { - "operationId": "channelEscalateRuleUpdate", - "summary": "Update escalation rule", - "description": "Update an existing escalation rule configuration.", + "operationId": "enrichment-read-info", + "summary": "Get enrichment rules", + "description": "Return the enrichment rule set configured for a specific integration.", "tags": [ - "On-call/Channels" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-escalate-rule-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) or **Channels Manage** (`on-call`) or **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) |\n\n## Usage\n\n- Returns `null` if no enrichment rules have been configured for the integration.", + "href": "/en/api-reference/on-call/alert-enrichment/enrichment-read-info", "metadata": { - "sidebarTitle": "Update escalation rule" + "sidebarTitle": "Get enrichment rules" } }, "responses": { @@ -5203,7 +5061,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/EnrichmentItem" } } } @@ -5211,7 +5069,25 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "integration_id": 5001, + "rules": [ + { + "kind": "extraction", + "settings": { + "source_field": "labels.env", + "result_label": "environment", + "pattern": "^(prod|staging|dev).*$", + "override": true + } + } + ], + "status": "enabled", + "updated_by": 80011, + "creator_id": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 + } } } } @@ -5234,49 +5110,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateEscalationRuleRequest" + "$ref": "#/components/schemas/EnrichmentInfoRequest" }, "example": { - "channel_id": 1001, - "rule_id": "6621b23f4a2c5e0012ab34d0", - "template_id": "6621b23f4a2c5e0012ab34d1", - "rule_name": "Default escalation", - "layers": [ - { - "target": { - "person_ids": [ - 42 - ], - "by": { - "critical": [ - "voice" - ], - "warning": [ - "sms" - ] - } - } - } - ] + "integration_id": 5001 } } } } } }, - "/channel/escalate/rule/delete": { + "/enrichment/list": { "post": { - "operationId": "channelEscalateRuleDelete", - "summary": "Delete escalation rule", - "description": "Delete an escalation rule.", + "operationId": "enrichment-read-list", + "summary": "List enrichment rules", + "description": "Return the enrichment rule sets for a list of integration IDs.", "tags": [ - "On-call/Channels" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-escalate-rule-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/alert-enrichment/enrichment-read-list", "metadata": { - "sidebarTitle": "Delete escalation rule" + "sidebarTitle": "List enrichment rules" } }, "responses": { @@ -5293,7 +5149,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/EnrichmentListResponse" } } } @@ -5301,7 +5157,19 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "integration_id": 5001, + "rules": [], + "status": "enabled", + "updated_by": 80011, + "creator_id": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 + } + ] + } } } } @@ -5324,30 +5192,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/EnrichmentListRequest" }, "example": { - "channel_id": 3521074710131, - "rule_id": "6621b23f4a2c5e0012ab34cd" + "integration_ids": [ + 5001, + 5002 + ] } } } } } }, - "/channel/escalate/rule/enable": { + "/enrichment/mapping/api/create": { "post": { - "operationId": "channelEscalateRuleEnable", - "summary": "Enable escalation rule", - "description": "Enable a disabled escalation rule.", + "operationId": "mapping-api-write-create", + "summary": "Create mapping API", + "description": "Create a new external HTTP API endpoint used to enrich alerts via HTTP lookup.", "tags": [ - "On-call/Channels" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-escalate-rule-enable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- `url` must start with `http://` or `https://` and cannot resolve to an internal IP (in SaaS mode).\n- `timeout` is the HTTP read timeout in seconds (1–3, default 2).\n- `retry_count` is the number of retries on failure (0–1, default 0).\n- Headers with security-sensitive names (e.g. `authorization`, `cookie`) are rejected in SaaS mode.\n- An account can have at most 50 mapping APIs.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-api-write-create", "metadata": { - "sidebarTitle": "Enable escalation rule" + "sidebarTitle": "Create mapping API" } }, "responses": { @@ -5364,7 +5234,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/MappingAPICreateResponse" } } } @@ -5372,7 +5242,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "api_id": "665f1a2b3c4d5e6f7a8b9c02", + "api_name": "CMDB API" + } } } } @@ -5395,30 +5268,37 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/MappingAPICreateRequest" }, "example": { - "channel_id": 3521074710131, - "rule_id": "6621b23f4a2c5e0012ab34cd" + "api_name": "CMDB API", + "description": "Query CMDB for host metadata", + "url": "https://cmdb.example.com/api/lookup", + "headers": { + "X-Token": "mytoken" + }, + "timeout": 2, + "retry_count": 1, + "insecure_skip_verify": false } } } } } }, - "/channel/escalate/rule/disable": { + "/enrichment/mapping/api/delete": { "post": { - "operationId": "channelEscalateRuleDisable", - "summary": "Disable escalation rule", - "description": "Disable an escalation rule without deleting it.", + "operationId": "mapping-api-write-delete", + "summary": "Delete mapping API", + "description": "Delete a mapping API. Deletion is blocked if the API is referenced by any enrichment rule.", "tags": [ - "On-call/Channels" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/channel-escalate-rule-disable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- If the API is still referenced, the response returns HTTP 400 with a `refs` list.\n- Only the API creator, account admin, or team member can delete the API.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-api-write-delete", "metadata": { - "sidebarTitle": "Disable escalation rule" + "sidebarTitle": "Delete mapping API" } }, "responses": { @@ -5466,30 +5346,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/MappingAPIIDRequest" }, "example": { - "channel_id": 3521074710131, - "rule_id": "6621b23f4a2c5e0012ab34cd" + "api_id": "665f1a2b3c4d5e6f7a8b9c02" } } } } } }, - "/route/info": { + "/enrichment/mapping/api/info": { "post": { - "operationId": "routeInfo", - "summary": "Get routing rule detail", - "description": "Retrieve the routing rule configuration for a specific integration. Returns null when the integration has no routing rule configured.", + "operationId": "mapping-api-read-info", + "summary": "Get mapping API detail", + "description": "Return detail of a single mapping API by its ID.", "tags": [ - "On-call/Channels" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/route-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Returns `null` if the API does not exist.", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-api-read-info", "metadata": { - "sidebarTitle": "Get routing rule detail" + "sidebarTitle": "Get mapping API detail" } }, "responses": { @@ -5506,7 +5385,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RouteItem" + "$ref": "#/components/schemas/MappingAPIItem" } } } @@ -5515,51 +5394,16 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "integration_id": 6113996590131, - "cases": [ - { - "if": [ - { - "key": "labels.check", - "oper": "IN", - "vals": [ - "cpu.idle<20%" - ] - } - ], - "channel_ids": [ - 2533748993131 - ], - "fallthrough": false, - "routing_mode": "standard" - }, - { - "if": [ - { - "key": "severity", - "oper": "IN", - "vals": [ - "Warning" - ] - } - ], - "channel_ids": null, - "fallthrough": false, - "routing_mode": "name_mapping", - "name_mapping_label": "labels.service" - } - ], - "default": { - "channel_ids": [ - 3521074710131 - ] - }, + "api_id": "665f1a2b3c4d5e6f7a8b9c02", + "api_name": "CMDB API", + "url": "https://cmdb.example.com/api/lookup", + "timeout": 2, + "retry_count": 1, + "insecure_skip_verify": false, "status": "enabled", - "version": 6, - "updated_by": 3790925372131, - "creator_id": 3790925372131, - "created_at": 1774606136, - "updated_at": 1774606136 + "creator_id": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 } } } @@ -5583,29 +5427,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RouteInfoRequest" + "$ref": "#/components/schemas/MappingAPIIDRequest" }, "example": { - "integration_id": 6113996590131 + "api_id": "665f1a2b3c4d5e6f7a8b9c02" } } } } } }, - "/route/list": { + "/enrichment/mapping/api/list": { "post": { - "operationId": "routeList", - "summary": "List routing rules", - "description": "Return routing rules for the specified integrations. Integrations without a configured rule are omitted from the response.", + "operationId": "mapping-api-read-list", + "summary": "List mapping APIs", + "description": "Return all mapping APIs configured for the account.", "tags": [ - "On-call/Channels" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/route-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Read** (`on-call`) or **Mappings Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-api-read-list", "metadata": { - "sidebarTitle": "List routing rules" + "sidebarTitle": "List mapping APIs" } }, "responses": { @@ -5622,7 +5466,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListRoutesResponse" + "$ref": "#/components/schemas/MappingAPIListResponse" } } } @@ -5631,38 +5475,24 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "total": 1, "items": [ { - "integration_id": 6113996590131, - "cases": [ - { - "if": [ - { - "key": "labels.check", - "oper": "IN", - "vals": [ - "cpu.idle<20%" - ] - } - ], - "channel_ids": [ - 2533748993131 - ], - "fallthrough": false, - "routing_mode": "standard" - } - ], - "default": { - "channel_ids": [ - 3521074710131 - ] + "api_id": "665f1a2b3c4d5e6f7a8b9c02", + "api_name": "CMDB API", + "description": "Query CMDB for host metadata", + "url": "https://cmdb.example.com/api/lookup", + "headers": { + "X-Token": "***" }, + "timeout": 2, + "retry_count": 1, + "insecure_skip_verify": false, "status": "enabled", - "version": 6, - "updated_by": 3790925372131, - "creator_id": 3790925372131, - "created_at": 1774606136, - "updated_at": 1774606136 + "team_id": 0, + "creator_id": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 } ] } @@ -5688,32 +5518,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListRoutesRequest" + "$ref": "#/components/schemas/EmptyRequest" }, - "example": { - "integration_ids": [ - 6113996590131, - 6113996590132 - ] - } + "example": {} } } } } }, - "/route/upsert": { + "/enrichment/mapping/api/update": { "post": { - "operationId": "routeUpsert", - "summary": "Upsert routing rule", - "description": "Create or update routing rules for an integration to direct alerts to specific channels. At least one of `cases` or `default` must be provided.", + "operationId": "mapping-api-write-update", + "summary": "Update mapping API", + "description": "Update configuration of an existing mapping API.", "tags": [ - "On-call/Channels" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/channels/route-upsert", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- Only the API creator, account admin, or team member can update the API.\n- All updatable fields are optional — only provided fields are changed.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-api-write-update", "metadata": { - "sidebarTitle": "Upsert routing rule" + "sidebarTitle": "Update mapping API" } }, "responses": { @@ -5761,52 +5586,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpsertRouteRequest" + "$ref": "#/components/schemas/MappingAPIUpdateRequest" }, "example": { - "integration_id": 6113996590131, - "cases": [ - { - "if": [ - { - "key": "severity", - "oper": "IN", - "vals": [ - "Critical" - ] - } - ], - "channel_ids": [ - 3521074710131 - ], - "fallthrough": false, - "routing_mode": "standard" - } - ], - "default": { - "channel_ids": [ - 3521074710131 - ] - } + "api_id": "665f1a2b3c4d5e6f7a8b9c02", + "timeout": 3, + "retry_count": 1 } } } } } }, - "/alert/list": { + "/enrichment/mapping/data/delete": { "post": { - "operationId": "alert-read-list", - "summary": "List alerts", - "description": "Return a cursor-paginated list of alerts matching the given filters.", + "operationId": "mapping-data-write-delete", + "summary": "Delete mapping data rows", + "description": "Delete up to 100 mapping data rows by their keys.", "tags": [ - "On-call/Alerts" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- Both `start_time` and `end_time` are required Unix epoch seconds. Maximum span is 31 days.\n- Use `search_after_ctx` from the previous response to fetch the next page.\n- Results are filtered by the caller's channel data-access permissions.\n- Set `is_active` to `true` to retrieve only active (firing) alerts; `false` to retrieve resolved alerts.", - "href": "/en/api-reference/on-call/alerts/alert-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-data-write-delete", "metadata": { - "sidebarTitle": "List alerts" + "sidebarTitle": "Delete mapping data rows" } }, "responses": { @@ -5823,7 +5627,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -5831,35 +5635,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 1, - "has_next_page": false, - "search_after_ctx": "", - "items": [ - { - "alert_id": "663a1b2c3d4e5f6789abcdef", - "integration_id": 10001, - "channel_id": 20001, - "account_id": 10023, - "title": "CPU usage > 90%", - "alert_severity": "Critical", - "alert_status": "Critical", - "start_time": 1712650000, - "last_time": 1712655000, - "end_time": 0, - "labels": { - "host": "web-01" - }, - "ever_muted": false, - "created_at": 1712650000, - "updated_at": 1712655000, - "integration_name": "Prometheus", - "integration_type": "prometheus", - "channel_name": "Production", - "event_cnt": 3 - } - ] - } + "data": {} } } } @@ -5882,32 +5658,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertListRequest" + "$ref": "#/components/schemas/MappingDataDeleteRequest" }, "example": { - "start_time": 1712620800, - "end_time": 1712707200, - "limit": 20, - "is_active": true + "schema_id": "665f1a2b3c4d5e6f7a8b9c01", + "keys": [ + "server01", + "server02" + ] } } } } } }, - "/alert/info": { + "/enrichment/mapping/data/download": { "post": { - "operationId": "alert-read-info", - "summary": "Get alert detail", - "description": "Return the full details of a single alert by its ID, including its associated incident and event count.", + "operationId": "mapping-data-read-download", + "summary": "Download mapping data as CSV", + "description": "Export all data rows of a mapping schema as a CSV file download.", "tags": [ - "On-call/Alerts" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- `alert_id` is an ObjectID hex string returned by `POST /alert/list` or `POST /alert-event/list`.", - "href": "/en/api-reference/on-call/alerts/alert-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) or **Mappings Read** (`on-call`) or **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- The response is a CSV file with `Content-Disposition: attachment` header.\n- The CSV header row matches the schema's source and result labels in order.", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-data-read-download", "metadata": { - "sidebarTitle": "Get alert detail" + "sidebarTitle": "Download mapping data as CSV" } }, "responses": { @@ -5924,7 +5701,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertItem" + "$ref": "#/components/schemas/CsvFileResponse" } } } @@ -5932,14 +5709,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "alert_id": "663a1b2c3d4e5f6789abcdef", - "title": "CPU usage > 90%", - "alert_severity": "Critical", - "alert_status": "Critical", - "start_time": 1712650000, - "event_cnt": 3 - } + "data": "host,owner,team,service\nserver01,alice,sre,api\n" } } } @@ -5962,29 +5732,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertInfoRequest" + "$ref": "#/components/schemas/MappingSchemaIDRequest" }, "example": { - "alert_id": "663a1b2c3d4e5f6789abcdef" + "schema_id": "665f1a2b3c4d5e6f7a8b9c01" } } } } } }, - "/alert/list-by-ids": { + "/enrichment/mapping/data/list": { "post": { - "operationId": "alert-read-list-by-ids", - "summary": "List alerts by IDs", - "description": "Return the details of multiple alerts by their IDs in a single request.", + "operationId": "mapping-data-read-list", + "summary": "List mapping data", + "description": "Return paginated mapping data rows for a schema, with optional exact-match filtering on source label values.", "tags": [ - "On-call/Alerts" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- All provided `alert_ids` must belong to the caller's account; any invalid ID causes the entire request to fail.", - "href": "/en/api-reference/on-call/alerts/alert-read-list-by-ids", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) or **Mappings Read** (`on-call`) or **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- If `query` is provided, all source labels must be specified — partial source label queries are rejected.\n- Pagination uses cursor-based (`search_after_ctx`) or page-based (`p`, `limit`) navigation. `limit` defaults to 20, max 100.\n- The `search_after_ctx` token from a response can be passed back to retrieve the next page.", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-data-read-list", "metadata": { - "sidebarTitle": "List alerts by IDs" + "sidebarTitle": "List mapping data" } }, "responses": { @@ -6001,7 +5771,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertListResponse" + "$ref": "#/components/schemas/MappingDataListResponse" } } } @@ -6010,14 +5780,21 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 1, - "has_next_page": false, "items": [ { - "alert_id": "663a1b2c3d4e5f6789abcdef", - "title": "CPU usage > 90%" + "key": "server01", + "fields": { + "host": "server01", + "owner": "alice", + "team": "sre", + "service": "api" + }, + "created_at": 1710000000, + "updated_at": 1710000000 } - ] + ], + "total": 1, + "has_next_page": false } } } @@ -6041,31 +5818,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertListByIDsRequest" + "$ref": "#/components/schemas/MappingDataListRequest" }, "example": { - "alert_ids": [ - "663a1b2c3d4e5f6789abcdef" - ] + "schema_id": "665f1a2b3c4d5e6f7a8b9c01", + "orderby": "updated_at", + "asc": false, + "p": 1, + "limit": 20 } } } } } }, - "/alert/event/list": { + "/enrichment/mapping/data/truncate": { "post": { - "operationId": "alert-read-event-list", - "summary": "List events for an alert", - "description": "Return all raw events that have been ingested into a specific alert, in chronological order.", + "operationId": "mapping-data-write-truncate", + "summary": "Truncate mapping data", + "description": "Delete all data rows in a mapping schema.", "tags": [ - "On-call/Alerts" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- Each alert accumulates raw events from the integration. This endpoint exposes the raw event history for a given alert.", - "href": "/en/api-reference/on-call/alerts/alert-read-event-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- This is an irreversible bulk-delete operation.\n- High-risk operation. Console JWT callers must pass a second-factor code; `app_key` callers bypass the MFA prompt but remain audited — treat the key as a secret.", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-data-write-truncate", "metadata": { - "sidebarTitle": "List events for an alert" + "sidebarTitle": "Truncate mapping data" } }, "responses": { @@ -6082,7 +5861,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertEventListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -6090,21 +5869,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "event_id": "663a1b2c3d4e5f6789abc001", - "alert_id": "663a1b2c3d4e5f6789abcdef", - "title": "CPU usage > 90%", - "event_severity": "Critical", - "event_status": "Critical", - "event_time": 1712650000, - "labels": { - "host": "web-01" - } - } - ] - } + "data": {} } } } @@ -6127,29 +5892,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertEventListRequest" + "$ref": "#/components/schemas/MappingSchemaIDRequest" }, "example": { - "alert_id": "663a1b2c3d4e5f6789abcdef" + "schema_id": "665f1a2b3c4d5e6f7a8b9c01" } } } } } }, - "/alert/feed": { + "/enrichment/mapping/data/upload": { "post": { - "operationId": "alert-read-feed", - "summary": "List alert activity feed", - "description": "Return the activity feed (comments, state changes, merges, silence events) for a single alert, with page-based pagination.", + "operationId": "mapping-data-write-upload", + "summary": "Upload mapping data via CSV", + "description": "Upload a CSV file to bulk-load mapping data. By default the existing data is truncated before loading the new rows.", "tags": [ - "On-call/Alerts" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- Use `p` (page number, starting at 1) and `limit` (max 100, default 20) for pagination.\n- Set `asc` to `true` for chronological order.\n- Use `types` to filter by specific feed types (e.g. `alert_comment`, `alert_merge`).", - "href": "/en/api-reference/on-call/alerts/alert-read-feed", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **20 requests/minute**; **2 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- The request must use `Content-Type: multipart/form-data`. The file field name is `file` and `schema_id` is a query parameter.\n- CSV header row must include all source and result label names.\n- Maximum file size: 100 MB.\n- By default the schema's existing data is truncated before import. Pass query param `do_not_truncate_first=TRUE` to append instead.\n- Duplicate source label value combinations in the CSV cause a 400 error.", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-data-write-upload", "metadata": { - "sidebarTitle": "List alert activity feed" + "sidebarTitle": "Upload mapping data via CSV" } }, "responses": { @@ -6166,7 +5931,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertFeedResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -6174,20 +5939,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "has_next_page": false, - "items": [ - { - "ref_id": "663a1b2c3d4e5f6789abcdef", - "type": "alert_comment", - "detail": { - "comment": "Investigating now." - }, - "creator_id": 80011, - "created_at": 1712651000 - } - ] - } + "data": {} } } } @@ -6210,31 +5962,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertFeedRequest" + "$ref": "#/components/schemas/MappingDataUploadRequest" }, "example": { - "alert_id": "663a1b2c3d4e5f6789abcdef", - "limit": 20, - "asc": false + "schema_id": "665f1a2b3c4d5e6f7a8b9c01" } } } } } }, - "/alert/merge": { + "/enrichment/mapping/data/upsert": { "post": { - "operationId": "alert-write-merge", - "summary": "Merge alerts into an incident", - "description": "Associate one or more alerts with an existing incident. If a source alert previously belonged to a different incident and that incident becomes empty after the merge, it will be automatically closed.", + "operationId": "mapping-data-write-upsert", + "summary": "Upsert mapping data rows", + "description": "Insert or update up to 1000 data rows in a mapping schema. Each row must contain all source and result labels.", "tags": [ - "On-call/Alerts" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- All `alert_ids` and the `incident_id` must belong to the caller's account.\n- Optionally set `title` and `owner_id` to update the target incident at the same time.", - "href": "/en/api-reference/on-call/alerts/alert-write-merge", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- Each doc must contain values for all labels defined in `source_labels` and `result_labels`.\n- Values for unknown labels are silently dropped.\n- Each value must be at most 2048 characters.\n- Upsert is keyed on the combination of source label values — existing rows with the same source key are updated.\n- A schema can hold at most 10,000 rows by default.\n- The operation is locked per schema; concurrent upserts to the same schema may fail with `ErrRequestTooFrequently`.", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-data-write-upsert", "metadata": { - "sidebarTitle": "Merge alerts into an incident" + "sidebarTitle": "Upsert mapping data rows" } }, "responses": { @@ -6251,7 +6001,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/MappingDataUpsertResponse" } } } @@ -6259,7 +6009,12 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "keys": [ + "server01", + "server02" + ] + } } } } @@ -6282,32 +6037,43 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertMergeRequest" + "$ref": "#/components/schemas/MappingDataUpsertRequest" }, "example": { - "alert_ids": [ - "663a1b2c3d4e5f6789abcdef" - ], - "incident_id": "663a000000000000deadbeef" + "schema_id": "665f1a2b3c4d5e6f7a8b9c01", + "docs": [ + { + "host": "server01", + "owner": "alice", + "team": "sre", + "service": "api" + }, + { + "host": "server02", + "owner": "bob", + "team": "platform", + "service": "gateway" + } + ] } } } } } }, - "/alert/pipeline/info": { + "/enrichment/mapping/schema/create": { "post": { - "operationId": "alert-read-pipeline-info", - "summary": "Get alert pipeline", - "description": "Return the alert processing pipeline configured for a specific integration.", + "operationId": "mapping-schema-write-create", + "summary": "Create mapping schema", + "description": "Create a new mapping schema defining source lookup labels and the result labels to populate. Requires a Pro plan.", "tags": [ - "On-call/Alerts" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) |\n\n## Usage\n\n- Returns `null` data if no pipeline has been configured for the given integration.\n- Requires the caller to have access to the integration.", - "href": "/en/api-reference/on-call/alerts/alert-read-pipeline-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- Schema names must be unique within an account.\n- `source_labels` (1–3 labels) are used as lookup keys; `result_labels` (1–10 labels) are the labels written on match.\n- Label names must match `^[a-z][a-z0-9_]{0,39}$` (lowercase).\n- `source_labels` and `result_labels` must not overlap.\n- An account can have at most 20 mapping schemas.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-schema-write-create", "metadata": { - "sidebarTitle": "Get alert pipeline" + "sidebarTitle": "Create mapping schema" } }, "responses": { @@ -6324,7 +6090,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertPipelineItem" + "$ref": "#/components/schemas/MappingSchemaCreateResponse" } } } @@ -6333,21 +6099,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "integration_id": 10001, - "rules": [ - { - "kind": "severity_reset", - "if": null, - "settings": { - "severity": "Warning" - } - } - ], - "status": "enabled", - "creator_id": 80011, - "updated_by": 80011, - "created_at": 1710000000, - "updated_at": 1712000000 + "schema_id": "665f1a2b3c4d5e6f7a8b9c01", + "schema_name": "CMDB Lookup" } } } @@ -6371,29 +6124,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertPipelineInfoRequest" + "$ref": "#/components/schemas/MappingSchemaCreateRequest" }, "example": { - "integration_id": 10001 + "schema_name": "CMDB Lookup", + "description": "Enrich alerts with CMDB data", + "source_labels": [ + "host" + ], + "result_labels": [ + "owner", + "team", + "service" + ] } } } } } }, - "/alert/pipeline/list": { + "/enrichment/mapping/schema/delete": { "post": { - "operationId": "alert-read-pipeline-list", - "summary": "List alert pipelines", - "description": "Return the alert processing pipelines configured for multiple integrations.", + "operationId": "mapping-schema-write-delete", + "summary": "Delete mapping schema", + "description": "Delete a mapping schema and all its associated data. Deletion is blocked if the schema is referenced by any enrichment rule or webhook.", "tags": [ - "On-call/Alerts" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) |\n\n## Usage\n\n- All `integration_ids` must be accessible to the caller.", - "href": "/en/api-reference/on-call/alerts/alert-read-pipeline-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- If the schema is still referenced, the response returns HTTP 400 with a `refs` list of blocking references.\n- Only the schema creator, account admin, or team member can delete the schema.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.\n- High-risk operation. Console JWT callers must pass a second-factor code; `app_key` callers bypass the MFA prompt but remain audited — treat the key as a secret.", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-schema-write-delete", "metadata": { - "sidebarTitle": "List alert pipelines" + "sidebarTitle": "Delete mapping schema" } }, "responses": { @@ -6410,7 +6172,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertPipelineListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -6418,19 +6180,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "integration_id": 10001, - "rules": [], - "status": "enabled", - "creator_id": 80011, - "updated_by": 80011, - "created_at": 1710000000, - "updated_at": 1712000000 - } - ] - } + "data": {} } } } @@ -6453,32 +6203,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertPipelineListRequest" + "$ref": "#/components/schemas/MappingSchemaIDRequest" }, "example": { - "integration_ids": [ - 10001, - 10002 - ] + "schema_id": "665f1a2b3c4d5e6f7a8b9c01" } } } } } }, - "/alert/pipeline/upsert": { + "/enrichment/mapping/schema/info": { "post": { - "operationId": "alert-write-pipeline-upsert", - "summary": "Create or update alert pipeline", - "description": "Set the alert processing pipeline for an integration. Replaces the existing configuration entirely.", + "operationId": "mapping-schema-read-info", + "summary": "Get mapping schema detail", + "description": "Return detail of a single mapping schema by its ID.", "tags": [ - "On-call/Alerts" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Manage** (`on-call`) |\n\n## Usage\n\n- Maximum 50 rules per pipeline.\n- Each rule has a `kind` (one of `title_reset`, `description_reset`, `severity_reset`, `alert_drop`, `alert_inhibit`), an optional `if` filter, and `settings` specific to the kind.\n- The `alert_inhibit` kind requires the Standard license or higher.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/alerts/alert-write-pipeline-upsert", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) or **Mappings Read** (`on-call`) or **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- Returns `null` if the schema does not exist.", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-schema-read-info", "metadata": { - "sidebarTitle": "Create or update alert pipeline" + "sidebarTitle": "Get mapping schema detail" } }, "responses": { @@ -6495,7 +6242,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/MappingSchemaItem" } } } @@ -6503,7 +6250,24 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "schema_id": "665f1a2b3c4d5e6f7a8b9c01", + "schema_name": "CMDB Lookup", + "description": "Enrich alerts with CMDB data", + "source_labels": [ + "host" + ], + "result_labels": [ + "owner", + "team", + "service" + ], + "status": "enabled", + "team_id": 0, + "creator_id": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 + } } } } @@ -6526,38 +6290,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertPipelineUpsertRequest" + "$ref": "#/components/schemas/MappingSchemaIDRequest" }, "example": { - "integration_id": 10001, - "rules": [ - { - "kind": "severity_reset", - "if": null, - "settings": { - "severity": "Warning" - } - } - ] + "schema_id": "665f1a2b3c4d5e6f7a8b9c01" } } } } } }, - "/alert-event/list": { + "/enrichment/mapping/schema/list": { "post": { - "operationId": "alert-event-read-list", - "summary": "List raw alert events", - "description": "Return a cursor-paginated list of raw alert events across all alerts, with filtering by integration, channel, time range, and severity.", + "operationId": "mapping-schema-read-list", + "summary": "List mapping schemas", + "description": "Return all mapping schemas for the account, sorted by creation time ascending.", "tags": [ - "On-call/Alerts" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- Results are filtered by the caller's channel data-access permissions.\n- `severities` is a comma-separated string, e.g. `\"Critical,Warning\"`.", - "href": "/en/api-reference/on-call/alerts/alert-event-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) or **Channels Manage** (`on-call`) or **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) or **Mappings Read** (`on-call`) or **Mappings Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-schema-read-list", "metadata": { - "sidebarTitle": "List raw alert events" + "sidebarTitle": "List mapping schemas" } }, "responses": { @@ -6574,7 +6329,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertEventGlobalListResponse" + "$ref": "#/components/schemas/MappingSchemaListResponse" } } } @@ -6584,14 +6339,24 @@ "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { "total": 1, - "has_next_page": false, "items": [ { - "event_id": "663a1b2c3d4e5f6789abc001", - "alert_id": "663a1b2c3d4e5f6789abcdef", - "title": "CPU usage > 90%", - "event_severity": "Critical", - "event_time": 1712650000 + "schema_id": "665f1a2b3c4d5e6f7a8b9c01", + "schema_name": "CMDB Lookup", + "description": "Enrich alerts with CMDB data", + "source_labels": [ + "host" + ], + "result_labels": [ + "owner", + "team", + "service" + ], + "status": "enabled", + "team_id": 0, + "creator_id": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 } ] } @@ -6617,32 +6382,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertEventGlobalListRequest" + "$ref": "#/components/schemas/EmptyRequest" }, - "example": { - "start_time": 1712620800, - "end_time": 1712707200, - "limit": 20, - "severities": "Critical" - } + "example": {} } } } } }, - "/webhook/history/list": { + "/enrichment/mapping/schema/update": { "post": { - "operationId": "webhookHistoryList", - "summary": "List webhook delivery history", - "description": "List the delivery history for outbound webhook notifications.", + "operationId": "mapping-schema-write-update", + "summary": "Update mapping schema", + "description": "Update the name, description, or owning team of a mapping schema. Source and result labels cannot be changed after creation.", "tags": [ - "On-call/Integrations" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) |", - "href": "/en/api-reference/on-call/integrations/webhook-history-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- Only the schema creator, account admin, or team member can update the schema.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/alert-enrichment/mapping-schema-write-update", "metadata": { - "sidebarTitle": "List webhook delivery history" + "sidebarTitle": "Update mapping schema" } }, "responses": { @@ -6659,7 +6419,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListWebhookHistoryResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -6667,26 +6427,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "integration_id": 5321026051131, - "event_id": "20260412Xatt9hrXsgmFkBR78WF655", - "webhook_type": "alert", - "event_type": "a_update", - "channel_id": 2551105804131, - "ref_id": "69da3f0ef77b1b51f40e83cc", - "endpoint": "https://example.com/webhook", - "attempt": 1, - "duration": 132, - "status": "success", - "status_code": 200, - "event_time": "2026-04-12T13:31:11.357472+08:00" - } - ], - "search_after_ctx": "eyJldmVudF90aW1lIjoiMjAyNi0wNC0xMlQxMzoxNToyNi4zODI1NDcrMDg6MDAiLCJldmVudF9pZCI6IjIwMjYwNDEybUdzeFAzZHJwRmZzNFpDUWQycFNEcCJ9", - "total": 346 - } + "data": {} } } } @@ -6709,33 +6450,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListWebhookHistoryRequest" + "$ref": "#/components/schemas/MappingSchemaUpdateRequest" }, "example": { - "limit": 20, - "start_time": 1775116800000, - "end_time": 1775203200000, - "integration_id": 6113996590131, - "status": "success" + "schema_id": "665f1a2b3c4d5e6f7a8b9c01", + "schema_name": "CMDB Lookup v2", + "description": "Updated description" } } } } } }, - "/webhook/history/detail": { + "/enrichment/upsert": { "post": { - "operationId": "webhookHistoryDetail", - "summary": "Get webhook delivery detail", - "description": "Retrieve the detailed payload and response for a specific webhook delivery attempt.", + "operationId": "enrichment-write-upsert", + "summary": "Upsert enrichment rules", + "description": "Create or fully replace the enrichment rule set for an integration. The entire `rules` array is replaced atomically.", "tags": [ - "On-call/Integrations" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) |", - "href": "/en/api-reference/on-call/integrations/webhook-history-detail", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) or **Integrations Manage** (`on-call`) |\n\n## Usage\n\n- Enrichment rules are evaluated in order.\n- Each rule has a `kind`: `extraction` (regex/gjson extraction), `composition` (template-based label composition), `mapping` (lookup via mapping schema or API), or `drop` (remove labels).\n- The optional `if` field is an `AndFilters` condition: if it does not match, the rule is skipped.\n- For `kind: extraction`: `source_field` must be `title`, `description`, or a `labels.*` key; specify exactly one of `pattern` (regex with named group `result`) or `g_json` (GJson path).\n- For `kind: composition`: `template` uses Go text/template syntax referencing `labels.*` keys.\n- For `kind: mapping`: `mapping_type` is `schema` (default) or `api`; provide `schema_id` or `api_id` accordingly.\n- For `kind: drop`: `drop_labels` lists the label keys to remove.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/alert-enrichment/enrichment-write-upsert", "metadata": { - "sidebarTitle": "Get webhook delivery detail" + "sidebarTitle": "Upsert enrichment rules" } }, "responses": { @@ -6752,7 +6491,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/WebhookHistoryDetail" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -6760,26 +6499,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "integration_id": 5321026051131, - "event_id": "20260412Xatt9hrXsgmFkBR78WF655", - "webhook_type": "alert", - "event_type": "a_update", - "channel_id": 2551105804131, - "ref_id": "69da3f0ef77b1b51f40e83cc", - "request_headers": "{\"Content-Type\":\"application/json\"}", - "request_body": "{\"event_type\":\"a_update\",\"event_id\":\"d789d65951c0532ea9b6a1d99b707054\"}", - "endpoint": "https://example.com/webhook", - "attempt": 1, - "duration": 132, - "status": "success", - "status_code": 200, - "response_headers": "{\"Content-Type\":\"application/json\"}", - "response_body": "{\"ok\":true}", - "event_time": "2026-04-12T13:31:11.357472+08:00", - "ref_title": "High CPU Usage on host-01", - "channel_name": "Production Alerts" - } + "data": {} } } } @@ -6802,30 +6522,48 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetWebhookHistoryDetailRequest" + "$ref": "#/components/schemas/EnrichmentUpsertRequest" }, "example": { - "event_id": "20260412Xatt9hrXsgmFkBR78WF655", - "integration_id": 6113996590131 + "integration_id": 5001, + "rules": [ + { + "kind": "extraction", + "settings": { + "source_field": "labels.env", + "result_label": "environment", + "pattern": "(?Pprod|staging|dev)", + "override": true + } + }, + { + "kind": "composition", + "settings": { + "result_label": "full_env", + "template": "{{.labels.region}}-{{.labels.environment}}", + "override": false + } + } + ] } } } } } }, - "/schedule/create": { + "/field/create": { "post": { - "operationId": "scheduleCreate", - "summary": "Create schedule", - "description": "Create a new on-call schedule (escalation rule schedule).", + "operationId": "field-write-create", + "summary": "Create field", + "description": "Create a new incident custom field on the account.", "tags": [ - "On-call/Schedules" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Schedules Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/schedules/schedule-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Maximum **15** custom fields per account.\n- `field_name` must match `^[a-zA-Z_][a-zA-Z0-9_]{0,39}$` and is immutable after creation; `display_name` must also be unique within the account.\n- Type-specific rules: `checkbox` requires `value_type=bool` and no `options`; `single_select`/`multi_select` require `value_type=string` and a non-empty unique `options` list; `text` requires `value_type=string` and no `options`.\n- Response contains only `field_id` and `field_name`; use `/field/info` to fetch the full object.\n- Audited — changes are recorded in the audit log.", + "href": "/en/api-reference/on-call/alert-enrichment/field-write-create", "metadata": { - "sidebarTitle": "Create schedule" + "sidebarTitle": "Create field" } }, "responses": { @@ -6842,7 +6580,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleIDResponse" + "$ref": "#/components/schemas/CreateFieldResponse" } } } @@ -6851,7 +6589,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "schedule_id": 6294534917601 + "field_id": "66e9d3a4f7c2b04a1c8a91b3", + "field_name": "severity_class" } } } @@ -6875,100 +6614,40 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleUpsertRequest" + "$ref": "#/components/schemas/CreateFieldRequest" }, "example": { - "schedule_name": "Production On-Call", - "description": "Primary on-call rotation for the production team", - "team_id": 4291079133131, - "layers": [ - { - "layer_name": "Layer 1", - "name": "Layer 1", - "mode": 0, - "weight": 0, - "hidden": 0, - "groups": [ - { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2451002751131 - ] - } - ], - "start": 0, - "end": 0 - }, - { - "group_name": "B", - "name": "B", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2476123212131 - ] - } - ], - "start": 0, - "end": 0 - } - ], - "rotation_unit": "day", - "rotation_value": 1, - "rotation_duration": 86400, - "handoff_time": 0, - "enable_time": 1712000000, - "expire_time": 0, - "restrict_mode": 0, - "restrict_start": 0, - "restrict_end": 0, - "restrict_periods": [], - "day_mask": { - "repeat": [ - 1, - 2, - 3, - 4, - 5 - ] - }, - "fair_rotation": false, - "mask_continuous_enabled": false - } + "field_name": "severity_class", + "display_name": "Severity Class", + "description": "Business severity tier.", + "field_type": "single_select", + "value_type": "string", + "options": [ + "Critical", + "High", + "Medium", + "Low" ], - "notify": { - "advance_in_time": 300, - "fixed_time": null, - "by": { - "follow_preference": true, - "personal_channels": null - }, - "webhooks": null - } + "default_value": "Medium" } } } } } }, - "/schedule/update": { + "/field/delete": { "post": { - "operationId": "scheduleUpdate", - "summary": "Update schedule", - "description": "Update an existing on-call schedule. Provide schedule_id to identify the schedule.", + "operationId": "field-write-delete", + "summary": "Delete field", + "description": "Delete an incident custom field and asynchronously strip it from existing incidents.", "tags": [ - "On-call/Schedules" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Schedules Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/schedules/schedule-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- The field is marked deleted synchronously; clearing its values from historical incidents runs in the background and may take time on large datasets.\n- Re-creating a field with the same `field_name` is only allowed if `field_type` and `value_type` match the deleted entry.\n- Audited — changes are recorded in the audit log.", + "href": "/en/api-reference/on-call/alert-enrichment/field-write-delete", "metadata": { - "sidebarTitle": "Update schedule" + "sidebarTitle": "Delete field" } }, "responses": { @@ -6985,7 +6664,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleEmptyObject" + "type": "object" } } } @@ -7016,32 +6695,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleUpsertRequest" + "$ref": "#/components/schemas/DeleteFieldRequest" }, "example": { - "schedule_id": 2001, - "schedule_name": "Production On-Call (Updated)", - "description": "Updated primary on-call rotation", - "team_id": 4291079133131 + "field_id": "66e9d3a4f7c2b04a1c8a91b3" } } } } } }, - "/schedule/preview": { + "/field/info": { "post": { - "operationId": "schedulePreview", - "summary": "Preview schedule", - "description": "Preview the coverage generated by a schedule configuration without persisting it. The request accepts the same body as create/update plus a required start/end window (max 45 days).", + "operationId": "field-read-info", + "summary": "Get field detail", + "description": "Return the configuration of a single incident custom field by ID.", "tags": [ - "On-call/Schedules" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **60 requests/minute**; **10 requests/second** per account |\n| Permissions | **Schedules Read** (`on-call`) or **Schedules Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/schedules/schedule-preview", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) or **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Only fields whose status is not `deleted` are returned; a deleted or unknown `field_id` yields a 400 error.\n- The shape of `options` and `default_value` varies by `field_type` — see the `FieldItem` schema.", + "href": "/en/api-reference/on-call/alert-enrichment/field-read-info", "metadata": { - "sidebarTitle": "Preview schedule" + "sidebarTitle": "Get field detail" } }, "responses": { @@ -7058,7 +6734,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleItem" + "$ref": "#/components/schemas/FieldItem" } } } @@ -7067,167 +6743,25 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "id": null, - "name": null, - "account_id": 0, - "group_id": null, - "disabled": null, - "create_at": 0, - "create_by": 0, - "update_at": 0, - "update_by": 0, - "layers": [ - { - "account_id": 0, - "name": "Layer 1", - "schedule_id": 0, - "hidden": 0, - "mode": 0, - "weight": 0, - "groups": [ - { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2451002751131 - ] - } - ], - "start": 0, - "end": 0 - }, - { - "group_name": "B", - "name": "B", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2476123212131 - ] - } - ], - "start": 0, - "end": 0 - } - ], - "rotation_duration": 86400, - "handoff_time": 0, - "enable_time": 1775980800, - "expire_time": 0, - "restrict_mode": 0, - "restrict_start": 0, - "restrict_end": 0, - "restrict_periods": [], - "day_mask": { - "repeat": [ - 1, - 2, - 3, - 4, - 5 - ] - }, - "create_at": 0, - "create_by": 0, - "update_at": 0, - "update_by": 0, - "layer_name": "Layer 1", - "fair_rotation": false, - "layer_start": 1775980800, - "layer_end": null, - "rotation_unit": "day", - "rotation_value": 1, - "mask_continuous_enabled": false - } + "account_id": 80001, + "field_id": "66e9d3a4f7c2b04a1c8a91b3", + "field_name": "severity_class", + "display_name": "Severity Class", + "description": "Business severity tier.", + "field_type": "single_select", + "value_type": "string", + "options": [ + "Critical", + "High", + "Medium", + "Low" ], - "schedule_layers": [ - { - "layer_name": "Layer 1", - "name": "Layer 1", - "mode": 0, - "schedules": [ - { - "start": 1776009600, - "end": 1776096000, - "group": { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2451002751131 - ] - } - ], - "start": 1776009600, - "end": 1776096000 - }, - "index": 0 - }, - { - "start": 1776096000, - "end": 1776182400, - "group": { - "group_name": "B", - "name": "B", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2476123212131 - ] - } - ], - "start": 1776096000, - "end": 1776182400 - }, - "index": 0 - } - ] - } - ], - "final_schedule": { - "layer_name": "", - "name": "", - "mode": 0, - "schedules": [ - { - "start": 1776009600, - "end": 1776096000, - "group": { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2451002751131 - ] - } - ], - "start": 1776009600, - "end": 1776096000 - }, - "index": 0 - } - ] - }, - "start": 1775980800, - "end": 1776240000, - "notify": null, - "schedule_id": 0, - "schedule_name": null, - "team_id": null, - "description": null, - "layer_schedules": null, - "status": null, - "cur_oncall": null, - "next_oncall": null + "default_value": "Medium", + "status": "enabled", + "creator_id": 80011, + "updated_by": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 } } } @@ -7251,77 +6785,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleUpsertRequest" + "$ref": "#/components/schemas/FieldInfoRequest" }, "example": { - "schedule_name": "Preview Schedule", - "start": 1712000000, - "end": 1712086400, - "layers": [ - { - "layer_name": "Layer 1", - "name": "Layer 1", - "mode": 0, - "weight": 0, - "hidden": 0, - "groups": [ - { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2451002751131 - ] - } - ], - "start": 0, - "end": 0 - } - ], - "rotation_unit": "day", - "rotation_value": 1, - "rotation_duration": 86400, - "handoff_time": 0, - "enable_time": 1712000000, - "expire_time": 0, - "restrict_mode": 0, - "restrict_start": 0, - "restrict_end": 0, - "restrict_periods": [], - "day_mask": { - "repeat": [ - 1, - 2, - 3, - 4, - 5 - ] - }, - "fair_rotation": false, - "mask_continuous_enabled": false - } - ] + "field_id": "66e9d3a4f7c2b04a1c8a91b3" } } } } } }, - "/schedule/delete": { + "/field/list": { "post": { - "operationId": "scheduleDelete", - "summary": "Delete schedules", - "description": "Delete one or more on-call schedules by ID.", + "operationId": "field-read-list", + "summary": "List fields", + "description": "Return all incident custom fields configured for the account.", "tags": [ - "On-call/Schedules" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Schedules Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/schedules/schedule-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) or **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- All non-deleted fields are returned in a single response — there is no pagination and no `total` counter.\n- `query` matches against `field_name` and `display_name`; invalid regular expressions are auto-escaped to a literal substring match.", + "href": "/en/api-reference/on-call/alert-enrichment/field-read-list", "metadata": { - "sidebarTitle": "Delete schedules" + "sidebarTitle": "List fields" } }, "responses": { @@ -7338,7 +6824,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleEmptyObject" + "$ref": "#/components/schemas/FieldListResponse" } } } @@ -7346,7 +6832,31 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "account_id": 80001, + "field_id": "66e9d3a4f7c2b04a1c8a91b3", + "field_name": "severity_class", + "display_name": "Severity Class", + "description": "Business severity tier.", + "field_type": "single_select", + "value_type": "string", + "options": [ + "Critical", + "High", + "Medium", + "Low" + ], + "default_value": "Medium", + "status": "enabled", + "creator_id": 80011, + "updated_by": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 + } + ] + } } } } @@ -7369,31 +6879,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleIDsBodyRequest" + "$ref": "#/components/schemas/FieldListRequest" }, "example": { - "schedule_ids": [ - 2001 - ] + "orderby": "updated_at", + "asc": false, + "query": "severity" } } } } } }, - "/schedule/info": { + "/field/update": { "post": { - "operationId": "scheduleInfo", - "summary": "Get schedule info", - "description": "Return details of an on-call schedule including the computed schedule layers for the requested time window (max 45 days).", + "operationId": "field-write-update", + "summary": "Update field", + "description": "Update mutable attributes of an existing incident custom field.", "tags": [ - "On-call/Schedules" + "On-call/Alert enrichment" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Schedules Read** (`on-call`) or **Schedules Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/schedules/schedule-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Only `display_name`, `description`, `options`, and `default_value` can be changed; `field_name`, `field_type`, and `value_type` are immutable.\n- `options` and `default_value` must remain consistent with the field's existing type — same rules as create.\n- Audited — changes are recorded in the audit log.", + "href": "/en/api-reference/on-call/alert-enrichment/field-write-update", "metadata": { - "sidebarTitle": "Get schedule info" + "sidebarTitle": "Update field" } }, "responses": { @@ -7410,7 +6920,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleItem" + "type": "object" } } } @@ -7418,258 +6928,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "id": 5789640530410, - "name": "test-000001", - "account_id": 2451002751131, - "group_id": 4291079133131, - "disabled": 0, - "create_at": 1766110836, - "create_by": 2476123212131, - "update_at": 1775205795, - "update_by": 2476123212131, - "layers": [ - { - "account_id": 2451002751131, - "name": "Layer 1", - "schedule_id": 5789640530410, - "hidden": 0, - "mode": 0, - "weight": 0, - "groups": [ - { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 3122470302131 - ] - } - ], - "start": 0, - "end": 0 - }, - { - "group_name": "B", - "name": "B", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2659460982131 - ] - } - ], - "start": 0, - "end": 0 - } - ], - "rotation_duration": 86400, - "handoff_time": 0, - "enable_time": 1767542400, - "expire_time": 0, - "restrict_mode": 0, - "restrict_start": 0, - "restrict_end": 0, - "restrict_periods": [], - "day_mask": { - "repeat": [ - 1, - 2, - 3, - 4, - 5 - ] - }, - "create_at": 1775205795, - "create_by": 2476123212131, - "update_at": 1775205795, - "update_by": 2476123212131, - "layer_name": "Layer 1", - "fair_rotation": false, - "layer_start": 1767542400, - "layer_end": null, - "rotation_unit": "day", - "rotation_value": 1, - "mask_continuous_enabled": false - } - ], - "schedule_layers": [ - { - "layer_name": "Layer 1", - "name": "Layer 1", - "mode": 0, - "schedules": [ - { - "start": 1776009600, - "end": 1776096000, - "group": { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 3122470302131 - ] - } - ], - "start": 1776009600, - "end": 1776096000 - }, - "index": 0 - }, - { - "start": 1776096000, - "end": 1776182400, - "group": { - "group_name": "B", - "name": "B", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2659460982131 - ] - } - ], - "start": 1776096000, - "end": 1776182400 - }, - "index": 0 - } - ] - } - ], - "final_schedule": { - "layer_name": "", - "name": "", - "mode": 0, - "schedules": [ - { - "start": 1776009600, - "end": 1776096000, - "group": { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 3122470302131 - ] - } - ], - "start": 1776009600, - "end": 1776096000 - }, - "index": 0 - } - ] - }, - "notify": { - "advance_in_time": 300, - "fixed_time": null, - "by": { - "follow_preference": false, - "personal_channels": [ - "email" - ] - }, - "webhooks": [ - { - "type": "feishu_app", - "settings": { - "token": "", - "alias": "", - "data_source_id": 5427276014131, - "chat_ids": [ - "oc_60a6dc4c6e4e5cbc4934ef08aa7ff76d" - ], - "verify_token": "", - "sign_secret": "" - } - } - ] - }, - "schedule_id": 5789640530410, - "schedule_name": "test-000001", - "team_id": 4291079133131, - "description": "abc", - "layer_schedules": [ - { - "layer_name": "Layer 1", - "name": "Layer 1", - "mode": 0, - "schedules": [ - { - "start": 1776009600, - "end": 1776096000, - "group": { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 3122470302131 - ] - } - ], - "start": 1776009600, - "end": 1776096000 - }, - "index": 0 - } - ] - } - ], - "status": 0, - "cur_oncall": { - "start": 1775972040, - "end": 1776009600, - "group": { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2451002751131 - ] - } - ], - "start": 1775972040, - "end": 1776009600 - }, - "update_at": 0, - "weight": 0, - "index": 0 - }, - "next_oncall": { - "start": 1776009600, - "end": 1776096000, - "group": { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 3122470302131 - ] - } - ], - "start": 1776009600, - "end": 1776096000 - }, - "update_at": 0, - "weight": 0, - "index": 0 - } - } + "data": {} } } } @@ -7692,31 +6951,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleInfoRequest" + "$ref": "#/components/schemas/UpdateFieldRequest" }, "example": { - "schedule_id": 2001, - "start": 1712000000, - "end": 1712086400 + "field_id": "66e9d3a4f7c2b04a1c8a91b3", + "display_name": "Severity Class", + "description": "Business severity tier.", + "options": [ + "Critical", + "High", + "Medium", + "Low" + ], + "default_value": "Medium" } } } } } }, - "/schedule/list": { + "/incident/ack": { "post": { - "operationId": "scheduleList", - "summary": "List schedules", - "description": "Return a paginated list of on-call schedules. When both start and end are provided (max 45 days apart), computed layer schedules are included.", + "operationId": "incidentAck", + "summary": "Acknowledge incident", + "description": "Acknowledge an incident to indicate you are actively working on it.", "tags": [ - "On-call/Schedules" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/schedules/schedule-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-ack", "metadata": { - "sidebarTitle": "List schedules" + "sidebarTitle": "Acknowledge incident" } }, "responses": { @@ -7733,7 +6999,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -7741,99 +7007,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "id": 5789640530410, - "name": "test-000001", - "account_id": 2451002751131, - "group_id": 4291079133131, - "disabled": 0, - "create_at": 1766110836, - "create_by": 2476123212131, - "update_at": 1775205795, - "update_by": 2476123212131, - "layers": null, - "schedule_layers": null, - "final_schedule": { - "layer_name": "", - "name": "", - "mode": 0, - "schedules": null - }, - "notify": { - "advance_in_time": 300, - "fixed_time": null, - "by": { - "follow_preference": false, - "personal_channels": [ - "email" - ] - }, - "webhooks": [ - { - "type": "feishu_app", - "settings": { - "token": "", - "alias": "", - "data_source_id": 5427276014131, - "chat_ids": [ - "oc_60a6dc4c6e4e5cbc4934ef08aa7ff76d" - ], - "verify_token": "", - "sign_secret": "" - } - } - ] - }, - "schedule_id": 5789640530410, - "schedule_name": "test-000001", - "team_id": 4291079133131, - "description": "abc", - "layer_schedules": null, - "status": 0, - "cur_oncall": null, - "next_oncall": null - }, - { - "id": 5432326025106, - "name": "test-2509300001", - "account_id": 2451002751131, - "group_id": 2477033058131, - "disabled": 0, - "create_at": 1759132037, - "create_by": 2476123212131, - "update_at": 1775207501, - "update_by": 2476123212131, - "layers": null, - "schedule_layers": null, - "final_schedule": { - "layer_name": "", - "name": "", - "mode": 0, - "schedules": null - }, - "notify": { - "advance_in_time": 300, - "fixed_time": null, - "by": { - "follow_preference": true, - "personal_channels": null - }, - "webhooks": null - }, - "schedule_id": 5432326025106, - "schedule_name": "test-2509300001", - "team_id": 2477033058131, - "description": "", - "layer_schedules": null, - "status": 0, - "cur_oncall": null, - "next_oncall": null - } - ], - "total": 41 - } + "data": {} } } } @@ -7856,32 +7030,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleListRequest" + "$ref": "#/components/schemas/AckIncidentRequest" }, "example": { - "p": 1, - "limit": 20, - "query": "production", - "is_my_team": true + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ] } } } } } }, - "/schedule/self": { + "/incident/alert/list": { "post": { - "operationId": "scheduleSelf", - "summary": "List my schedules", - "description": "Return on-call schedules where the current user is assigned.", + "operationId": "incidentAlertList", + "summary": "List alerts of incident", + "description": "List all alerts merged into a specific incident.", "tags": [ - "On-call/Schedules" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Schedules Read** (`on-call`) or **Schedules Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/schedules/schedule-self", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-alert-list", "metadata": { - "sidebarTitle": "List my schedules" + "sidebarTitle": "List alerts of incident" } }, "responses": { @@ -7898,7 +7071,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleSelfResponse" + "$ref": "#/components/schemas/ListIncidentAlertsResponse" } } } @@ -7907,105 +7080,47 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "total": 1, "items": [ { - "id": 2539108069860, - "name": "Open Source Q&A", + "alert_id": "69da451df77b1b51f40e83de", + "integration_id": 2490562293131, + "data_source_id": 2490562293131, + "channel_id": 2551105804131, "account_id": 2451002751131, - "group_id": 2477033058131, - "disabled": 0, - "create_at": 1702623874, - "create_by": 2451002751131, - "update_at": 1710468081, - "update_by": 2476444212131, - "layers": [ - { - "account_id": 2451002751131, - "name": "Rule 1", - "schedule_id": 2539108069860, - "hidden": 0, - "mode": 0, - "weight": 0, - "groups": [ - { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2476444212131 - ] - } - ], - "start": 0, - "end": 0 - }, - { - "group_name": "B", - "name": "B", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2469167612131 - ] - } - ], - "start": 0, - "end": 0 - } - ], - "rotation_duration": 86400, - "handoff_time": 0, - "enable_time": 1702623874, - "expire_time": 0, - "restrict_mode": 0, - "restrict_start": 0, - "restrict_end": 0, - "restrict_periods": [], - "day_mask": { - "repeat": [ - 1, - 2, - 3, - 4, - 5 - ] - }, - "create_at": 1702623874, - "create_by": 2451002751131, - "update_at": 1710468081, - "update_by": 2476444212131, - "layer_name": "Rule 1", - "fair_rotation": false, - "layer_start": 1702623874, - "layer_end": null, - "rotation_unit": "day", - "rotation_value": 1, - "mask_continuous_enabled": false - } - ], - "schedule_layers": null, - "final_schedule": { - "layer_name": "", - "name": "", - "mode": 0, - "schedules": null + "description": "", + "title": "CPU usage high - web-server-01", + "title_rule": "", + "alert_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", + "alert_severity": "Critical", + "alert_status": "Critical", + "start_time": 1775912219, + "last_time": 1775969819, + "end_time": 0, + "labels": { + "check": "cpu_usage_high", + "resource": "web-server-01" }, - "notify": { - "fixed_time": null, - "by": null, - "webhooks": null + "ever_muted": false, + "created_at": 1775912221, + "updated_at": 1775969821, + "integration_name": "FlashMonit", + "integration_type": "monit.alert", + "integration_ref_id": "a_2451002751131", + "channel_name": "Ops Channel", + "channel_status": "enabled", + "responder_name": "", + "responder_email": "", + "incident": { + "incident_id": "69da451ef77b1b51f40e83ee", + "title": "CPU usage high - web-server-01", + "progress": "Triggered" }, - "schedule_id": 2539108069860, - "schedule_name": "Open Source Q&A", - "team_id": 2477033058131, - "description": "", - "layer_schedules": null, - "status": 0, - "cur_oncall": null, - "next_oncall": null + "event_cnt": 17, + "images": null, + "data_source_name": "FlashMonit", + "data_source_type": "monit.alert", + "data_source_ref_id": "a_2451002751131" } ] } @@ -8031,30 +7146,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleSelfRequest" + "$ref": "#/components/schemas/ListIncidentAlertsRequest" }, "example": { - "start": 1712000000, - "end": 1712086400 + "incident_id": "69da451ef77b1b51f40e83ee", + "is_active": true, + "limit": 100, + "p": 1 } } } } } }, - "/schedule/infos": { + "/incident/assign": { "post": { - "operationId": "scheduleInfos", - "summary": "Batch get schedules", - "description": "Return details of multiple on-call schedules by their IDs.", + "operationId": "incidentAssign", + "summary": "Assign incident", + "description": "Dispatch an incident to a specific escalation level or responder.", "tags": [ - "On-call/Schedules" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Schedules Read** (`on-call`) or **Schedules Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/schedules/schedule-infos", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-assign", "metadata": { - "sidebarTitle": "Batch get schedules" + "sidebarTitle": "Assign incident" } }, "responses": { @@ -8071,7 +7188,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleSelfResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -8079,62 +7196,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "id": 5789640530410, - "name": "test-000001", - "account_id": 2451002751131, - "group_id": 4291079133131, - "disabled": 0, - "create_at": 1766110836, - "create_by": 2476123212131, - "update_at": 1775205795, - "update_by": 2476123212131, - "layers": null, - "schedule_layers": null, - "final_schedule": { - "layer_name": "", - "name": "", - "mode": 0, - "schedules": null - }, - "notify": { - "advance_in_time": 300, - "fixed_time": null, - "by": { - "follow_preference": false, - "personal_channels": [ - "email" - ] - }, - "webhooks": [ - { - "type": "feishu_app", - "settings": { - "token": "", - "alias": "", - "data_source_id": 5427276014131, - "chat_ids": [ - "oc_60a6dc4c6e4e5cbc4934ef08aa7ff76d" - ], - "verify_token": "", - "sign_secret": "" - } - } - ] - }, - "schedule_id": 5789640530410, - "schedule_name": "test-000001", - "team_id": 4291079133131, - "description": "abc", - "layer_schedules": null, - "status": 0, - "cur_oncall": null, - "next_oncall": null - } - ] - } + "data": {} } } } @@ -8157,33 +7219,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleIDsRequest" + "$ref": "#/components/schemas/AssignIncidentRequest" }, "example": { - "schedule_ids": [ - 2001, - 2002, - 2003 - ] + "incident_id": "69da451ef77b1b51f40e83ee", + "assigned_to": { + "person_ids": [ + 2476444212131 + ], + "type": "assign" + } } } } } } }, - "/calendar/create": { + "/incident/comment": { "post": { - "operationId": "calendarCreate", - "summary": "Create calendar", - "description": "Create a personal service calendar. Each account is limited to 5 calendars unless the Flashcat-Break-Cal-Limit header is set.", + "operationId": "incidentComment", + "summary": "Add comment to incident", + "description": "Add a text comment to the incident timeline.", "tags": [ - "On-call/Calendars" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Calendars Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/calendars/calendar-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-comment", "metadata": { - "sidebarTitle": "Create calendar" + "sidebarTitle": "Add comment to incident" } }, "responses": { @@ -8200,7 +7264,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalendarCreateResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -8208,10 +7272,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "cal_name": "API Test Calendar" - } + "data": {} } } } @@ -8234,38 +7295,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalendarCreateRequest" + "$ref": "#/components/schemas/CommentIncidentRequest" }, "example": { - "cal_name": "Production On-Call Calendar", - "description": "Calendar for production on-call team", - "timezone": "Asia/Shanghai", - "workdays": [ - 1, - 2, - 3, - 4, - 5 - ] + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ], + "comment": "Identified the root cause. Rolling back the deployment now." } } } } } }, - "/calendar/update": { + "/incident/create": { "post": { - "operationId": "calendarUpdate", - "summary": "Update calendar", - "description": "Update a personal service calendar. Only non-null fields are updated.", + "operationId": "incidentCreate", + "summary": "Create incident", + "description": "Manually create a new incident and assign responders.", "tags": [ - "On-call/Calendars" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Calendars Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/calendars/calendar-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-create", "metadata": { - "sidebarTitle": "Update calendar" + "sidebarTitle": "Create incident" } }, "responses": { @@ -8282,7 +7337,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalendarEmptyObject" + "$ref": "#/components/schemas/CreateIncidentResponse" } } } @@ -8290,7 +7345,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "incident_id": "69db2ef1a0fe7db6448b14f1", + "title": "API test incident for docs" + } } } } @@ -8313,38 +7371,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalendarUpdateRequest" + "$ref": "#/components/schemas/CreateIncidentRequest" }, "example": { - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "cal_name": "Production On-Call Calendar (Updated)", - "timezone": "America/New_York", - "workdays": [ - 1, - 2, - 3, - 4, - 5 - ] + "incident_severity": "Critical", + "title": "Database connection timeout on prod-db-01", + "channel_id": 2551105804131, + "assigned_to": { + "person_ids": [ + 2476444212131 + ] + } } } } } } }, - "/calendar/delete": { + "/incident/custom-action/do": { "post": { - "operationId": "calendarDelete", - "summary": "Delete calendar", - "description": "Delete a personal service calendar. The call fails when referenced by escalation or silence rules.", + "operationId": "incidentCustomActionDo", + "summary": "Execute custom action", + "description": "Execute a custom action configured for an incident.", "tags": [ - "On-call/Calendars" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Calendars Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/calendars/calendar-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-custom-action-do", "metadata": { - "sidebarTitle": "Delete calendar" + "sidebarTitle": "Execute custom action" } }, "responses": { @@ -8361,7 +7417,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalendarEmptyObject" + "$ref": "#/components/schemas/DoIncidentCustomActionResponse" } } } @@ -8369,7 +7425,9 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "message": "" + } } } } @@ -8392,29 +7450,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalendarIDRequest" + "$ref": "#/components/schemas/DoIncidentCustomActionRequest" }, "example": { - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM" + "incident_id": "69da451ef77b1b51f40e83ee", + "integration_id": 2490562293131 } } } } } }, - "/calendar/info": { + "/incident/disable-merge": { "post": { - "operationId": "calendarInfo", - "summary": "Get calendar info", - "description": "Return details of a service calendar.", + "operationId": "incidentDisableMerge", + "summary": "Disable incident merge", + "description": "Disable automatic merging for a specific incident.", "tags": [ - "On-call/Calendars" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/calendars/calendar-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-disable-merge", "metadata": { - "sidebarTitle": "Get calendar info" + "sidebarTitle": "Disable incident merge" } }, "responses": { @@ -8431,7 +7490,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalendarItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -8439,29 +7498,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "account_id": 2451002751131, - "team_id": 2477033058131, - "cal_id": "cal.eh9gvPtWeH3xXgKeVSRxRg", - "cal_name": "Stock Exchange Calendar", - "description": "A stock market trading calendar example", - "timezone": "Asia/Shanghai", - "kind": "personal", - "workdays": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6 - ], - "created_at": 1702455630, - "updated_at": 1775529526, - "creator_id": 2476444212131, - "updated_by": 3790925372131, - "status": "enabled" - } + "data": {} } } } @@ -8484,29 +7521,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalendarIDRequest" + "$ref": "#/components/schemas/DisableIncidentMergeRequest" }, "example": { - "cal_id": "cal.eh9gvPtWeH3xXgKeVSRxRg" + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ] } } } } } }, - "/calendar/list": { + "/incident/feed": { "post": { - "operationId": "calendarList", - "summary": "List calendars", - "description": "Return the list of service calendars visible to the current account.", + "operationId": "incidentFeed", + "summary": "Get incident timeline", + "description": "Retrieve the timeline feed for a specific incident, including state changes, comments and system events.", "tags": [ - "On-call/Calendars" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/calendars/calendar-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-feed", "metadata": { - "sidebarTitle": "List calendars" + "sidebarTitle": "Get incident timeline" } }, "responses": { @@ -8523,7 +7562,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalendarListResponse" + "$ref": "#/components/schemas/ListIncidentFeedResponse" } } } @@ -8532,49 +7571,42 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "has_next_page": true, "items": [ { + "ref_id": "69da451ef77b1b51f40e83ee", + "type": "i_new", + "detail": { + "severity": "Critical", + "title": "CPU usage high - web-server-01" + }, "account_id": 2451002751131, - "team_id": 2477033058131, - "cal_id": "cal.eh9gvPtWeH3xXgKeVSRxRg", - "cal_name": "Stock Exchange Calendar", - "description": "A stock market trading calendar example", - "timezone": "Asia/Shanghai", - "kind": "personal", - "workdays": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6 - ], - "created_at": 1702455630, - "updated_at": 1775529526, - "creator_id": 2476444212131, - "updated_by": 3790925372131, - "status": "enabled" + "creator_id": 0, + "created_at": 1775912222661, + "updated_at": 1775912222661 }, { + "ref_id": "69da451ef77b1b51f40e83ee", + "type": "i_notify", + "detail": { + "rid": "5e9ccfabcd154b41a0005fd0f52b674b", + "msg_id": "naFudJYCawBWsChdV6ErPH", + "fire_type": "fire", + "escalate_rule_id": "000000000000000000000000", + "layer_idx": 0, + "by": "email", + "persons": [ + { + "person_id": 2476444212131 + } + ] + }, "account_id": 2451002751131, - "team_id": 0, - "cal_id": "cal.VZYkchxJhGELSF4jzkUAud", - "cal_name": "HK Stock Exchange Calendar", - "description": "Hong Kong Stock Exchange trading days calendar", - "timezone": "Asia/Shanghai", - "kind": "personal", - "extra_cal_ids": [ - "zh-cn.china.official" - ], - "created_at": 1702968470, - "updated_at": 1775188967, - "creator_id": 2451002751131, - "updated_by": 3790925372131, - "status": "enabled" + "creator_id": 0, + "created_at": 1775972130174, + "updated_at": 1775972130174 } - ], - "total": 8 + ] } } } @@ -8598,29 +7630,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalendarListRequest" + "$ref": "#/components/schemas/ListIncidentFeedRequest" }, "example": { - "kind": "personal" + "incident_id": "69da451ef77b1b51f40e83ee", + "p": 1, + "limit": 20 } } } } } }, - "/calendar/event/upsert": { + "/incident/field/reset": { "post": { - "operationId": "calEventUpsert", - "summary": "Upsert calendar event", - "description": "Create or update a calendar event (holiday or workday override). Omit event_id to create a new event.", + "operationId": "incidentFieldReset", + "summary": "Update incident custom field", + "description": "Update a custom field value on an incident.", "tags": [ - "On-call/Calendars" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Calendars Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/calendars/cal-event-upsert", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-field-reset", "metadata": { - "sidebarTitle": "Upsert calendar event" + "sidebarTitle": "Update incident custom field" } }, "responses": { @@ -8637,7 +7671,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalEventUpsertResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -8645,11 +7679,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "event_id": "cale.KyG9XWTCU5CucbwukEVBQ4", - "summary": "Test Holiday" - } + "data": {} } } } @@ -8672,34 +7702,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalEventUpsertRequest" + "$ref": "#/components/schemas/ResetIncidentFieldRequest" }, "example": { - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "summary": "Labour Day", - "start_at": "2024-05-01", - "end_at": "2024-05-06", - "is_off": true, - "description": "International Workers Day holiday" + "incident_id": "69da451ef77b1b51f40e83ee", + "field_name": "affected_service", + "field_value": "payment-service" } } } } } }, - "/calendar/event/delete": { + "/incident/info": { "post": { - "operationId": "calEventDelete", - "summary": "Delete calendar event", - "description": "Delete a calendar event by calendar ID and event ID.", + "operationId": "incidentInfo", + "summary": "Get incident detail", + "description": "Retrieve detailed information for a single incident including timeline, alerts, responders and custom fields.", "tags": [ - "On-call/Calendars" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Calendars Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/calendars/cal-event-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-info", "metadata": { - "sidebarTitle": "Delete calendar event" + "sidebarTitle": "Get incident detail" } }, "responses": { @@ -8716,7 +7743,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalendarEmptyObject" + "$ref": "#/components/schemas/IncidentInfo" } } } @@ -8724,7 +7751,84 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "incident_id": "69da451ef77b1b51f40e83ee", + "account_id": 2451002751131, + "channel_id": 2551105804131, + "integration_id": 2490562293131, + "integration_ids": [ + 2490562293131 + ], + "integration_types": [ + "monit.alert" + ], + "dedup_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", + "equals_md5": "", + "start_time": 1775912219, + "end_time": 0, + "last_time": 1775969819, + "ack_time": 0, + "close_time": 0, + "creator_id": 0, + "closer_id": 0, + "owner_id": 0, + "incident_status": "Critical", + "incident_severity": "Critical", + "progress": "Triggered", + "title": "CPU usage high - web-server-01", + "description": "", + "ai_summary": "", + "impact": "", + "root_cause": "", + "resolution": "", + "num": "0E83EE", + "frequency": "frequent", + "created_at": 1775912222, + "updated_at": 1775972145, + "snoozed_before": 0, + "group_method": "n", + "ever_muted": false, + "labels": { + "check": "cpu_usage_high", + "resource": "web-server-01", + "env": "production" + }, + "fields": {}, + "assigned_to": { + "person_ids": [ + 2476444212131 + ], + "escalate_rule_id": "000000000000000000000000", + "layer_idx": 0, + "type": "assign", + "assigned_at": 1775972128, + "id": "MvQfH9Dc8eNS8k79jmrWn6", + "escalate_rule_name": "" + }, + "alert_cnt": 1, + "active_alert_cnt": 1, + "alert_event_cnt": 17, + "responders": [ + { + "person_id": 2476444212131, + "assigned_at": 1775972128, + "acknowledged_at": 0 + } + ], + "account_name": "", + "account_locale": "", + "account_time_zone": "", + "channel_name": "Ops Channel", + "channel_status": "enabled", + "detail_url": "https://app.flashcat.cloud/incident/detail/69da451ef77b1b51f40e83ee", + "silence_url": "https://app.flashcat.cloud/channel/detail/2551105804131?tab=alertSuppression&fromIncidentId=69da451ef77b1b51f40e83ee", + "integration_type": "monit.alert", + "post_mortem_id": "", + "images": null, + "manual_overrides": [ + "title" + ] + } } } } @@ -8747,30 +7851,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalEventIDRequest" + "$ref": "#/components/schemas/IncidentInfoRequest" }, "example": { - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "event_id": "cale.KyG9XWTCU5CucbwukEVBQ4" + "incident_id": "69da451ef77b1b51f40e83ee" } } } } } }, - "/calendar/event/list": { + "/incident/list": { "post": { - "operationId": "calEventList", - "summary": "List calendar events", - "description": "Return events for a personal calendar within a year/month/day scope. When month and day are both omitted the whole year is returned.", + "operationId": "incidentList", + "summary": "List incidents", + "description": "Query a paginated list of incidents with filters by channel, severity, status, responder, and time range.", "tags": [ - "On-call/Calendars" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/calendars/cal-event-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-list", "metadata": { - "sidebarTitle": "List calendar events" + "sidebarTitle": "List incidents" } }, "responses": { @@ -8787,7 +7890,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalEventListResponse" + "$ref": "#/components/schemas/IncidentListResponse" } } } @@ -8796,35 +7899,89 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "total": 88, + "has_next_page": true, + "search_after_ctx": "69da451ef77b1b51f40e83eb", "items": [ { + "incident_id": "69da451ef77b1b51f40e83ee", "account_id": 2451002751131, - "creator_id": 2476444212131, - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "event_id": "cale.KyG9XWTCU5CucbwukEVBQ4", - "summary": "Test Holiday", - "description": "A test holiday event", - "start_at": "2026-05-01", - "end_at": "2026-05-02", - "is_off": true, - "created_at": 1775972034, - "updated_at": 1775972034 - }, - { - "account_id": 2451002751131, - "creator_id": 2451002751131, - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "event_id": "non_work.20260502", - "summary": "non-working day (Saturday)", + "channel_id": 2551105804131, + "integration_id": 2490562293131, + "integration_ids": [ + 2490562293131 + ], + "integration_types": [ + "monit.alert" + ], + "dedup_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", + "equals_md5": "", + "start_time": 1775912219, + "end_time": 0, + "last_time": 1775969819, + "ack_time": 0, + "close_time": 0, + "creator_id": 0, + "closer_id": 0, + "owner_id": 0, + "incident_status": "Critical", + "incident_severity": "Critical", + "progress": "Triggered", + "title": "CPU usage high - web-server-01", "description": "", - "start_at": "2026-05-02", - "end_at": "2026-05-03", - "is_off": true, - "created_at": 0, - "updated_at": 0 + "ai_summary": "", + "impact": "", + "root_cause": "", + "resolution": "", + "num": "0E83EE", + "frequency": "frequent", + "created_at": 1775912222, + "updated_at": 1775972145, + "snoozed_before": 0, + "group_method": "n", + "ever_muted": false, + "labels": { + "check": "cpu_usage_high", + "resource": "web-server-01", + "env": "production" + }, + "fields": {}, + "assigned_to": { + "person_ids": [ + 2476444212131 + ], + "escalate_rule_id": "000000000000000000000000", + "layer_idx": 0, + "type": "assign", + "assigned_at": 1775972128, + "id": "MvQfH9Dc8eNS8k79jmrWn6", + "escalate_rule_name": "" + }, + "alert_cnt": 1, + "active_alert_cnt": 1, + "alert_event_cnt": 17, + "responders": [ + { + "person_id": 2476444212131, + "assigned_at": 1775972128, + "acknowledged_at": 0 + } + ], + "account_name": "", + "account_locale": "", + "account_time_zone": "", + "channel_name": "Ops Channel", + "channel_status": "enabled", + "detail_url": "https://app.flashcat.cloud/incident/detail/69da451ef77b1b51f40e83ee", + "silence_url": "https://app.flashcat.cloud/channel/detail/2551105804131?tab=alertSuppression&fromIncidentId=69da451ef77b1b51f40e83ee", + "integration_type": "monit.alert", + "post_mortem_id": "", + "images": null, + "manual_overrides": [ + "title" + ] } - ], - "total": 11 + ] } } } @@ -8848,31 +8005,37 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalEventListRequest" + "$ref": "#/components/schemas/ListIncidentsRequest" }, "example": { - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "year": 2024, - "month": 5 + "start_time": 1711900800, + "end_time": 1712000000, + "progress": "Triggered,Processing", + "incident_severity": "Critical,Warning", + "channel_ids": [ + 2551105804131 + ], + "limit": 20, + "p": 1 } } } } } }, - "/template/info": { + "/incident/list-by-ids": { "post": { - "operationId": "template-read-info", - "summary": "Get template detail", - "description": "Return a single notification template by ID.", + "operationId": "incidentListByIds", + "summary": "List incidents by IDs", + "description": "Retrieve multiple incidents by their IDs in a single request.", "tags": [ - "On-call/Notification templates" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Templates Read** (`on-call`) |\n\n## Usage\n\n- Pass `000000000000000000000001` as `template_id` to retrieve the built-in preset template for the caller's account locale.", - "href": "/en/api-reference/on-call/notification-templates/template-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-list-by-ids", "metadata": { - "sidebarTitle": "Get template detail" + "sidebarTitle": "List incidents by IDs" } }, "responses": { @@ -8889,7 +8052,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TemplateItem" + "$ref": "#/components/schemas/IncidentListResponse" } } } @@ -8898,30 +8061,73 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "account_id": 10023, - "team_id": 0, - "template_id": "6605a1b2c3d4e5f6a7b8c9d0", - "template_name": "Prod incident default", - "description": "Default template for production incidents.", - "email": "Incident {{ .IncidentName }} on {{ .Severity }}", - "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}", - "voice": "", - "dingtalk": "", - "wecom": "", - "feishu": "", - "feishu_app": "", - "dingtalk_app": "", - "wecom_app": "", - "slack_app": "", - "teams_app": "", - "telegram": "", - "slack": "", - "zoom": "", - "status": "enabled", - "creator_id": 80011, - "updated_by": 80011, - "created_at": 1712700000, - "updated_at": 1712702400 + "total": 2, + "has_next_page": false, + "items": [ + { + "incident_id": "69da451ef77b1b51f40e83ee", + "account_id": 2451002751131, + "channel_id": 2551105804131, + "integration_id": 2490562293131, + "integration_ids": [ + 2490562293131 + ], + "integration_types": [ + "monit.alert" + ], + "dedup_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", + "equals_md5": "", + "start_time": 1775912219, + "end_time": 0, + "last_time": 1775969819, + "ack_time": 0, + "close_time": 0, + "creator_id": 0, + "closer_id": 0, + "owner_id": 0, + "incident_status": "Critical", + "incident_severity": "Critical", + "progress": "Triggered", + "title": "CPU usage high - web-server-01", + "description": "", + "ai_summary": "", + "impact": "", + "root_cause": "", + "resolution": "", + "num": "0E83EE", + "frequency": "frequent", + "created_at": 1775912222, + "updated_at": 1775972145, + "snoozed_before": 0, + "group_method": "n", + "ever_muted": false, + "labels": {}, + "fields": {}, + "assigned_to": { + "escalate_rule_id": "000000000000000000000000", + "layer_idx": 0, + "type": "", + "assigned_at": 0, + "id": "", + "escalate_rule_name": "" + }, + "alert_cnt": 1, + "active_alert_cnt": 1, + "alert_event_cnt": 17, + "responders": [], + "account_name": "", + "account_locale": "", + "account_time_zone": "", + "channel_name": "Ops Channel", + "channel_status": "enabled", + "detail_url": "https://app.flashcat.cloud/incident/detail/69da451ef77b1b51f40e83ee", + "silence_url": "https://app.flashcat.cloud/channel/detail/2551105804131?tab=alertSuppression&fromIncidentId=69da451ef77b1b51f40e83ee", + "integration_type": "monit.alert", + "post_mortem_id": "", + "images": null, + "manual_overrides": null + } + ] } } } @@ -8945,29 +8151,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateIDRequest" + "$ref": "#/components/schemas/ListIncidentsByIdsRequest" }, "example": { - "template_id": "6605a1b2c3d4e5f6a7b8c9d0" + "incident_ids": [ + "69da451ef77b1b51f40e83ee", + "69da451ef77b1b51f40e83ef" + ] } } } } } }, - "/template/list": { + "/incident/merge": { "post": { - "operationId": "template-read-list", - "summary": "List templates", - "description": "Return a paginated list of notification templates.", + "operationId": "incidentMerge", + "summary": "Merge incidents", + "description": "Merge one or more incidents into a target incident.", "tags": [ - "On-call/Notification templates" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Templates Read** (`on-call`) or **Templates Manage** (`on-call`) |\n\n## Usage\n\n- Pagination defaults to page 1 with 20 rows. The response's `has_next_page` tells you whether another page exists without needing a separate count request.\n- When `is_my_team` is `true`, `team_ids` is ignored.", - "href": "/en/api-reference/on-call/notification-templates/template-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-merge", "metadata": { - "sidebarTitle": "List templates" + "sidebarTitle": "Merge incidents" } }, "responses": { @@ -8984,7 +8193,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TemplateListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -8992,38 +8201,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 47, - "has_next_page": true, - "items": [ - { - "account_id": 10023, - "team_id": 0, - "template_id": "6605a1b2c3d4e5f6a7b8c9d0", - "template_name": "Prod incident default", - "description": "Default template for production incidents.", - "email": "Incident {{ .IncidentName }} on {{ .Severity }}", - "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}", - "voice": "", - "dingtalk": "", - "wecom": "", - "feishu": "", - "feishu_app": "", - "dingtalk_app": "", - "wecom_app": "", - "slack_app": "", - "teams_app": "", - "telegram": "", - "slack": "", - "zoom": "", - "status": "enabled", - "creator_id": 80011, - "updated_by": 80011, - "created_at": 1712700000, - "updated_at": 1712702400 - } - ] - } + "data": {} } } } @@ -9046,33 +8224,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateListRequest" + "$ref": "#/components/schemas/MergeIncidentsRequest" }, "example": { - "p": 1, - "limit": 20, - "orderby": "updated_at", - "asc": false, - "is_my_team": false - } - } - } - } + "source_incident_ids": [ + "69da451ef77b1b51f40e83ef", + "69da451ef77b1b51f40e83f0" + ], + "target_incident_id": "69da451ef77b1b51f40e83ee", + "comment": "Merging related database connectivity incidents into one." + } + } + } + } } }, - "/template/create": { + "/incident/past/list": { "post": { - "operationId": "template-write-create", - "summary": "Create a template", - "description": "Create a new notification template.", + "operationId": "incidentPastList", + "summary": "List past incidents", + "description": "List historical incidents related to the current incident for reference during triage.", "tags": [ - "On-call/Notification templates" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Templates Manage** (`on-call`) |\n\n## Usage\n\n- `template_name` must be unique within the account; duplicates return `InvalidParameter`.\n- The server validates every non-empty channel template by rendering it against a mock incident — a syntactic error in any channel fails the whole request with `InvalidParameter`.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/notification-templates/template-write-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **100 requests/minute**; **20 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-past-list", "metadata": { - "sidebarTitle": "Create a template" + "sidebarTitle": "List past incidents" } }, "responses": { @@ -9089,7 +8268,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TemplateCreateResponse" + "$ref": "#/components/schemas/ListPastIncidentsResponse" } } } @@ -9098,8 +8277,7 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "template_id": "6605a1b2c3d4e5f6a7b8c9d0", - "template_name": "Prod incident default" + "items": [] } } } @@ -9123,33 +8301,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateCreateRequest" + "$ref": "#/components/schemas/ListPastIncidentsRequest" }, "example": { - "team_id": 0, - "template_name": "Prod incident default", - "description": "Default template for production incidents.", - "email": "Incident {{ .IncidentName }} on {{ .Severity }}", - "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}" + "incident_id": "69da451ef77b1b51f40e83ee", + "limit": 5 } } } } } }, - "/template/update": { + "/incident/post-mortem/basics/reset": { "post": { - "operationId": "template-write-update", - "summary": "Update a template", - "description": "Replace the content of every channel on an existing template.", + "operationId": "postmortem-write-reset-basics", + "summary": "Update post-mortem basics", + "description": "Replace the incident facts stored in a post-mortem report.", "tags": [ - "On-call/Notification templates" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Templates Manage** (`on-call`) |\n\n## Usage\n\n- Every channel field in the request overwrites the stored value — send an empty string to clear a channel.\n- The caller needs data-permission on the template's team; otherwise the response is `AccessDenied`.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/notification-templates/template-write-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/incidents/postmortem-write-reset-basics", "metadata": { - "sidebarTitle": "Update a template" + "sidebarTitle": "Update post-mortem basics" } }, "responses": { @@ -9166,7 +8341,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyObject" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -9185,9 +8360,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -9200,33 +8372,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateUpdateRequest" + "$ref": "#/components/schemas/ResetPostMortemBasicsRequest" }, "example": { - "template_id": "6605a1b2c3d4e5f6a7b8c9d0", - "template_name": "Prod incident default", - "description": "Updated description.", - "email": "Incident {{ .IncidentName }} on {{ .Severity }}", - "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}" + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", + "incidents_highest_severity": "Warning", + "incidents_earliest_start_seconds": 1761133512, + "incidents_latest_close_seconds": 1761133632, + "incidents_total_duration_seconds": 120, + "responder_ids": [ + 3790925372131 + ] } } } } } }, - "/template/delete": { + "/incident/post-mortem/delete": { "post": { - "operationId": "template-write-delete", - "summary": "Delete a template", - "description": "Soft-delete a template by ID.", + "operationId": "incidentPostMortemDelete", + "summary": "Delete post-mortem", + "description": "Delete a post-mortem report.", "tags": [ - "On-call/Notification templates" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Templates Manage** (`on-call`) |\n\n## Usage\n\n- Fails with `400 ReferenceExist` if the template is still referenced by any channel, escalation rule, or notification subscription.\n- Deletion is soft — `deleted_at` is set. The record remains for audit, but the template stops appearing in listings.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/notification-templates/template-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-post-mortem-delete", "metadata": { - "sidebarTitle": "Delete a template" + "sidebarTitle": "Delete post-mortem" } }, "responses": { @@ -9243,7 +8418,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyObject" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -9262,9 +8437,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -9277,29 +8449,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateIDRequest" + "$ref": "#/components/schemas/DeletePostMortemRequest" }, "example": { - "template_id": "6605a1b2c3d4e5f6a7b8c9d0" + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e" } } } } } }, - "/enrichment/info": { + "/incident/post-mortem/follow-ups/reset": { "post": { - "operationId": "enrichment-read-info", - "summary": "Get enrichment rules", - "description": "Return the enrichment rule set configured for a specific integration.", + "operationId": "postmortem-write-reset-follow-ups", + "summary": "Update post-mortem follow-ups", + "description": "Replace the follow-up action items on a post-mortem report.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) or **Channels Manage** (`on-call`) or **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) |\n\n## Usage\n\n- Returns `null` if no enrichment rules have been configured for the integration.", - "href": "/en/api-reference/on-call/alert-enrichment/enrichment-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/incidents/postmortem-write-reset-follow-ups", "metadata": { - "sidebarTitle": "Get enrichment rules" + "sidebarTitle": "Update post-mortem follow-ups" } }, "responses": { @@ -9316,7 +8488,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EnrichmentItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -9324,25 +8496,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "integration_id": 5001, - "rules": [ - { - "kind": "extraction", - "settings": { - "source_field": "labels.env", - "result_label": "environment", - "pattern": "^(prod|staging|dev).*$", - "override": true - } - } - ], - "status": "enabled", - "updated_by": 80011, - "creator_id": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 - } + "data": {} } } } @@ -9365,29 +8519,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnrichmentInfoRequest" + "$ref": "#/components/schemas/ResetPostMortemFollowUpsRequest" }, "example": { - "integration_id": 5001 + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", + "follow_ups": "- Add database saturation alert\n- Review cache TTL rollout" } } } } } }, - "/enrichment/list": { - "post": { - "operationId": "enrichment-read-list", - "summary": "List enrichment rules", - "description": "Return the enrichment rule sets for a list of integration IDs.", + "/incident/post-mortem/info": { + "get": { + "operationId": "incidentPostMortemInfo", + "summary": "Get post-mortem", + "description": "Retrieve a post-mortem report by its `post_mortem_id`. List reports via `/incident/post-mortem/list` first — each row carries the incident it covers — then fetch the full report here by that id.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/alert-enrichment/enrichment-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-post-mortem-info", "metadata": { - "sidebarTitle": "List enrichment rules" + "sidebarTitle": "Get post-mortem" } }, "responses": { @@ -9404,7 +8559,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EnrichmentListResponse" + "$ref": "#/components/schemas/PostMortemItem" } } } @@ -9413,17 +8568,43 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ - { - "integration_id": 5001, - "rules": [], - "status": "enabled", - "updated_by": 80011, - "creator_id": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 - } - ] + "meta": { + "account_id": 2451002751131, + "title": "Postmortem1", + "status": "published", + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", + "template_id": "post_mortem_default_tmpl_en-us", + "incident_ids": [ + "69bb9233331067560c718ecd" + ], + "media_count": 0, + "author_ids": [ + 2477273692131 + ], + "team_id": 2477033058131, + "channel_id": 3047621227131, + "is_private": false, + "channel_name": "Ops Channel", + "created_at_seconds": 1773900354, + "updated_at_seconds": 1773909012 + }, + "basics": { + "incidents_highest_severity": "Warning", + "incidents_earliest_start_seconds": 1761133512, + "incidents_latest_close_seconds": 1761133632, + "incidents_total_duration_seconds": 120, + "responders": [ + { + "person_id": 3790925372131, + "assigned_at": 1761133515, + "acknowledged_at": 0 + } + ] + }, + "content": { + "content": "{\"type\":\"doc\",\"content\":[]}" + }, + "follow_ups": "" } } } @@ -9442,37 +8623,32 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EnrichmentListRequest" - }, - "example": { - "integration_ids": [ - 5001, - 5002 - ] - } - } + "parameters": [ + { + "name": "post_mortem_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + }, + "description": "Post-mortem ID. Deterministic hash derived from account ID and the set of linked incident IDs." } - } + ] } }, - "/enrichment/upsert": { + "/incident/post-mortem/init": { "post": { - "operationId": "enrichment-write-upsert", - "summary": "Upsert enrichment rules", - "description": "Create or fully replace the enrichment rule set for an integration. The entire `rules` array is replaced atomically.", + "operationId": "postmortem-write-init", + "summary": "Initialize post-mortem", + "description": "Create a post-mortem draft from one or more incidents and a template.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Manage** (`on-call`) or **Integrations Manage** (`on-call`) |\n\n## Usage\n\n- Enrichment rules are evaluated in order.\n- Each rule has a `kind`: `extraction` (regex/gjson extraction), `composition` (template-based label composition), `mapping` (lookup via mapping schema or API), or `drop` (remove labels).\n- The optional `if` field is an `AndFilters` condition: if it does not match, the rule is skipped.\n- For `kind: extraction`: `source_field` must be `title`, `description`, or a `labels.*` key; specify exactly one of `pattern` (regex with named group `result`) or `g_json` (GJson path).\n- For `kind: composition`: `template` uses Go text/template syntax referencing `labels.*` keys.\n- For `kind: mapping`: `mapping_type` is `schema` (default) or `api`; provide `schema_id` or `api_id` accordingly.\n- For `kind: drop`: `drop_labels` lists the label keys to remove.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/alert-enrichment/enrichment-write-upsert", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Links at most 10 incidents to one post-mortem report.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/incidents/postmortem-write-init", "metadata": { - "sidebarTitle": "Upsert enrichment rules" + "sidebarTitle": "Initialize post-mortem" } }, "responses": { @@ -9489,7 +8665,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/PostMortemItem" } } } @@ -9497,7 +8673,45 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "meta": { + "account_id": 2451002751131, + "title": "Postmortem1", + "status": "published", + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", + "template_id": "post_mortem_default_tmpl_en-us", + "incident_ids": [ + "69bb9233331067560c718ecd" + ], + "media_count": 0, + "author_ids": [ + 2477273692131 + ], + "team_id": 2477033058131, + "channel_id": 3047621227131, + "is_private": false, + "channel_name": "Ops Channel", + "created_at_seconds": 1773900354, + "updated_at_seconds": 1773909012 + }, + "basics": { + "incidents_highest_severity": "Warning", + "incidents_earliest_start_seconds": 1761133512, + "incidents_latest_close_seconds": 1761133632, + "incidents_total_duration_seconds": 120, + "responders": [ + { + "person_id": 3790925372131, + "assigned_at": 1761133515, + "acknowledged_at": 0 + } + ] + }, + "content": { + "content": "{\"type\":\"doc\",\"content\":[]}" + }, + "follow_ups": "" + } } } } @@ -9520,48 +8734,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnrichmentUpsertRequest" + "$ref": "#/components/schemas/InitPostMortemRequest" }, "example": { - "integration_id": 5001, - "rules": [ - { - "kind": "extraction", - "settings": { - "source_field": "labels.env", - "result_label": "environment", - "pattern": "(?Pprod|staging|dev)", - "override": true - } - }, - { - "kind": "composition", - "settings": { - "result_label": "full_env", - "template": "{{.labels.region}}-{{.labels.environment}}", - "override": false - } - } - ] + "incident_ids": [ + "69bb9233331067560c718ecd" + ], + "template_id": "post_mortem_default_tmpl_en-us" } } } } } }, - "/enrichment/mapping/schema/list": { + "/incident/post-mortem/list": { "post": { - "operationId": "mapping-schema-read-list", - "summary": "List mapping schemas", - "description": "Return all mapping schemas for the account, sorted by creation time ascending.", + "operationId": "incidentPostMortemList", + "summary": "List post-mortems", + "description": "List post-mortem reports with optional filters.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) or **Channels Manage** (`on-call`) or **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) or **Mappings Read** (`on-call`) or **Mappings Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-schema-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-post-mortem-list", "metadata": { - "sidebarTitle": "List mapping schemas" + "sidebarTitle": "List post-mortems" } }, "responses": { @@ -9578,7 +8776,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingSchemaListResponse" + "$ref": "#/components/schemas/ListPostMortemsResponse" } } } @@ -9587,25 +8785,28 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 1, + "total": 3, + "has_next_page": false, "items": [ { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01", - "schema_name": "CMDB Lookup", - "description": "Enrich alerts with CMDB data", - "source_labels": [ - "host" + "account_id": 2451002751131, + "title": "Postmortem1", + "status": "published", + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", + "template_id": "post_mortem_default_tmpl_en-us", + "incident_ids": [ + "69bb9233331067560c718ecd" ], - "result_labels": [ - "owner", - "team", - "service" + "media_count": 0, + "author_ids": [ + 2477273692131 ], - "status": "enabled", - "team_id": 0, - "creator_id": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 + "team_id": 2477033058131, + "channel_id": 3047621227131, + "is_private": false, + "channel_name": "Ops Channel", + "created_at_seconds": 1773900354, + "updated_at_seconds": 1773909012 } ] } @@ -9631,27 +8832,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmptyRequest" + "$ref": "#/components/schemas/ListPostMortemsRequest" }, - "example": {} + "example": { + "status": "published", + "p": 1, + "limit": 20 + } } } } } }, - "/enrichment/mapping/schema/info": { + "/incident/post-mortem/status/reset": { "post": { - "operationId": "mapping-schema-read-info", - "summary": "Get mapping schema detail", - "description": "Return detail of a single mapping schema by its ID.", + "operationId": "postmortem-write-reset-status", + "summary": "Update post-mortem status", + "description": "Set a post-mortem report to drafting or published.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) or **Mappings Read** (`on-call`) or **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- Returns `null` if the schema does not exist.", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-schema-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/incidents/postmortem-write-reset-status", "metadata": { - "sidebarTitle": "Get mapping schema detail" + "sidebarTitle": "Update post-mortem status" } }, "responses": { @@ -9668,7 +8873,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingSchemaItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -9676,24 +8881,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01", - "schema_name": "CMDB Lookup", - "description": "Enrich alerts with CMDB data", - "source_labels": [ - "host" - ], - "result_labels": [ - "owner", - "team", - "service" - ], - "status": "enabled", - "team_id": 0, - "creator_id": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 - } + "data": {} } } } @@ -9716,29 +8904,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingSchemaIDRequest" + "$ref": "#/components/schemas/ResetPostMortemStatusRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01" + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", + "status": "published" } } } } } }, - "/enrichment/mapping/schema/create": { + "/incident/post-mortem/template/delete": { "post": { - "operationId": "mapping-schema-write-create", - "summary": "Create mapping schema", - "description": "Create a new mapping schema defining source lookup labels and the result labels to populate. Requires a Pro plan.", + "operationId": "postmortem-write-delete-template", + "summary": "Delete post-mortem template", + "description": "Delete a custom post-mortem template.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- Schema names must be unique within an account.\n- `source_labels` (1–3 labels) are used as lookup keys; `result_labels` (1–10 labels) are the labels written on match.\n- Label names must match `^[a-z][a-z0-9_]{0,39}$` (lowercase).\n- `source_labels` and `result_labels` must not overlap.\n- An account can have at most 20 mapping schemas.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-schema-write-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/incidents/postmortem-write-delete-template", "metadata": { - "sidebarTitle": "Create mapping schema" + "sidebarTitle": "Delete post-mortem template" } }, "responses": { @@ -9755,7 +8944,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingSchemaCreateResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -9763,10 +8952,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01", - "schema_name": "CMDB Lookup" - } + "data": {} } } } @@ -9789,38 +8975,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingSchemaCreateRequest" + "$ref": "#/components/schemas/DeletePostMortemTemplateRequest" }, "example": { - "schema_name": "CMDB Lookup", - "description": "Enrich alerts with CMDB data", - "source_labels": [ - "host" - ], - "result_labels": [ - "owner", - "team", - "service" - ] + "template_id": "post_mortem_custom_tmpl_01" } } } } } }, - "/enrichment/mapping/schema/update": { - "post": { - "operationId": "mapping-schema-write-update", - "summary": "Update mapping schema", - "description": "Update the name, description, or owning team of a mapping schema. Source and result labels cannot be changed after creation.", + "/incident/post-mortem/template/info": { + "get": { + "operationId": "postmortem-read-template-info", + "summary": "Get post-mortem template detail", + "description": "Return one post-mortem template by ID.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- Only the schema creator, account admin, or team member can update the schema.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-schema-write-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/postmortem-read-template-info", "metadata": { - "sidebarTitle": "Update mapping schema" + "sidebarTitle": "Get post-mortem template detail" } }, "responses": { @@ -9837,7 +9014,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/PostMortemTemplate" } } } @@ -9845,7 +9022,17 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "account_id": 2451002751131, + "template_id": "post_mortem_default_tmpl_en-us", + "name": "Default post-mortem report", + "description": "Default sections for post-mortem reports.", + "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", + "content_markdown": "## Summary\nDescribe what happened.", + "team_id": 2477033058131, + "created_at_seconds": 1773900000, + "updated_at_seconds": 1773903600 + } } } } @@ -9863,36 +9050,32 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MappingSchemaUpdateRequest" - }, - "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01", - "schema_name": "CMDB Lookup v2", - "description": "Updated description" - } - } + "parameters": [ + { + "name": "template_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + }, + "description": "Template ID." } - } + ] } }, - "/enrichment/mapping/schema/delete": { + "/incident/post-mortem/template/list": { "post": { - "operationId": "mapping-schema-write-delete", - "summary": "Delete mapping schema", - "description": "Delete a mapping schema and all its associated data. Deletion is blocked if the schema is referenced by any enrichment rule or webhook.", + "operationId": "postmortem-read-list-templates", + "summary": "List post-mortem templates", + "description": "Return built-in and custom post-mortem templates for the account.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- If the schema is still referenced, the response returns HTTP 400 with a `refs` list of blocking references.\n- Only the schema creator, account admin, or team member can delete the schema.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.\n- High-risk operation. Console JWT callers must pass a second-factor code; `app_key` callers bypass the MFA prompt but remain audited — treat the key as a secret.", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-schema-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/postmortem-read-list-templates", "metadata": { - "sidebarTitle": "Delete mapping schema" + "sidebarTitle": "List post-mortem templates" } }, "responses": { @@ -9909,7 +9092,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ListPostMortemTemplatesResponse" } } } @@ -9917,7 +9100,23 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "total": 2, + "has_next_page": false, + "items": [ + { + "account_id": 2451002751131, + "template_id": "post_mortem_default_tmpl_en-us", + "name": "Default post-mortem report", + "description": "Default sections for post-mortem reports.", + "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", + "content_markdown": "## Summary\nDescribe what happened.", + "team_id": 2477033058131, + "created_at_seconds": 1773900000, + "updated_at_seconds": 1773903600 + } + ] + } } } } @@ -9940,29 +9139,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingSchemaIDRequest" + "$ref": "#/components/schemas/ListPostMortemTemplatesRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01" + "p": 1, + "limit": 20, + "order_by": "created_at_seconds", + "asc": false } } } } } }, - "/enrichment/mapping/data/list": { + "/incident/post-mortem/template/upsert": { "post": { - "operationId": "mapping-data-read-list", - "summary": "List mapping data", - "description": "Return paginated mapping data rows for a schema, with optional exact-match filtering on source label values.", + "operationId": "postmortem-write-upsert-template", + "summary": "Create or update post-mortem template", + "description": "Create a custom post-mortem template or update an existing one.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) or **Mappings Read** (`on-call`) or **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- If `query` is provided, all source labels must be specified — partial source label queries are rejected.\n- Pagination uses cursor-based (`search_after_ctx`) or page-based (`p`, `limit`) navigation. `limit` defaults to 20, max 100.\n- The `search_after_ctx` token from a response can be passed back to retrieve the next page.", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-data-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/incidents/postmortem-write-upsert-template", "metadata": { - "sidebarTitle": "List mapping data" + "sidebarTitle": "Create or update post-mortem template" } }, "responses": { @@ -9979,7 +9181,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingDataListResponse" + "$ref": "#/components/schemas/PostMortemTemplate" } } } @@ -9988,21 +9190,15 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ - { - "key": "server01", - "fields": { - "host": "server01", - "owner": "alice", - "team": "sre", - "service": "api" - }, - "created_at": 1710000000, - "updated_at": 1710000000 - } - ], - "total": 1, - "has_next_page": false + "account_id": 2451002751131, + "template_id": "post_mortem_default_tmpl_en-us", + "name": "Default post-mortem report", + "description": "Default sections for post-mortem reports.", + "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", + "content_markdown": "## Summary\nDescribe what happened.", + "team_id": 2477033058131, + "created_at_seconds": 1773900000, + "updated_at_seconds": 1773903600 } } } @@ -10026,33 +9222,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingDataListRequest" + "$ref": "#/components/schemas/UpsertPostMortemTemplateRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01", - "orderby": "updated_at", - "asc": false, - "p": 1, - "limit": 20 + "team_id": 2477033058131, + "name": "Production incident template", + "description": "Template for production incident reviews.", + "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", + "content_markdown": "## Summary\nDescribe what happened." } } } } } }, - "/enrichment/mapping/data/upsert": { + "/incident/post-mortem/title/reset": { "post": { - "operationId": "mapping-data-write-upsert", - "summary": "Upsert mapping data rows", - "description": "Insert or update up to 1000 data rows in a mapping schema. Each row must contain all source and result labels.", + "operationId": "postmortem-write-reset-title", + "summary": "Update post-mortem title", + "description": "Replace the title of a post-mortem report.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- Each doc must contain values for all labels defined in `source_labels` and `result_labels`.\n- Values for unknown labels are silently dropped.\n- Each value must be at most 2048 characters.\n- Upsert is keyed on the combination of source label values — existing rows with the same source key are updated.\n- A schema can hold at most 10,000 rows by default.\n- The operation is locked per schema; concurrent upserts to the same schema may fail with `ErrRequestTooFrequently`.", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-data-write-upsert", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/incidents/postmortem-write-reset-title", "metadata": { - "sidebarTitle": "Upsert mapping data rows" + "sidebarTitle": "Update post-mortem title" } }, "responses": { @@ -10069,7 +9265,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingDataUpsertResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -10077,12 +9273,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "keys": [ - "server01", - "server02" - ] - } + "data": {} } } } @@ -10105,43 +9296,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingDataUpsertRequest" + "$ref": "#/components/schemas/ResetPostMortemTitleRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01", - "docs": [ - { - "host": "server01", - "owner": "alice", - "team": "sre", - "service": "api" - }, - { - "host": "server02", - "owner": "bob", - "team": "platform", - "service": "gateway" - } - ] + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", + "title": "Production API latency incident" } } } } } }, - "/enrichment/mapping/data/delete": { + "/incident/remove": { "post": { - "operationId": "mapping-data-write-delete", - "summary": "Delete mapping data rows", - "description": "Delete up to 100 mapping data rows by their keys.", + "operationId": "incidentRemove", + "summary": "Delete an incident", + "description": "Permanently delete an incident and all associated data.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-data-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-remove", "metadata": { - "sidebarTitle": "Delete mapping data rows" + "sidebarTitle": "Delete an incident" } }, "responses": { @@ -10189,13 +9367,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingDataDeleteRequest" + "$ref": "#/components/schemas/RemoveIncidentRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01", - "keys": [ - "server01", - "server02" + "incident_ids": [ + "69da451ef77b1b51f40e83ee" ] } } @@ -10203,19 +9379,19 @@ } } }, - "/enrichment/mapping/data/truncate": { + "/incident/reopen": { "post": { - "operationId": "mapping-data-write-truncate", - "summary": "Truncate mapping data", - "description": "Delete all data rows in a mapping schema.", + "operationId": "incidentReopen", + "summary": "Reopen incident", + "description": "Reopen a previously resolved incident.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- This is an irreversible bulk-delete operation.\n- High-risk operation. Console JWT callers must pass a second-factor code; `app_key` callers bypass the MFA prompt but remain audited — treat the key as a secret.", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-data-write-truncate", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-reopen", "metadata": { - "sidebarTitle": "Truncate mapping data" + "sidebarTitle": "Reopen incident" } }, "responses": { @@ -10263,29 +9439,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingSchemaIDRequest" + "$ref": "#/components/schemas/ReopenIncidentRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01" + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ], + "reason": "Monitoring detected the issue recurred after the initial fix." } } } } } }, - "/enrichment/mapping/data/upload": { + "/incident/reset": { "post": { - "operationId": "mapping-data-write-upload", - "summary": "Upload mapping data via CSV", - "description": "Upload a CSV file to bulk-load mapping data. By default the existing data is truncated before loading the new rows.", + "operationId": "incidentReset", + "summary": "Update incident fields", + "description": "Update one or more editable fields of an incident in a single call, including title, description, impact, root cause, resolution, and severity. At least one field must be provided.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **20 requests/minute**; **2 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- The request must use `Content-Type: multipart/form-data`. The file field name is `file` and `schema_id` is a query parameter.\n- CSV header row must include all source and result label names.\n- Maximum file size: 100 MB.\n- By default the schema's existing data is truncated before import. Pass query param `do_not_truncate_first=TRUE` to append instead.\n- Duplicate source label value combinations in the CSV cause a 400 error.", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-data-write-upload", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-reset", "metadata": { - "sidebarTitle": "Upload mapping data via CSV" + "sidebarTitle": "Update incident fields" } }, "responses": { @@ -10333,29 +9512,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingDataUploadRequest" + "$ref": "#/components/schemas/UpdateIncidentFieldsRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01" + "incident_id": "69da451ef77b1b51f40e83ee", + "title": "Database connection timeout - prod-db-01 primary", + "incident_severity": "Critical" } } } } } }, - "/enrichment/mapping/data/download": { + "/incident/resolve": { "post": { - "operationId": "mapping-data-read-download", - "summary": "Download mapping data as CSV", - "description": "Export all data rows of a mapping schema as a CSV file download.", + "operationId": "incidentResolve", + "summary": "Resolve incident", + "description": "Mark an incident as resolved.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) or **Mappings Read** (`on-call`) or **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- The response is a CSV file with `Content-Disposition: attachment` header.\n- The CSV header row matches the schema's source and result labels in order.", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-data-read-download", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-resolve", "metadata": { - "sidebarTitle": "Download mapping data as CSV" + "sidebarTitle": "Resolve incident" } }, "responses": { @@ -10372,7 +9553,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CsvFileResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -10380,7 +9561,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": "host,owner,team,service\nserver01,alice,sre,api\n" + "data": {} } } } @@ -10403,29 +9584,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingSchemaIDRequest" + "$ref": "#/components/schemas/ResolveIncidentRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01" + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ], + "root_cause": "Memory leak in the connection pool caused by a missing cleanup call.", + "resolution": "Deployed hotfix v2.3.1 and restarted the affected service." } } } } } }, - "/enrichment/mapping/api/list": { + "/incident/responder/add": { "post": { - "operationId": "mapping-api-read-list", - "summary": "List mapping APIs", - "description": "Return all mapping APIs configured for the account.", + "operationId": "incidentResponderAdd", + "summary": "Add incident responder", + "description": "Add a responder to an existing incident.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Read** (`on-call`) or **Mappings Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-api-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-responder-add", "metadata": { - "sidebarTitle": "List mapping APIs" + "sidebarTitle": "Add incident responder" } }, "responses": { @@ -10442,7 +9627,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingAPIListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -10450,28 +9635,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 1, - "items": [ - { - "api_id": "665f1a2b3c4d5e6f7a8b9c02", - "api_name": "CMDB API", - "description": "Query CMDB for host metadata", - "url": "https://cmdb.example.com/api/lookup", - "headers": { - "X-Token": "***" - }, - "timeout": 2, - "retry_count": 1, - "insecure_skip_verify": false, - "status": "enabled", - "team_id": 0, - "creator_id": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 - } - ] - } + "data": {} } } } @@ -10494,27 +9658,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmptyRequest" + "$ref": "#/components/schemas/AddIncidentResponderRequest" }, - "example": {} + "example": { + "incident_id": "69da451ef77b1b51f40e83ee", + "person_ids": [ + 2476444212131, + 2476444212132 + ] + } } } } } }, - "/enrichment/mapping/api/info": { + "/incident/snooze": { "post": { - "operationId": "mapping-api-read-info", - "summary": "Get mapping API detail", - "description": "Return detail of a single mapping API by its ID.", + "operationId": "incidentSnooze", + "summary": "Snooze incident", + "description": "Temporarily snooze notifications for an incident until a specified time.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Returns `null` if the API does not exist.", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-api-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-snooze", "metadata": { - "sidebarTitle": "Get mapping API detail" + "sidebarTitle": "Snooze incident" } }, "responses": { @@ -10531,7 +9701,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingAPIItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -10539,18 +9709,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "api_id": "665f1a2b3c4d5e6f7a8b9c02", - "api_name": "CMDB API", - "url": "https://cmdb.example.com/api/lookup", - "timeout": 2, - "retry_count": 1, - "insecure_skip_verify": false, - "status": "enabled", - "creator_id": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 - } + "data": {} } } } @@ -10573,29 +9732,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingAPIIDRequest" + "$ref": "#/components/schemas/SnoozeIncidentRequest" }, "example": { - "api_id": "665f1a2b3c4d5e6f7a8b9c02" + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ], + "minutes": 60 } } } } } }, - "/enrichment/mapping/api/create": { + "/incident/unack": { "post": { - "operationId": "mapping-api-write-create", - "summary": "Create mapping API", - "description": "Create a new external HTTP API endpoint used to enrich alerts via HTTP lookup.", + "operationId": "incidentUnack", + "summary": "Unacknowledge incident", + "description": "Remove the acknowledge status from an incident.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- `url` must start with `http://` or `https://` and cannot resolve to an internal IP (in SaaS mode).\n- `timeout` is the HTTP read timeout in seconds (1–3, default 2).\n- `retry_count` is the number of retries on failure (0–1, default 0).\n- Headers with security-sensitive names (e.g. `authorization`, `cookie`) are rejected in SaaS mode.\n- An account can have at most 50 mapping APIs.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-api-write-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-unack", "metadata": { - "sidebarTitle": "Create mapping API" + "sidebarTitle": "Unacknowledge incident" } }, "responses": { @@ -10612,7 +9774,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingAPICreateResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -10620,10 +9782,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "api_id": "665f1a2b3c4d5e6f7a8b9c02", - "api_name": "CMDB API" - } + "data": {} } } } @@ -10646,37 +9805,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingAPICreateRequest" + "$ref": "#/components/schemas/UnackIncidentRequest" }, "example": { - "api_name": "CMDB API", - "description": "Query CMDB for host metadata", - "url": "https://cmdb.example.com/api/lookup", - "headers": { - "X-Token": "mytoken" - }, - "timeout": 2, - "retry_count": 1, - "insecure_skip_verify": false + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ] } } } } } }, - "/enrichment/mapping/api/update": { + "/incident/wake": { "post": { - "operationId": "mapping-api-write-update", - "summary": "Update mapping API", - "description": "Update configuration of an existing mapping API.", + "operationId": "incidentWake", + "summary": "Wake incident", + "description": "Cancel the snooze on an incident and resume notifications.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- Only the API creator, account admin, or team member can update the API.\n- All updatable fields are optional — only provided fields are changed.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-api-write-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-wake", "metadata": { - "sidebarTitle": "Update mapping API" + "sidebarTitle": "Wake incident" } }, "responses": { @@ -10724,31 +9877,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingAPIUpdateRequest" + "$ref": "#/components/schemas/WakeIncidentRequest" }, "example": { - "api_id": "665f1a2b3c4d5e6f7a8b9c02", - "timeout": 3, - "retry_count": 1 + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ] } } } } } }, - "/enrichment/mapping/api/delete": { + "/incident/war-room/add-member": { "post": { - "operationId": "mapping-api-write-delete", - "summary": "Delete mapping API", - "description": "Delete a mapping API. Deletion is blocked if the API is referenced by any enrichment rule.", + "operationId": "incident-write-add-war-room-member", + "summary": "Add war-room member", + "description": "Add one or more members to the IM war room bound to an incident integration.", "tags": [ - "On-call/Alert enrichment" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Mappings Manage** (`on-call`) |\n\n## Usage\n\n- If the API is still referenced, the response returns HTTP 400 with a `refs` list.\n- Only the API creator, account admin, or team member can delete the API.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/alert-enrichment/mapping-api-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", + "href": "/en/api-reference/on-call/incidents/incident-write-add-war-room-member", "metadata": { - "sidebarTitle": "Delete mapping API" + "sidebarTitle": "Add war-room member" } }, "responses": { @@ -10765,7 +9918,8 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "type": "string", + "description": "Returns the literal \"ok\" on success." } } } @@ -10773,7 +9927,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": "ok" } } } @@ -10796,29 +9950,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingAPIIDRequest" + "$ref": "#/components/schemas/AddWarRoomMemberRequest" }, "example": { - "api_id": "665f1a2b3c4d5e6f7a8b9c02" + "integration_id": 362, + "chat_id": "oc_5ce6d572455d361153b7cb51da133945", + "member_ids": [ + 20001, + 20002 + ] } } } } } }, - "/insight/alert/topk-by-label": { + "/incident/war-room/create": { "post": { - "operationId": "insightTopkAlertsByLabel", - "summary": "Get top-K alerts grouped by check or resource", - "description": "Return the top-K alert groups aggregated either by `check` or by `resource` label over the specified time range.", + "operationId": "incidentWarRoomCreate", + "summary": "Create war room", + "description": "Create a war room channel for collaborative incident response.", "tags": [ - "On-call/Analytics" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Analytics Read** (`on-call`) |", - "href": "/en/api-reference/on-call/analytics/insight-topk-alerts-by-label", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-war-room-create", "metadata": { - "sidebarTitle": "Get top-K alerts grouped by check or resource" + "sidebarTitle": "Create war room" } }, "responses": { @@ -10835,7 +9994,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/InsightAlertByLabelResponse" + "$ref": "#/components/schemas/WarRoom" } } } @@ -10844,23 +10003,9 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ - { - "label": "cpu-high", - "total_alert_cnt": 312, - "total_alert_event_cnt": 987 - }, - { - "label": "disk-full", - "total_alert_cnt": 178, - "total_alert_event_cnt": 452 - }, - { - "label": "memory-oom", - "total_alert_cnt": 94, - "total_alert_event_cnt": 231 - } - ] + "chat_id": "oc_a0553eda9014c2de1b3a8f75b4e0c000", + "chat_name": "Incident #0E83EE war room", + "share_link": "" } } } @@ -10884,33 +10029,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsightTopkAlertByLabelRequest" + "$ref": "#/components/schemas/CreateWarRoomRequest" }, "example": { - "start_time": 1712000000, - "end_time": 1712604800, - "label": "check", - "k": 10, - "orderby": "total_alert_cnt" + "incident_id": "69da451ef77b1b51f40e83ee", + "integration_id": 2490562293131, + "add_observers": true } } } } } }, - "/insight/account": { + "/incident/war-room/default-observers": { "post": { - "operationId": "insightByAccount", - "summary": "Get account-level insight", - "description": "Return aggregated incident insight metrics for the entire account.", + "operationId": "incident-read-get-war-room-default-observers", + "summary": "Get war-room default observers", + "description": "Return historical responders suggested as default observers when opening a war room.", "tags": [ - "On-call/Analytics" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Analytics Read** (`on-call`) |", - "href": "/en/api-reference/on-call/analytics/insight-by-account", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", + "href": "/en/api-reference/on-call/incidents/incident-read-get-war-room-default-observers", "metadata": { - "sidebarTitle": "Get account-level insight" + "sidebarTitle": "Get war-room default observers" } }, "responses": { @@ -10927,7 +10070,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DimensionInsightResponse" + "$ref": "#/components/schemas/GetWarRoomDefaultObserversResponse" } } } @@ -10936,30 +10079,18 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ + "observers": [ { - "ts": 1740844800, - "total_incident_cnt": 2, - "total_incidents_acknowledged": 2, - "total_incidents_closed": 2, - "total_incidents_auto_closed": 0, - "total_incidents_manually_closed": 2, - "total_incidents_timeout_closed": 0, - "total_incidents_escalated": 0, - "total_incidents_manually_escalated": 0, - "total_incidents_timeout_escalated": 0, - "total_incidents_reassigned": 2, - "total_interruptions": 3, - "total_notifications": 6, - "total_engaged_seconds": 3317709, - "total_seconds_to_ack": 3317709, - "total_seconds_to_close": 3749514, - "mean_seconds_to_ack": 1658854.5, - "mean_seconds_to_close": 1874757, - "noise_reduction_pct": 0, - "acknowledgement_pct": 100, - "total_alert_cnt": 0, - "total_alert_event_cnt": 0 + "account_id": 10001, + "person_id": 20001, + "person_name": "Alice Chen", + "avatar": "https://cdn.flashcat.cloud/avatar/20001.png", + "email": "alice@acme.com", + "phone": "+8613800000000", + "locale": "zh-CN", + "time_zone": "Asia/Shanghai", + "as": "responder", + "status": "active" } ] } @@ -10985,35 +10116,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsightQueryRequest" + "$ref": "#/components/schemas/GetWarRoomDefaultObserversRequest" }, "example": { - "start_time": 1712000000, - "end_time": 1712604800, - "aggregate_unit": "day", - "severities": [ - "Critical", - "Warning" - ] + "incident_id": "664a1b2c3d4e5f6a7b8c9d0e" } } } } } }, - "/insight/incident/list": { + "/incident/war-room/delete": { "post": { - "operationId": "insightIncidentList", - "summary": "List insight incidents", - "description": "Return a paged list of incidents with per-incident handling metrics used by the analytics dashboard.", + "operationId": "incidentWarRoomDelete", + "summary": "Delete war room", + "description": "Delete an incident war room.", "tags": [ - "On-call/Analytics" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Analytics Read** (`on-call`) |", - "href": "/en/api-reference/on-call/analytics/insight-incident-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-war-room-delete", "metadata": { - "sidebarTitle": "List insight incidents" + "sidebarTitle": "Delete war room" } }, "responses": { @@ -11030,7 +10155,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/InsightIncidentListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -11038,58 +10163,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 2, - "has_next_page": false, - "items": [ - { - "incident_id": "67ca560c381a4fedb664f5f8", - "title": "CPU spike on prod-web-01", - "description": "CPU usage exceeded 90% threshold", - "team_id": 4295771902131, - "team_name": "SRE Team", - "channel_id": 4321322010131, - "channel_name": "Production Alerts", - "progress": "Closed", - "severity": "Info", - "created_at": 1741313548, - "closed_by": "manually", - "seconds_to_ack": 1052085, - "seconds_to_close": 1483880, - "engaged_seconds": 1052085, - "hours": "work", - "responders": [ - { - "person_id": 3790925372131, - "assigned_at": 1741313548, - "acknowledged_at": 1742365633, - "person_name": "alice", - "email": "alice@example.com" - } - ], - "assigned_to": { - "person_ids": [ - 3790925372131 - ], - "escalate_rule_id": "000000000000000000000000", - "layer_idx": 0, - "type": "reassign" - }, - "labels": {}, - "fields": {}, - "notifications": 4, - "interruptions": 2, - "assignments": 2, - "reassignments": 1, - "acknowledgements": 1, - "escalations": 0, - "timeout_escalations": 0, - "manual_escalations": 0, - "creator_id": 3790925372131, - "creator_name": "alice" - } - ] - } + "data": {} } } } @@ -11112,35 +10186,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsightIncidentListRequest" + "$ref": "#/components/schemas/DeleteWarRoomRequest" }, "example": { - "start_time": 1712000000, - "end_time": 1712604800, - "p": 1, - "limit": 20, - "severities": [ - "Critical" - ] + "incident_id": "69da451ef77b1b51f40e83ee", + "integration_id": 2490562293131 } } } } } }, - "/insight/incident/export": { + "/incident/war-room/detail": { "post": { - "operationId": "insightIncidentExport", - "summary": "Export insight incidents", - "description": "Export the filtered incident analytics list as a CSV file. The response is a CSV stream delivered with `Content-Disposition: attachment` — it is not a JSON envelope.", + "operationId": "incidentWarRoomDetail", + "summary": "Get war room detail", + "description": "Retrieve the war room configuration and members for an incident.", "tags": [ - "On-call/Analytics" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **10 requests/minute**; **1 requests/second** per account |\n| Permissions | **Analytics Read** (`on-call`) |", - "href": "/en/api-reference/on-call/analytics/insight-incident-export", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-war-room-detail", "metadata": { - "sidebarTitle": "Export insight incidents" + "sidebarTitle": "Get war room detail" } }, "responses": { @@ -11157,7 +10226,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/WarRoom" } } } @@ -11165,7 +10234,11 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "chat_id": "oc_a0553eda9014c2de1b3a8f75b4e0c000", + "chat_name": "Incident #0E83EE war room", + "share_link": "" + } } } } @@ -11188,42 +10261,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsightIncidentExportRequest" + "$ref": "#/components/schemas/GetWarRoomDetailRequest" }, "example": { - "start_time": 1712000000, - "end_time": 1712604800, - "severities": [ - "Critical", - "Warning" - ], - "export_fields": [ - "incident_id", - "title", - "severity", - "created_at", - "seconds_to_close" - ], - "description_html_to_text": true + "integration_id": 2490562293131, + "chat_id": "oc_a0553eda9014c2de1b3a8f75b4e0c000" } } } } } }, - "/insight/channel": { + "/incident/war-room/list": { "post": { - "operationId": "insightByChannel", - "summary": "Get channel insight", - "description": "Return insight metrics aggregated by channel.", + "operationId": "incidentWarRoomList", + "summary": "List war rooms", + "description": "List all war rooms associated with an incident.", "tags": [ - "On-call/Analytics" + "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Analytics Read** (`on-call`) |", - "href": "/en/api-reference/on-call/analytics/insight-by-channel", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", + "href": "/en/api-reference/on-call/incidents/incident-war-room-list", "metadata": { - "sidebarTitle": "Get channel insight" + "sidebarTitle": "List war rooms" } }, "responses": { @@ -11240,7 +10301,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DimensionInsightResponse" + "$ref": "#/components/schemas/ListWarRoomsResponse" } } } @@ -11249,34 +10310,7 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ - { - "ts": 1740844800, - "channel_id": 4321322010131, - "channel_name": "Production Alerts", - "total_incident_cnt": 2, - "total_incidents_acknowledged": 2, - "total_incidents_closed": 2, - "total_incidents_auto_closed": 0, - "total_incidents_manually_closed": 2, - "total_incidents_timeout_closed": 0, - "total_incidents_escalated": 0, - "total_incidents_manually_escalated": 0, - "total_incidents_timeout_escalated": 0, - "total_incidents_reassigned": 2, - "total_interruptions": 3, - "total_notifications": 6, - "total_engaged_seconds": 3317709, - "total_seconds_to_ack": 3317709, - "total_seconds_to_close": 3749514, - "mean_seconds_to_ack": 1658854.5, - "mean_seconds_to_close": 1874757, - "noise_reduction_pct": 0, - "acknowledgement_pct": 100, - "total_alert_cnt": 0, - "total_alert_event_cnt": 0 - } - ] + "items": [] } } } @@ -11300,34 +10334,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsightQueryRequest" + "$ref": "#/components/schemas/ListWarRoomsRequest" }, "example": { - "start_time": 1712000000, - "end_time": 1712604800, - "channel_ids": [ - 4321322010131 - ], - "aggregate_unit": "day" + "incident_id": "69da451ef77b1b51f40e83ee" } } } } } }, - "/insight/channel/export": { + "/insight/account": { "post": { - "operationId": "insightChannelExport", - "summary": "Export channel insight", - "description": "Export channel insight metrics as a CSV file. The response is a CSV stream delivered with `Content-Disposition: attachment` — it is not a JSON envelope.", + "operationId": "insightByAccount", + "summary": "Get account-level insight", + "description": "Return aggregated incident insight metrics for the entire account.", "tags": [ "On-call/Analytics" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **10 requests/minute**; **1 requests/second** per account |\n| Permissions | **Analytics Read** (`on-call`) |", - "href": "/en/api-reference/on-call/analytics/insight-channel-export", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Analytics Read** (`on-call`) |", + "href": "/en/api-reference/on-call/analytics/insight-by-account", "metadata": { - "sidebarTitle": "Export channel insight" + "sidebarTitle": "Get account-level insight" } }, "responses": { @@ -11344,7 +10373,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/DimensionInsightResponse" } } } @@ -11352,7 +10381,34 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "ts": 1740844800, + "total_incident_cnt": 2, + "total_incidents_acknowledged": 2, + "total_incidents_closed": 2, + "total_incidents_auto_closed": 0, + "total_incidents_manually_closed": 2, + "total_incidents_timeout_closed": 0, + "total_incidents_escalated": 0, + "total_incidents_manually_escalated": 0, + "total_incidents_timeout_escalated": 0, + "total_incidents_reassigned": 2, + "total_interruptions": 3, + "total_notifications": 6, + "total_engaged_seconds": 3317709, + "total_seconds_to_ack": 3317709, + "total_seconds_to_close": 3749514, + "mean_seconds_to_ack": 1658854.5, + "mean_seconds_to_close": 1874757, + "noise_reduction_pct": 0, + "acknowledgement_pct": 100, + "total_alert_cnt": 0, + "total_alert_event_cnt": 0 + } + ] + } } } } @@ -11380,9 +10436,7 @@ "example": { "start_time": 1712000000, "end_time": 1712604800, - "channel_ids": [ - 4321322010131 - ], + "aggregate_unit": "day", "severities": [ "Critical", "Warning" @@ -11393,19 +10447,19 @@ } } }, - "/insight/team": { + "/insight/alert/topk-by-label": { "post": { - "operationId": "insightByTeam", - "summary": "Get team insight", - "description": "Return insight metrics aggregated by team.", + "operationId": "insightTopkAlertsByLabel", + "summary": "Get top-K alerts grouped by check or resource", + "description": "Return the top-K alert groups aggregated either by `check` or by `resource` label over the specified time range.", "tags": [ "On-call/Analytics" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Analytics Read** (`on-call`) |", - "href": "/en/api-reference/on-call/analytics/insight-by-team", + "href": "/en/api-reference/on-call/analytics/insight-topk-alerts-by-label", "metadata": { - "sidebarTitle": "Get team insight" + "sidebarTitle": "Get top-K alerts grouped by check or resource" } }, "responses": { @@ -11422,7 +10476,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DimensionInsightResponse" + "$ref": "#/components/schemas/InsightAlertByLabelResponse" } } } @@ -11433,26 +10487,118 @@ "data": { "items": [ { - "ts": 1740844800, - "team_id": 4295771902131, - "team_name": "SRE Team", - "total_incident_cnt": 2, - "total_incidents_acknowledged": 2, - "total_incidents_closed": 2, - "total_incidents_auto_closed": 0, - "total_incidents_manually_closed": 2, - "total_incidents_timeout_closed": 0, - "total_incidents_escalated": 0, - "total_incidents_manually_escalated": 0, - "total_incidents_timeout_escalated": 0, - "total_incidents_reassigned": 2, - "total_interruptions": 3, - "total_notifications": 6, - "total_engaged_seconds": 3317709, - "total_seconds_to_ack": 3317709, - "total_seconds_to_close": 3749514, - "mean_seconds_to_ack": 1658854.5, - "mean_seconds_to_close": 1874757, + "label": "cpu-high", + "total_alert_cnt": 312, + "total_alert_event_cnt": 987 + }, + { + "label": "disk-full", + "total_alert_cnt": 178, + "total_alert_event_cnt": 452 + }, + { + "label": "memory-oom", + "total_alert_cnt": 94, + "total_alert_event_cnt": 231 + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightTopkAlertByLabelRequest" + }, + "example": { + "start_time": 1712000000, + "end_time": 1712604800, + "label": "check", + "k": 10, + "orderby": "total_alert_cnt" + } + } + } + } + } + }, + "/insight/channel": { + "post": { + "operationId": "insightByChannel", + "summary": "Get channel insight", + "description": "Return insight metrics aggregated by channel.", + "tags": [ + "On-call/Analytics" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Analytics Read** (`on-call`) |", + "href": "/en/api-reference/on-call/analytics/insight-by-channel", + "metadata": { + "sidebarTitle": "Get channel insight" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/DimensionInsightResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "items": [ + { + "ts": 1740844800, + "channel_id": 4321322010131, + "channel_name": "Production Alerts", + "total_incident_cnt": 2, + "total_incidents_acknowledged": 2, + "total_incidents_closed": 2, + "total_incidents_auto_closed": 0, + "total_incidents_manually_closed": 2, + "total_incidents_timeout_closed": 0, + "total_incidents_escalated": 0, + "total_incidents_manually_escalated": 0, + "total_incidents_timeout_escalated": 0, + "total_incidents_reassigned": 2, + "total_interruptions": 3, + "total_notifications": 6, + "total_engaged_seconds": 3317709, + "total_seconds_to_ack": 3317709, + "total_seconds_to_close": 3749514, + "mean_seconds_to_ack": 1658854.5, + "mean_seconds_to_close": 1874757, "noise_reduction_pct": 0, "acknowledgement_pct": 100, "total_alert_cnt": 0, @@ -11487,8 +10633,8 @@ "example": { "start_time": 1712000000, "end_time": 1712604800, - "team_ids": [ - 4295771902131 + "channel_ids": [ + 4321322010131 ], "aggregate_unit": "day" } @@ -11497,19 +10643,19 @@ } } }, - "/insight/team/export": { + "/insight/channel/export": { "post": { - "operationId": "insightTeamExport", - "summary": "Export team insight", - "description": "Export team insight metrics as a CSV file. The response is a CSV stream delivered with `Content-Disposition: attachment` — it is not a JSON envelope.", + "operationId": "insightChannelExport", + "summary": "Export channel insight", + "description": "Export channel insight metrics as a CSV file. The response is a CSV stream delivered with `Content-Disposition: attachment` — it is not a JSON envelope.", "tags": [ "On-call/Analytics" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **10 requests/minute**; **1 requests/second** per account |\n| Permissions | **Analytics Read** (`on-call`) |", - "href": "/en/api-reference/on-call/analytics/insight-team-export", + "href": "/en/api-reference/on-call/analytics/insight-channel-export", "metadata": { - "sidebarTitle": "Export team insight" + "sidebarTitle": "Export channel insight" } }, "responses": { @@ -11562,8 +10708,8 @@ "example": { "start_time": 1712000000, "end_time": 1712604800, - "team_ids": [ - 4295771902131 + "channel_ids": [ + 4321322010131 ], "severities": [ "Critical", @@ -11575,6 +10721,216 @@ } } }, + "/insight/incident/export": { + "post": { + "operationId": "insightIncidentExport", + "summary": "Export insight incidents", + "description": "Export the filtered incident analytics list as a CSV file. The response is a CSV stream delivered with `Content-Disposition: attachment` — it is not a JSON envelope.", + "tags": [ + "On-call/Analytics" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **10 requests/minute**; **1 requests/second** per account |\n| Permissions | **Analytics Read** (`on-call`) |", + "href": "/en/api-reference/on-call/analytics/insight-incident-export", + "metadata": { + "sidebarTitle": "Export insight incidents" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/EmptyResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": {} + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightIncidentExportRequest" + }, + "example": { + "start_time": 1712000000, + "end_time": 1712604800, + "severities": [ + "Critical", + "Warning" + ], + "export_fields": [ + "incident_id", + "title", + "severity", + "created_at", + "seconds_to_close" + ], + "description_html_to_text": true + } + } + } + } + } + }, + "/insight/incident/list": { + "post": { + "operationId": "insightIncidentList", + "summary": "List insight incidents", + "description": "Return a paged list of incidents with per-incident handling metrics used by the analytics dashboard.", + "tags": [ + "On-call/Analytics" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Analytics Read** (`on-call`) |", + "href": "/en/api-reference/on-call/analytics/insight-incident-list", + "metadata": { + "sidebarTitle": "List insight incidents" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/InsightIncidentListResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "total": 2, + "has_next_page": false, + "items": [ + { + "incident_id": "67ca560c381a4fedb664f5f8", + "title": "CPU spike on prod-web-01", + "description": "CPU usage exceeded 90% threshold", + "team_id": 4295771902131, + "team_name": "SRE Team", + "channel_id": 4321322010131, + "channel_name": "Production Alerts", + "progress": "Closed", + "severity": "Info", + "created_at": 1741313548, + "closed_by": "manually", + "seconds_to_ack": 1052085, + "seconds_to_close": 1483880, + "engaged_seconds": 1052085, + "hours": "work", + "responders": [ + { + "person_id": 3790925372131, + "assigned_at": 1741313548, + "acknowledged_at": 1742365633, + "person_name": "alice", + "email": "alice@example.com" + } + ], + "assigned_to": { + "person_ids": [ + 3790925372131 + ], + "escalate_rule_id": "000000000000000000000000", + "layer_idx": 0, + "type": "reassign" + }, + "labels": {}, + "fields": {}, + "notifications": 4, + "interruptions": 2, + "assignments": 2, + "reassignments": 1, + "acknowledgements": 1, + "escalations": 0, + "timeout_escalations": 0, + "manual_escalations": 0, + "creator_id": 3790925372131, + "creator_name": "alice" + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightIncidentListRequest" + }, + "example": { + "start_time": 1712000000, + "end_time": 1712604800, + "p": 1, + "limit": 20, + "severities": [ + "Critical" + ] + } + } + } + } + } + }, "/insight/responder": { "post": { "operationId": "insightByResponder", @@ -11748,19 +11104,19 @@ } } }, - "/status-page/change/info": { - "get": { - "operationId": "statusPageChangeInfo", - "summary": "Get status page event detail", - "description": "Retrieve details of a specific status page event (incident or maintenance).", + "/insight/team": { + "post": { + "operationId": "insightByTeam", + "summary": "Get team insight", + "description": "Return insight metrics aggregated by team.", "tags": [ - "On-call/Status pages" + "On-call/Analytics" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/status-pages/status-page-change-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Analytics Read** (`on-call`) |", + "href": "/en/api-reference/on-call/analytics/insight-by-team", "metadata": { - "sidebarTitle": "Get status page event detail" + "sidebarTitle": "Get team insight" } }, "responses": { @@ -11777,7 +11133,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageChangeItem" + "$ref": "#/components/schemas/DimensionInsightResponse" } } } @@ -11786,53 +11142,34 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "change_id": 5821693893131, - "page_id": 5750613685214, - "type": "incident", - "title": "Web Console Degraded Performance", - "description": "The issue has been resolved, and all services are operating normally.\n\nThank you for your patience.", - "status": "resolved", - "affected_components": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", - "name": "Web Console", - "available_since_seconds": 1765349358, - "order_id": 1, - "status": "operational" - } - ], - "start_at_seconds": 1766736878, - "close_at_seconds": 1775529742, - "updates": [ - { - "update_id": "01KDCVJQ88SZPHWPTDV2Z2AZW8", - "at_seconds": 1766736876, - "status": "investigating", - "description": "We are currently investigating an issue affecting some services.", - "component_changes": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "component_name": "Web Console", - "status": "degraded" - } - ] - }, + "items": [ { - "update_id": "01KNJX3KW873ZZSRZC14SGFYS3", - "at_seconds": 1775529742, - "status": "resolved", - "description": "The issue has been resolved, and all services are operating normally.", - "component_changes": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "component_name": "Web Console", - "status": "operational" - } - ] + "ts": 1740844800, + "team_id": 4295771902131, + "team_name": "SRE Team", + "total_incident_cnt": 2, + "total_incidents_acknowledged": 2, + "total_incidents_closed": 2, + "total_incidents_auto_closed": 0, + "total_incidents_manually_closed": 2, + "total_incidents_timeout_closed": 0, + "total_incidents_escalated": 0, + "total_incidents_manually_escalated": 0, + "total_incidents_timeout_escalated": 0, + "total_incidents_reassigned": 2, + "total_interruptions": 3, + "total_notifications": 6, + "total_engaged_seconds": 3317709, + "total_seconds_to_ack": 3317709, + "total_seconds_to_close": 3749514, + "mean_seconds_to_ack": 1658854.5, + "mean_seconds_to_close": 1874757, + "noise_reduction_pct": 0, + "acknowledgement_pct": 100, + "total_alert_cnt": 0, + "total_alert_event_cnt": 0 } - ], - "notify_subscribers": true + ] } } } @@ -11851,43 +11188,39 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "page_id", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Status page ID." - }, - { - "name": "change_id", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Event (change) ID." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightQueryRequest" + }, + "example": { + "start_time": 1712000000, + "end_time": 1712604800, + "team_ids": [ + 4295771902131 + ], + "aggregate_unit": "day" + } + } } - ] + } } }, - "/status-page/change/list": { - "get": { - "operationId": "statusPageChangeList", - "summary": "List status page events", - "description": "List events (incidents and maintenances) for a status page.", + "/insight/team/export": { + "post": { + "operationId": "insightTeamExport", + "summary": "Export team insight", + "description": "Export team insight metrics as a CSV file. The response is a CSV stream delivered with `Content-Disposition: attachment` — it is not a JSON envelope.", "tags": [ - "On-call/Status pages" + "On-call/Analytics" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/status-pages/status-page-change-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **10 requests/minute**; **1 requests/second** per account |\n| Permissions | **Analytics Read** (`on-call`) |", + "href": "/en/api-reference/on-call/analytics/insight-team-export", "metadata": { - "sidebarTitle": "List status page events" + "sidebarTitle": "Export team insight" } }, "responses": { @@ -11904,7 +11237,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageChangeListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -11912,59 +11245,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "change_id": 5821693893131, - "page_id": 5750613685214, - "type": "incident", - "title": "Web Console Degraded Performance", - "description": "The issue has been resolved, and all services are operating normally.", - "status": "resolved", - "affected_components": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", - "name": "Web Console", - "available_since_seconds": 1765349358, - "order_id": 1, - "status": "operational" - } - ], - "start_at_seconds": 1766736878, - "close_at_seconds": 1775529742, - "updates": [ - { - "update_id": "01KDCVJQ88SZPHWPTDV2Z2AZW8", - "at_seconds": 1766736876, - "status": "investigating", - "description": "We are currently investigating an issue affecting some services.", - "component_changes": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "component_name": "Web Console", - "status": "degraded" - } - ] - }, - { - "update_id": "01KNJX3KW873ZZSRZC14SGFYS3", - "at_seconds": 1775529742, - "status": "resolved", - "description": "The issue has been resolved, and all services are operating normally.", - "component_changes": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "component_name": "Web Console", - "status": "operational" - } - ] - } - ], - "notify_subscribers": true - } - ] - } + "data": {} } } } @@ -11982,84 +11263,42 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "page_id", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Status page ID." - }, - { - "name": "start_at_seconds", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Filter events started at or after this unix timestamp (seconds)." - }, - { - "name": "end_at_seconds", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Filter events started at or before this unix timestamp (seconds)." - }, - { - "name": "type", - "in": "query", - "required": true, - "schema": { - "type": "string", - "enum": [ - "incident", - "maintenance" - ] - }, - "description": "Event type filter. Required." - }, - { - "name": "status", - "in": "query", - "required": true, - "schema": { - "type": "string", - "enum": [ - "investigating", - "identified", - "monitoring", - "resolved", - "scheduled", - "ongoing", - "completed" - ] - }, - "description": "Event status filter. Required. Must be a status valid for the given `type` (e.g. `investigating`/`identified`/`monitoring`/`resolved` for incidents; `scheduled`/`ongoing`/`completed` for maintenances)." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightQueryRequest" + }, + "example": { + "start_time": 1712000000, + "end_time": 1712604800, + "team_ids": [ + 4295771902131 + ], + "severities": [ + "Critical", + "Warning" + ] + } + } } - ] + } } }, - "/status-page/change/active/list": { - "get": { - "operationId": "statusPageChangeActiveList", - "summary": "List active status page events", - "description": "List in-progress (non-terminal) events of a given type for a status page.", + "/member/delete": { + "post": { + "operationId": "memberDelete", + "summary": "Delete member", + "description": "Remove a member from the organization by ID, email, phone, or name.", "tags": [ - "On-call/Status pages" + "Platform/Members" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/status-pages/status-page-change-active-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Members Manage** (`organization`) |\n\n## Usage\n\n- By default (`is_force=false`), the system checks whether the member is referenced by other resources (e.g., escalation rules, schedules). If references exist, the API returns error code `ReferenceExist` with the reference list in `data.refs`. Set `is_force=true` to skip the reference check and force delete.\n- Members provisioned via SSO with `sso_user_non_editable=true` cannot be deleted through this API. Disable that SSO restriction first.\n- This operation is recorded in the audit log.", + "href": "/en/api-reference/platform/members/member-delete", "metadata": { - "sidebarTitle": "List active status page events" + "sidebarTitle": "Delete member" } }, "responses": { @@ -12076,7 +11315,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageChangeListResponse" + "$ref": "#/components/schemas/MemberEmptyObject" } } } @@ -12084,45 +11323,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "change_id": 5821693893131, - "page_id": 5750613685214, - "type": "incident", - "title": "Web Console Degraded Performance", - "description": "We are currently investigating an issue affecting some services.", - "status": "investigating", - "affected_components": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", - "name": "Web Console", - "available_since_seconds": 1765349358, - "order_id": 1, - "status": "degraded" - } - ], - "start_at_seconds": 1766736878, - "updates": [ - { - "update_id": "01KDCVJQ88SZPHWPTDV2Z2AZW8", - "at_seconds": 1766736876, - "status": "investigating", - "description": "We are currently investigating an issue affecting some services.", - "component_changes": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "component_name": "Web Console", - "status": "degraded" - } - ] - } - ], - "notify_subscribers": true - } - ] - } + "data": {} } } } @@ -12140,46 +11341,34 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "page_id", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Status page ID." - }, - { - "name": "type", - "in": "query", - "required": true, - "schema": { - "type": "string", - "enum": [ - "incident", - "maintenance" - ] - }, - "description": "Event type filter. Required. Returns only in-progress (non-terminal) events — `investigating`/`identified`/`monitoring` for `incident`, `scheduled`/`ongoing` for `maintenance`." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MemberDeleteRequest" + }, + "example": { + "member_id": 5068740052131 + } + } } - ] + } } }, - "/status-page/change/create": { + "/member/info": { "post": { - "operationId": "statusPageChangeCreate", - "summary": "Create status page event", - "description": "Create a new incident or maintenance event on a status page.", + "operationId": "memberInfo", + "summary": "Get current member info", + "description": "Return the current session member's full profile.", "tags": [ - "On-call/Status pages" + "Platform/Members" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Events Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-change-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/platform/members/member-info", "metadata": { - "sidebarTitle": "Create status page event" + "sidebarTitle": "Get current member info" } }, "responses": { @@ -12196,7 +11385,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageChangeCreateResponse" + "$ref": "#/components/schemas/MemberInfoResponse" } } } @@ -12205,8 +11394,28 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "change_id": 6294539747131, - "change_name": "API Test Incident" + "account_avatar": "", + "account_email": "alice@example.com", + "account_id": 2451002751131, + "account_locale": "en-US", + "account_name": "Acme Corp", + "account_role_ids": [ + 6 + ], + "account_time_zone": "Asia/Shanghai", + "avatar": "/image/avatar1.png", + "country_code": "CN", + "created_at": 1701399971, + "domain": "acme", + "email": "alice@example.com", + "email_verified": true, + "is_external": false, + "locale": "zh-CN", + "member_id": 2476444212131, + "member_name": "Alice", + "phone": "+86185****0300", + "phone_verified": true, + "time_zone": "Asia/Shanghai" } } } @@ -12230,47 +11439,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateStatusPageChangeRequest" + "$ref": "#/components/schemas/MemberInfoRequest" }, - "example": { - "page_id": 5750613685214, - "type": "incident", - "title": "Web Console Degraded Performance", - "description": "We are investigating degraded performance affecting the web console.", - "status": "investigating", - "start_at_seconds": 1712000000, - "notify_subscribers": true, - "updates": [ - { - "status": "investigating", - "description": "We are currently investigating an issue affecting some users.", - "component_changes": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "status": "degraded" - } - ] - } - ] - } + "example": {} } } } } }, - "/status-page/change/update": { + "/member/info/reset": { "post": { - "operationId": "statusPageChangeUpdate", - "summary": "Update status page event", - "description": "Update an existing status page event.", + "operationId": "memberResetInfo", + "summary": "Reset member info", + "description": "Batch-update multiple profile fields of the current member.", "tags": [ - "On-call/Status pages" + "Platform/Members" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Events Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-change-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/platform/members/member-reset-info", "metadata": { - "sidebarTitle": "Update status page event" + "sidebarTitle": "Reset member info" } }, "responses": { @@ -12287,7 +11476,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/MemberEmptyObject" } } } @@ -12318,31 +11507,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateStatusPageChangeRequest" + "$ref": "#/components/schemas/MemberResetInfoRequest" }, "example": { - "page_id": 5750613685214, - "change_id": 5821693893131, - "title": "Web Console Degraded Performance (Updated)" + "member_id": 2476444212131, + "member_name": "Alice", + "locale": "zh-CN", + "time_zone": "Asia/Shanghai" } } } } } }, - "/status-page/change/delete": { + "/member/invite": { "post": { - "operationId": "statusPageChangeDelete", - "summary": "Delete status page event", - "description": "Delete a status page event.", + "operationId": "memberInvite", + "summary": "Invite members", + "description": "Batch invite new members to the organization by email or phone.", "tags": [ - "On-call/Status pages" + "Platform/Members" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Events Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-change-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Members Manage** (`organization`) |", + "href": "/en/api-reference/platform/members/member-invite", "metadata": { - "sidebarTitle": "Delete status page event" + "sidebarTitle": "Invite members" } }, "responses": { @@ -12359,7 +11549,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/MemberInviteResponse" } } } @@ -12367,7 +11557,14 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "member_id": 5068740052131, + "member_name": "Charlie" + } + ] + } } } } @@ -12390,30 +11587,39 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteStatusPageChangeRequest" + "$ref": "#/components/schemas/MemberInviteRequest" }, "example": { - "page_id": 5750613685214, - "change_id": 5821693893131 + "members": [ + { + "member_name": "Charlie", + "email": "charlie@example.com", + "locale": "en-US", + "time_zone": "Asia/Shanghai", + "role_ids": [ + 6 + ] + } + ] } } } } } }, - "/status-page/change/timeline/create": { + "/member/list": { "post": { - "operationId": "statusPageChangeTimelineCreate", - "summary": "Create event timeline entry", - "description": "Add a timeline update to a status page event.", + "operationId": "memberList", + "summary": "List members", + "description": "Return a paginated list of organization members.", "tags": [ - "On-call/Status pages" + "Platform/Members" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Events Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-change-timeline-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/platform/members/member-list", "metadata": { - "sidebarTitle": "Create event timeline entry" + "sidebarTitle": "List members" } }, "responses": { @@ -12430,7 +11636,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageChangeTimelineCreateResponse" + "$ref": "#/components/schemas/MemberListResponse" } } } @@ -12439,7 +11645,50 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "update_id": "01KP0311872NVYFRRQ82FWXAP4" + "p": 1, + "limit": 5, + "total": 148, + "items": [ + { + "account_id": 2451002751131, + "member_id": 5068740052131, + "member_name": "Bob", + "country_code": "", + "phone": "+86151****6519", + "email": "bob@example.com", + "phone_verified": true, + "email_verified": true, + "avatar": "", + "status": "enabled", + "account_role_ids": [ + 2, + 6 + ], + "created_at": 1752030749, + "updated_at": 1775962064, + "ref_id": "", + "is_external": false + }, + { + "account_id": 2451002751131, + "member_id": 2476444212131, + "member_name": "Alice", + "country_code": "CN", + "phone": "+86185****0300", + "email": "alice@example.com", + "phone_verified": true, + "email_verified": true, + "avatar": "/image/avatar1.png", + "status": "enabled", + "account_role_ids": [ + 6 + ], + "created_at": 1701399971, + "updated_at": 1775809507, + "ref_id": "", + "is_external": false + } + ] } } } @@ -12463,39 +11712,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateStatusPageChangeTimelineRequest" + "$ref": "#/components/schemas/MemberListRequest" }, "example": { - "page_id": 5750613685214, - "change_id": 5821693893131, - "status": "identified", - "description": "We have identified the root cause and are working on a fix.", - "at_seconds": 1712003600, - "component_changes": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "status": "partial_outage" - } - ] + "p": 1, + "limit": 5 } } } } } }, - "/status-page/change/timeline/update": { + "/member/role/grant": { "post": { - "operationId": "statusPageChangeTimelineUpdate", - "summary": "Update event timeline entry", - "description": "Update a timeline entry for a status page event.", + "operationId": "memberGrantRole", + "summary": "Grant role to member", + "description": "Add a role assignment to a member.", "tags": [ - "On-call/Status pages" + "Platform/Members" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Events Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-change-timeline-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Members Manage** (`organization`) |", + "href": "/en/api-reference/platform/members/member-grant-role", "metadata": { - "sidebarTitle": "Update event timeline entry" + "sidebarTitle": "Grant role to member" } }, "responses": { @@ -12512,7 +11752,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/MemberEmptyObject" } } } @@ -12543,33 +11783,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateStatusPageChangeTimelineRequest" + "$ref": "#/components/schemas/MemberRoleGrantRequest" }, "example": { - "page_id": 5750613685214, - "change_id": 5821693893131, - "update_id": "01KP0311872NVYFRRQ82FWXAP4", - "description": "Corrected description: root cause identified in database layer.", - "at_seconds": 1712003600 + "member_id": 5068740052131, + "role_ids": [ + 6 + ] } } } } } }, - "/status-page/change/timeline/delete": { + "/member/role/revoke": { "post": { - "operationId": "statusPageChangeTimelineDelete", - "summary": "Delete event timeline entry", - "description": "Delete a timeline entry from a status page event.", + "operationId": "memberRevokeRole", + "summary": "Revoke role from member", + "description": "Remove a role assignment from a member.", "tags": [ - "On-call/Status pages" + "Platform/Members" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Events Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-change-timeline-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Members Manage** (`organization`) |", + "href": "/en/api-reference/platform/members/member-revoke-role", "metadata": { - "sidebarTitle": "Delete event timeline entry" + "sidebarTitle": "Revoke role from member" } }, "responses": { @@ -12586,7 +11825,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/MemberEmptyObject" } } } @@ -12617,31 +11856,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteStatusPageChangeTimelineRequest" + "$ref": "#/components/schemas/MemberRoleRevokeRequest" }, "example": { - "page_id": 5750613685214, - "change_id": 5821693893131, - "update_id": "01KP0311872NVYFRRQ82FWXAP4" + "member_id": 5068740052131, + "role_ids": [ + 6 + ] } } } } } }, - "/status-page/subscriber/list": { - "get": { - "operationId": "statusPageSubscriberList", - "summary": "List status page subscribers", - "description": "List subscribers who have signed up for status page notifications.", + "/member/role/update": { + "post": { + "operationId": "memberUpdateRole", + "summary": "Update member roles", + "description": "Replace all role assignments for a member at once.", "tags": [ - "On-call/Status pages" + "Platform/Members" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/status-pages/status-page-subscriber-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Members Manage** (`organization`) |", + "href": "/en/api-reference/platform/members/member-update-role", "metadata": { - "sidebarTitle": "List status page subscribers" + "sidebarTitle": "Update member roles" } }, "responses": { @@ -12658,7 +11898,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageSubscriberListResponse" + "$ref": "#/components/schemas/MemberEmptyObject" } } } @@ -12666,26 +11906,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 2, - "has_next_page": false, - "items": [ - { - "recipient": "alice@example.com", - "method": "email", - "components": [], - "all": true, - "locale": "zh-CN" - }, - { - "recipient": "bob@example.com", - "method": "email", - "components": [], - "all": true, - "locale": "en-US" - } - ] - } + "data": {} } } } @@ -12703,67 +11924,38 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "page_id", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Status page ID." - }, - { - "name": "component_ids", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "description": "Comma-separated component IDs to filter subscribers by." - }, - { - "name": "p", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "minimum": 1, - "default": 1 - }, - "description": "Page number (1-based)." - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100, - "default": 10 - }, - "description": "Page size (1-100)." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MemberRoleUpdateRequest" + }, + "example": { + "member_id": 5068740052131, + "role_ids": [ + 2, + 6 + ] + } + } } - ] + } } }, - "/status-page/subscriber/import": { + "/monit/datasource/create": { "post": { - "operationId": "statusPageSubscriberImport", - "summary": "Import subscribers", - "description": "Bulk import subscribers for a status page.", + "operationId": "monit-datasource-write-create", + "summary": "Create datasource", + "description": "Create a new monitoring data source. The `payload` must include the type-specific configuration block.", "tags": [ - "On-call/Status pages" + "Monitors/Data sources" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **20 requests/minute**; **2 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-subscriber-import", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Datasources Manage** (`monit`) |\n\n## Usage\n\n- `type_ident` must be one of: `prometheus`, `loki`, `mysql`, `oracle`, `postgres`, `clickhouse`, `elasticsearch`, `sls`, `victorialogs`.\n- `edge_cluster_name` specifies which Monitors edge cluster evaluates rules using this datasource.\n- For `elasticsearch`, set `payload.elasticsearch.deployment` to `cloud` or `self-managed`.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/monitors/data-sources/monit-datasource-write-create", "metadata": { - "sidebarTitle": "Import subscribers" + "sidebarTitle": "Create datasource" } }, "responses": { @@ -12780,7 +11972,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/DataSourceItem" } } } @@ -12788,7 +11980,14 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "id": 10, + "type_ident": "prometheus", + "name": "Prometheus Prod", + "enabled": true, + "edge_cluster_name": "default", + "updated_at": 1712000000 + } } } } @@ -12811,45 +12010,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImportStatusPageSubscribersRequest" + "$ref": "#/components/schemas/DataSourceUpsertRequest" }, "example": { - "page_id": 5750613685214, - "method": "email", - "subscribers": [ - { - "recipient": "alice@example.com", - "all": true, - "locale": "en-US" - }, - { - "recipient": "bob@example.com", - "component_ids": [ - "01KC3GAZ6ZJE40H55GM31RPWZE" - ], - "all": false, - "locale": "zh-CN" + "type_ident": "prometheus", + "name": "Prometheus Prod", + "note": "Production Prometheus", + "address": "http://prometheus.example.com:9090", + "edge_cluster_name": "default", + "payload": { + "prometheus": { + "basic_auth_enabled": false } - ] + } } } } } } }, - "/status-page/subscriber/export": { + "/monit/datasource/delete": { "post": { - "operationId": "statusPageSubscriberExport", - "summary": "Export subscribers", - "description": "Export subscribers list for a status page as a CSV attachment. The response is a `text/csv` file with columns: Method, Recipient, Components, Subscribe All, Locale.", + "operationId": "monit-datasource-write-delete", + "summary": "Delete datasource", + "description": "Delete a data source by ID. Alert rules referencing this datasource must be updated or deleted first.", "tags": [ - "On-call/Status pages" + "Monitors/Data sources" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **10 requests/minute**; **1 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-subscriber-export", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Datasources Manage** (`monit`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/monitors/data-sources/monit-datasource-write-delete", "metadata": { - "sidebarTitle": "Export subscribers" + "sidebarTitle": "Delete datasource" } }, "responses": { @@ -12866,7 +12058,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageSubscriberExportResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -12874,7 +12066,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": "Method,Recipient,Components,Subscribe All,Locale\nemail,alice@example.com,,true,zh-CN\nemail,bob@example.com,,true,en-US" + "data": {} } } } @@ -12897,29 +12089,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ExportStatusPageSubscribersRequest" + "$ref": "#/components/schemas/IDRequest" }, "example": { - "page_id": 5750613685214 + "id": 10 } } } } } }, - "/status-page/migrate-structure": { + "/monit/datasource/info": { "post": { - "operationId": "statusPageMigrateStructure", - "summary": "Migrate status page structure", - "description": "Start a migration job that imports the structure and historical events of an Atlassian Statuspage into a new Flashduty status page.", + "operationId": "monit-datasource-read-info", + "summary": "Get datasource detail", + "description": "Retrieve full details of a single data source by its ID, including the `payload` configuration.", "tags": [ - "On-call/Status pages" + "Monitors/Data sources" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-migrate-structure", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Datasources Read** (`monit`) |", + "href": "/en/api-reference/monitors/data-sources/monit-datasource-read-info", "metadata": { - "sidebarTitle": "Migrate status page structure" + "sidebarTitle": "Get datasource detail" } }, "responses": { @@ -12936,7 +12128,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageMigrationStartResponse" + "$ref": "#/components/schemas/DataSourceItem" } } } @@ -12945,7 +12137,23 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "job_id": "01KP0311872NVYFRRQ82FW0001" + "id": 10, + "account_id": 10023, + "type_ident": "prometheus", + "name": "Prometheus Prod", + "enabled": true, + "note": "Production Prometheus", + "address": "http://prometheus.example.com:9090", + "payload": { + "prometheus": { + "basic_auth_enabled": false, + "basic_auth_username": "", + "basic_auth_password": "", + "tls_skip_verify": false + } + }, + "edge_cluster_name": "default", + "updated_at": 1712000000 } } } @@ -12969,30 +12177,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MigrateStatusPageStructureRequest" + "$ref": "#/components/schemas/IDRequest" }, "example": { - "api_key": "sk-stsp-xxxxxxxxxxxxxxxxxxxx", - "source_page_id": "abcdefghij" + "id": 10 } } } } } }, - "/status-page/migrate-email-subscribers": { + "/monit/datasource/list": { "post": { - "operationId": "statusPageMigrateEmailSubscribers", - "summary": "Migrate email subscribers", - "description": "Start a migration job that imports email subscribers from an Atlassian Statuspage into an existing Flashduty status page.", + "operationId": "monit-datasource-read-list", + "summary": "List datasources", + "description": "Return all data sources for the current account. Optionally filter by `type_ident`.", "tags": [ - "On-call/Status pages" + "Monitors/Data sources" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-migrate-email-subscribers", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Datasources Read** (`monit`) |\n\n## Usage\n\n- Omit `type_ident` to return all types.\n- Sensitive credential fields (passwords, keys) are not returned in the list response.", + "href": "/en/api-reference/monitors/data-sources/monit-datasource-read-list", "metadata": { - "sidebarTitle": "Migrate email subscribers" + "sidebarTitle": "List datasources" } }, "responses": { @@ -13009,7 +12216,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageMigrationStartResponse" + "$ref": "#/components/schemas/DataSourceListResponse" } } } @@ -13017,9 +12224,19 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "job_id": "01KP0311872NVYFRRQ82FW0002" - } + "data": [ + { + "id": 10, + "account_id": 10023, + "type_ident": "prometheus", + "name": "Prometheus Prod", + "enabled": true, + "note": "Production Prometheus", + "address": "http://prometheus.example.com:9090", + "edge_cluster_name": "default", + "updated_at": 1712000000 + } + ] } } } @@ -13042,31 +12259,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MigrateStatusPageEmailSubscribersRequest" + "$ref": "#/components/schemas/DataSourceListRequest" }, "example": { - "api_key": "sk-stsp-xxxxxxxxxxxxxxxxxxxx", - "source_page_id": "abcdefghij", - "target_page_id": 5750613685214 + "type": "prometheus" } } } } } }, - "/status-page/migration/status": { - "get": { - "operationId": "statusPageMigrationStatus", - "summary": "Get migration status", - "description": "Get the current status and progress of a status page migration job.", + "/monit/datasource/sls/logstores": { + "post": { + "operationId": "monit-datasource-read-sls-logstores", + "summary": "List SLS logstores", + "description": "List logstores within an SLS project for the specified SLS datasource.", "tags": [ - "On-call/Status pages" + "Monitors/Data sources" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/status-pages/status-page-migration-status", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Datasources Read** (`monit`) |\n\n## Usage\n\n- The datasource identified by `id` must be of type `sls`.\n- Supply `project` to select the SLS project whose logstores to list.", + "href": "/en/api-reference/monitors/data-sources/monit-datasource-read-sls-logstores", "metadata": { - "sidebarTitle": "Get migration status" + "sidebarTitle": "List SLS logstores" } }, "responses": { @@ -13083,7 +12298,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageMigrationJob" + "$ref": "#/components/schemas/SLSLogstoresResponse" } } } @@ -13091,27 +12306,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "job_id": "01KP0311872NVYFRRQ82FW0001", - "account_id": 2451002751131, - "source_page_id": "abcdefghij", - "target_page_id": 5750613685214, - "phase": "history", - "status": "completed", - "progress": { - "total_steps": 5, - "completed_steps": 5, - "components_imported": 8, - "sections_imported": 3, - "incidents_imported": 12, - "maintenances_imported": 2, - "subscribers_imported": 0, - "templates_imported": 0, - "subscribers_skipped": 0 - }, - "created_at": 1766736878, - "updated_at": 1766740000 - } + "data": [ + "logstore-1", + "logstore-2" + ] } } } @@ -13129,32 +12327,37 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "job_id", - "in": "query", - "required": true, - "schema": { - "type": "string" - }, - "description": "Migration job ID returned by `migrate-structure` or `migrate-email-subscribers`." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SLSLogstoresRequest" + }, + "example": { + "id": 10, + "project": "project-a", + "offset": 0, + "size": 50 + } + } } - ] + } } }, - "/status-page/migration/cancel": { + "/monit/datasource/sls/projects": { "post": { - "operationId": "statusPageMigrationCancel", - "summary": "Cancel status page migration", - "description": "Cancel an in-progress status page migration job. Only jobs currently in the `running` state can be cancelled.", + "operationId": "monit-datasource-read-sls-projects", + "summary": "List SLS projects", + "description": "List Alibaba Cloud SLS (Simple Log Service) projects available in the specified SLS datasource.", "tags": [ - "On-call/Status pages" + "Monitors/Data sources" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-migration-cancel", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Datasources Read** (`monit`) |\n\n## Usage\n\n- The datasource identified by `id` must be of type `sls`.\n- Use `query` to filter projects by name prefix. Use `offset` and `size` for pagination.", + "href": "/en/api-reference/monitors/data-sources/monit-datasource-read-sls-projects", "metadata": { - "sidebarTitle": "Cancel status page migration" + "sidebarTitle": "List SLS projects" } }, "responses": { @@ -13171,7 +12374,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/SLSProjectsResponse" } } } @@ -13179,7 +12382,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": [ + "project-a", + "project-b" + ] } } } @@ -13202,29 +12408,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CancelStatusPageMigrationRequest" + "$ref": "#/components/schemas/SLSProjectsRequest" }, "example": { - "job_id": "01KP0311872NVYFRRQ82FW0001" + "id": 10, + "query": "", + "offset": 0, + "size": 50 } } } } } }, - "/monit/rule/list/basic": { + "/monit/datasource/update": { "post": { - "operationId": "monit-rule-read-list", - "summary": "List alert rules", - "description": "Return the basic information of all alert rules in a folder. For full rule details, call `POST /monit/rule/info`.", + "operationId": "monit-datasource-write-update", + "summary": "Update datasource", + "description": "Update an existing data source. Supply `id` plus the fields to change.", "tags": [ - "Monitors/Alert rules" + "Monitors/Data sources" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |\n\n## Usage\n\n- Set `folder_id` to `0` to list all rules across all folders visible to the current user.\n- The `triggered` field indicates whether the rule has any currently active alerts.", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Datasources Manage** (`monit`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/monitors/data-sources/monit-datasource-write-update", "metadata": { - "sidebarTitle": "List alert rules" + "sidebarTitle": "Update datasource" } }, "responses": { @@ -13241,7 +12450,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleBasicListResponse" + "$ref": "#/components/schemas/DataSourceItem" } } } @@ -13249,17 +12458,14 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - { - "id": 50001, - "folder_id": 100, - "name": "CPU High", - "ds_type": "prometheus", - "enabled": true, - "triggered": true, - "created_at": 1710000000 - } - ] + "data": { + "id": 10, + "type_ident": "prometheus", + "name": "Prometheus Prod v2", + "enabled": true, + "edge_cluster_name": "default", + "updated_at": 1712100000 + } } } } @@ -13282,29 +12488,39 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleListRequest" + "$ref": "#/components/schemas/DataSourceUpsertRequest" }, "example": { - "folder_id": 100 + "id": 10, + "type_ident": "prometheus", + "name": "Prometheus Prod v2", + "note": "Updated", + "address": "http://prometheus-v2.example.com:9090", + "edge_cluster_name": "default", + "payload": { + "prometheus": { + "basic_auth_enabled": false + } + } } } } } } }, - "/monit/rule/info": { + "/monit/preview/sync": { "post": { - "operationId": "monit-rule-read-info", - "summary": "Get alert rule detail", - "description": "Return the full configuration of an alert rule by its ID, including rule queries, thresholds, and notification settings.", + "operationId": "monit-preview-sync", + "summary": "Preview datasource query", + "description": "Execute a synchronous datasource query and return the raw result. Used to preview alert rule expressions before saving.", "tags": [ - "Monitors/Alert rules" + "Monitors/Monitor utilities" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **60 requests/minute**; **10 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `ds_type` must match the datasource type (e.g. `prometheus`, `loki`).\n- `ds_name` is the display name of the datasource as configured in the account.\n- `delay_seconds` shifts the query window backward by the specified number of seconds, useful for accommodating data ingestion latency.\n- The response body is the raw JSON returned by the datasource — its schema varies by datasource type.", + "href": "/en/api-reference/monitors/monitor-utilities/monit-preview-sync", "metadata": { - "sidebarTitle": "Get alert rule detail" + "sidebarTitle": "Preview datasource query" } }, "responses": { @@ -13321,7 +12537,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertRuleInfoResponse" + "$ref": "#/components/schemas/PreviewSyncResponse" } } } @@ -13330,18 +12546,11 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "id": 50001, - "folder_id": 100, - "name": "CPU High", - "ds_type": "prometheus", - "ds_list": [ - "prometheus*" - ], - "enabled": true, - "cron_pattern": "* * * * *", - "channel_ids": [ - 20001 - ] + "status": "success", + "data": { + "resultType": "vector", + "result": [] + } } } } @@ -13365,29 +12574,70 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleIDRequest" + "$ref": "#/components/schemas/PreviewSyncRequest" }, "example": { - "id": 50001 + "ds_type": "prometheus", + "ds_name": "Prometheus Prod", + "expr": "rate(http_requests_total[5m])", + "delay_seconds": 0 } } } } } }, - "/monit/rule/create": { + "/monit/query/diagnose": { "post": { - "operationId": "monit-rule-write-create", - "summary": "Create alert rule", - "description": "Create a new alert rule. Returns the created rule with its assigned ID.", + "operationId": "monit-read-query-diagnose", + "summary": "Diagnose data source", + "description": "Run a synchronous diagnostic query (`log_patterns` for Loki/VictoriaLogs, `metric_trends` for Prometheus). Used by Flashduty AI SRE for log-pattern clustering and time-series trend analysis. Long-running — up to 35 s.", "tags": [ - "Monitors/Alert rules" + "Monitors/Diagnostics" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- `name`, `ds_type`, `cron_pattern`, and `rule_configs.queries` are required.\n- Either `ds_list` (supports wildcards) or `ds_ids` must be non-empty.\n- `cron_pattern` uses standard 5-field cron syntax.\n- `channel_ids` can be empty; alerts will then route through the global integration.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **600 requests/minute**; **10 requests/second** per account |\n| Permissions | Any valid `app_key` (read-only; not gated by a specific permission class) |\n\n## Usage\n\n- This is a diagnostic / RCA endpoint, not a raw data query — pair it with `/monit/query/rows` when you need detailed rows.\n- `operation` defaults from `ds_type`: `loki` / `victorialogs` → `log_patterns`, `prometheus` → `metric_trends`. Other sources must pass `operation` explicitly.\n- `methods` selects the analyses to run; when omitted, `log_patterns` defaults to `pattern_snapshot + pattern_compare(previous_window)` and `metric_trends` defaults to `single_window_shape + window_compare(previous_window)`.\n- `time_range` is in Unix seconds; missing or invalid values default to the last 15 minutes; a window wider than 6 hours is rejected.\n- The request is forwarded over WebSocket to `monit-edge`. Long-running: the request may take up to ~30 s on the edge side plus webapi overhead. Set client timeouts to **at least 35 s**.\n- `options.*` are upper-bounded by edge (`max_logs_scanned` ≤ 50 000, `max_patterns` ≤ 50, `examples_per_pattern` ≤ 3, `step_seconds` ∈ [15, 300], `max_series` ≤ 200, `topk` ≤ 50, `timeout_seconds` ≤ 30).\n- Two error layers as with `/monit/query/rows`: edge-level execution errors come back as HTTP 200 with an `error` object in the body — check both layers.\n- Log examples are basic-redacted before being returned; expect `warnings: [\"examples redacted\"]`. Do not treat them as raw logs.", + "href": "/en/api-reference/monitors/diagnostics/monit-read-query-diagnose", "metadata": { - "sidebarTitle": "Create alert rule" + "sidebarTitle": "Diagnose data source" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DiagnoseRequest" + }, + "example": { + "account_id": 10001, + "ds_type": "victorialogs", + "ds_name": "vmlogs-read", + "operation": "log_patterns", + "time_range": { + "start": 1776847544, + "end": 1776849344 + }, + "methods": [ + { + "name": "pattern_snapshot" + }, + { + "name": "pattern_compare", + "baseline": "same_window_yesterday" + } + ], + "input": { + "query": "_stream:{status='500'}" + }, + "options": { + "max_logs_scanned": 10000, + "max_patterns": 20, + "examples_per_pattern": 2, + "timeout_seconds": 25 + } + } + } } }, "responses": { @@ -13404,7 +12654,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertRule" + "$ref": "#/components/schemas/DiagnoseResponse" } } } @@ -13413,85 +12663,111 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "id": 50001, - "folder_id": 100, - "name": "CPU High", - "ds_type": "prometheus", - "created_at": 1712000000 - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertRule" - }, - "example": { - "folder_id": 100, - "name": "CPU High", - "ds_type": "prometheus", - "ds_list": [ - "prometheus*" - ], - "enabled": true, - "cron_pattern": "* * * * *", - "channel_ids": [ - 20001 - ], - "rule_configs": { - "queries": [ - { - "name": "A", - "expr": "avg(cpu_usage_idle) < 10" - } - ], - "check_threshold": { - "enabled": true, - "critical": "A", - "alerting_check_times": 1, - "recovery_check_times": 1, - "push_recovery_event": true, - "recovery": { - "mode": "invert" - } + "operation": "log_patterns", + "ds_type": "victorialogs", + "ds_name": "vmlogs-read", + "query": "_stream:{status='500'}", + "window": { + "start": 1776847544, + "end": 1776849344 + }, + "results": [ + { + "method": "pattern_snapshot", + "window": { + "start": 1776847544, + "end": 1776849344 + }, + "summary": { + "logs_scanned": 405, + "baseline_logs_scanned": 0, + "current_truncated": false, + "baseline_truncated": false, + "patterns_total": 2, + "returned_patterns": 2, + "new_patterns": 0, + "surging_patterns": 0, + "surging_threshold": { + "change_ratio_min": 3, + "count_min": 5 + } + }, + "patterns": [ + { + "pattern_hash": "239fa5da", + "template": "POST /api/v/orders/ HTTP/", + "count": 213, + "first_seen": 1776847562, + "last_seen": 1776849336, + "severity": "unknown", + "approximate": false, + "sources": [ + { + "field": "pod", + "value": "order-api-7f69d8d9b6-m4x9n", + "count": 130 + } + ], + "examples": [ + "POST /api/v/orders/ HTTP/" + ] + } + ], + "warnings": [ + "examples redacted" + ] + } + ] } } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" } } } }, - "/monit/rule/update": { + "/monit/query/rows": { "post": { - "operationId": "monit-rule-write-update", - "summary": "Update alert rule", - "description": "Replace the full configuration of an existing alert rule. All fields are overwritten.", + "operationId": "monit-read-query-rows", + "summary": "Query data source rows", + "description": "Run a synchronous ad-hoc query against a configured data source and get back its raw rows. Used by Flashduty AI SRE and by UI preview. The request is forwarded over WebSocket to monit-edge, which executes the query against the underlying source (Prometheus / Loki / VictoriaLogs / SLS / MySQL / Postgres / Oracle / ClickHouse / Elasticsearch).", "tags": [ - "Monitors/Alert rules" + "Monitors/Diagnostics" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- `id` is required. All other fields follow the same rules as `POST /monit/rule/create`.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **600 requests/minute**; **10 requests/second** per account |\n| Permissions | Any valid `app_key` (read-only; not gated by a specific permission class) |\n\n## Usage\n\n- The request is forwarded to `monit-edge` over WebSocket; the data source named by `ds_type` + `ds_name` must already exist under the calling account.\n- `account_id` in the body is optional. When supplied it must equal the authenticated account; mismatched values are rejected.\n- Two error layers: webapi-level failures use the standard error envelope, but errors raised by `monit-edge` while executing the query are returned as HTTP 200 with an `error` object in the body. Always check the response body for `error` in addition to the HTTP status.\n- monit-edge enforces a row cap; large result sets come back as `error.message = \"too many rows\"`. Narrow the time range or aggregate at the source.\n- `args` is a polymorphic `string→string` map that is forwarded verbatim. Semantics depend on `ds_type` (SLS requires `sls.project` + `sls.logstore`; Loki / VictoriaLogs raw mode requires a time range via `*.start`/`*.end` or `*.timespan.value`/`*.timespan.unit`; Prometheus and SQL sources ignore it). See the monit-webapi query-api docs for the per-source key list.", + "href": "/en/api-reference/monitors/diagnostics/monit-read-query-rows", "metadata": { - "sidebarTitle": "Update alert rule" + "sidebarTitle": "Query data source rows" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryRowsRequest" + }, + "example": { + "account_id": 10001, + "ds_type": "prometheus", + "ds_name": "prod-prom", + "expr": "up", + "delay_seconds": 30 + } + } } }, "responses": { @@ -13508,7 +12784,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertRule" + "$ref": "#/components/schemas/QueryRowsResponse" } } } @@ -13516,10 +12792,18 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "id": 50001, - "updated_at": 1712100000 - } + "data": [ + { + "fields": { + "__name__": "up", + "instance": "10.0.0.1:9100", + "job": "node" + }, + "values": { + "__value__": 1 + } + } + ] } } } @@ -13536,51 +12820,22 @@ "500": { "$ref": "#/components/responses/ServerError" } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertRule" - }, - "example": { - "id": 50001, - "folder_id": 100, - "name": "CPU High v2", - "ds_type": "prometheus", - "ds_list": [ - "prometheus*" - ], - "enabled": true, - "cron_pattern": "* * * * *", - "rule_configs": { - "queries": [ - { - "name": "A", - "expr": "avg(cpu_usage_idle) < 5" - } - ] - } - } - } - } } } }, - "/monit/rule/delete": { + "/monit/rule/audit/detail": { "post": { - "operationId": "monit-rule-write-delete", - "summary": "Delete alert rule", - "description": "Delete a single alert rule by its ID.", + "operationId": "monit-rule-read-audit-detail", + "summary": "Get rule audit snapshot", + "description": "Return the audit record (including the `content` field, a JSON string of the rule snapshot at that point in time).", "tags": [ "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |\n\n## Usage\n\n- Pass the audit record `id` (not the rule `id`) from `POST /monit/rule/audits`.\n- `content` is a JSON string — parse it to get the full rule snapshot.", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-audit-detail", "metadata": { - "sidebarTitle": "Delete alert rule" + "sidebarTitle": "Get rule audit snapshot" } }, "responses": { @@ -13597,7 +12852,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleEmptyResponse" + "$ref": "#/components/schemas/AlertRuleAudit" } } } @@ -13605,7 +12860,16 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "id": 9001, + "account_id": 10023, + "alert_rule_id": 50001, + "action": "update", + "content": "{\"id\":50001,\"name\":\"CPU High\"}", + "creator_id": 80011, + "creator_name": "Alice", + "created_at": 1712000000 + } } } } @@ -13628,29 +12892,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleIDRequest" + "$ref": "#/components/schemas/AuditRecordIDRequest" }, "example": { - "id": 50001 + "id": 9001 } } } } } }, - "/monit/rule/delete/batch": { + "/monit/rule/audits": { "post": { - "operationId": "monit-rule-write-delete-batch", - "summary": "Batch delete alert rules", - "description": "Delete multiple alert rules in a single request.", + "operationId": "monit-rule-read-audits", + "summary": "List rule change history", + "description": "Return the change history (audit records) for an alert rule.", "tags": [ "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **30 requests/minute**; **5 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-delete-batch", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-audits", "metadata": { - "sidebarTitle": "Batch delete alert rules" + "sidebarTitle": "List rule change history" } }, "responses": { @@ -13667,7 +12931,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleEmptyResponse" + "$ref": "#/components/schemas/RuleAuditListResponse" } } } @@ -13675,7 +12939,17 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": [ + { + "id": 9001, + "account_id": 10023, + "alert_rule_id": 50001, + "action": "update", + "creator_id": 80011, + "creator_name": "Alice", + "created_at": 1712000000 + } + ] } } } @@ -13698,32 +12972,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleIDsRequest" + "$ref": "#/components/schemas/RuleIDRequest" }, "example": { - "ids": [ - 50001, - 50002 - ] + "id": 50001 } } } } } }, - "/monit/rule/update/fields": { + "/monit/rule/counter/channel": { "post": { - "operationId": "monit-rule-write-fields-update", - "summary": "Batch update rule fields", - "description": "Update specific fields across multiple alert rules at once. Only the fields listed in `fields` are applied.", + "operationId": "monit-rule-read-counter-channel", + "summary": "Get rule counts by channel", + "description": "Return an object mapping channel name to the number of rules routing alerts to that channel. If a channel name cannot be resolved, the channel ID (as a string) is used as the key.", "tags": [ "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- Include the field names you want to update in the `fields` array, e.g. `[\"enabled\", \"channel_ids\"]`.\n- Only the specified fields are updated; others are left unchanged.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-fields-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-counter-channel", "metadata": { - "sidebarTitle": "Batch update rule fields" + "sidebarTitle": "Get rule counts by channel" } }, "responses": { @@ -13740,7 +13011,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleNameMessageListResponse" + "$ref": "#/components/schemas/RuleCounterChannelResponse" } } } @@ -13748,16 +13019,9 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - { - "name": "CPU High", - "message": "" - }, - { - "name": "Disk High", - "message": "" - } - ] + "data": { + "Production": 8 + } } } } @@ -13780,36 +13044,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleFieldsUpdateRequest" + "$ref": "#/components/schemas/RuleEmptyRequest" }, - "example": { - "ids": [ - 50001, - 50002 - ], - "fields": [ - "enabled" - ], - "enabled": false - } + "example": {} } } } } }, - "/monit/rule/import": { + "/monit/rule/counter/node": { "post": { - "operationId": "monit-rule-write-import", - "summary": "Import alert rules", - "description": "Import one or more alert rules from a JSON array. Returns the result for each rule, indicating success or failure.", + "operationId": "monit-rule-read-counter-node", + "summary": "Get rule counts by folder node", + "description": "Return an object mapping top-level folder name to the total number of rules under that folder and all its descendants.", "tags": [ "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **20 requests/minute**; **2 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- The request body is a JSON array of rule export objects (compatible with the output of `POST /monit/rule/export`).\n- Each object must include `folder_id`, `ds_type`, and either `ds_list` or `ds_ids`.\n- Some rules may fail (e.g. duplicate name). Check each result for individual status.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-import", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-counter-node", "metadata": { - "sidebarTitle": "Import alert rules" + "sidebarTitle": "Get rule counts by folder node" } }, "responses": { @@ -13826,7 +13081,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleImportResponse" + "$ref": "#/components/schemas/RuleCounterNodeResponse" } } } @@ -13834,12 +13089,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - { - "name": "CPU High", - "message": "" - } - ] + "data": { + "Production": 10, + "Staging": 3 + } } } } @@ -13862,46 +13115,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleImportRequest" + "$ref": "#/components/schemas/RuleEmptyRequest" }, - "example": [ - { - "folder_id": 100, - "name": "CPU High", - "ds_type": "prometheus", - "ds_list": [ - "prometheus*" - ], - "enabled": true, - "cron_pattern": "* * * * *", - "rule_configs": { - "queries": [ - { - "name": "A", - "expr": "avg(cpu_usage_idle) < 10" - } - ] - } - } - ] + "example": {} } } } } }, - "/monit/rule/export": { + "/monit/rule/counter/status": { "post": { - "operationId": "monit-rule-read-export", - "summary": "Export alert rules", - "description": "Export the configuration of selected alert rules as a portable JSON array, compatible with `POST /monit/rule/import`.", + "operationId": "monit-rule-read-counter-status", + "summary": "Get rule status counters for top-level folders", + "description": "Return trigger status summary for all top-level folder nodes — used for the overview dashboard.", "tags": [ "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **10 requests/minute**; **1 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-export", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-counter-status", "metadata": { - "sidebarTitle": "Export alert rules" + "sidebarTitle": "Get rule status counters for top-level folders" } }, "responses": { @@ -13918,7 +13152,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertRuleExportListResponse" + "$ref": "#/components/schemas/RuleStatusResponse" } } } @@ -13928,13 +13162,10 @@ "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": [ { - "name": "CPU High", - "ds_type": "prometheus", - "ds_list": [ - "prometheus*" - ], - "enabled": true, - "cron_pattern": "* * * * *" + "folder_id": 100, + "folder_name": "Production", + "rule_total": 10, + "triggered_rule_count": 2 } ] } @@ -13959,31 +13190,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleIDsRequest" + "$ref": "#/components/schemas/RuleEmptyRequest" }, - "example": { - "ids": [ - 50001 - ] - } + "example": {} } } } } }, - "/monit/rule/move": { + "/monit/rule/counter/total": { "post": { - "operationId": "monit-rule-write-move", - "summary": "Move alert rules to folder", - "description": "Move one or more alert rules to a different folder.", + "operationId": "monit-rule-read-counter-total", + "summary": "Get rule counter time series", + "description": "Return the stored time series of the total rule count across the account — one sample per `clock` timestamp.", "tags": [ "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-move", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |\n\n## Usage\n\n- Each item is a historical snapshot: `num` is the total rule count at the given `clock` (Unix epoch seconds).", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-counter-total", "metadata": { - "sidebarTitle": "Move alert rules to folder" + "sidebarTitle": "Get rule counter time series" } }, "responses": { @@ -14000,7 +13227,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleNameMessageListResponse" + "$ref": "#/components/schemas/RuleCounterTotalResponse" } } } @@ -14010,8 +13237,10 @@ "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": [ { - "name": "CPU High", - "message": "" + "id": 1, + "account_id": 10023, + "num": 50, + "clock": 1712000000 } ] } @@ -14036,33 +13265,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleMoveRequest" + "$ref": "#/components/schemas/RuleEmptyRequest" }, - "example": { - "ids": [ - 50001, - 50002 - ], - "dest_folder_id": 200 - } + "example": {} } } } } }, - "/monit/rule/status": { + "/monit/rule/create": { "post": { - "operationId": "monit-rule-write-status", - "summary": "Get rule trigger status under folder", - "description": "Return the rule trigger summary for all rules under a folder node and its descendants.", + "operationId": "monit-rule-write-create", + "summary": "Create alert rule", + "description": "Create a new alert rule. Returns the created rule with its assigned ID.", "tags": [ "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- Set `folder_id` to `0` to get summary across all folders.\n- If the folder contains too many rules, computation is skipped for self-protection.", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-status", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- `name`, `ds_type`, `cron_pattern`, and `rule_configs.queries` are required.\n- Either `ds_list` (supports wildcards) or `ds_ids` must be non-empty.\n- `cron_pattern` uses standard 5-field cron syntax.\n- `channel_ids` can be empty; alerts will then route through the global integration.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-create", "metadata": { - "sidebarTitle": "Get rule trigger status under folder" + "sidebarTitle": "Create alert rule" } }, "responses": { @@ -14079,7 +13302,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleStatusResponse" + "$ref": "#/components/schemas/AlertRule" } } } @@ -14087,14 +13310,13 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - { - "folder_id": 100, - "folder_name": "Production", - "rule_total": 10, - "triggered_rule_count": 2 - } - ] + "data": { + "id": 50001, + "folder_id": 100, + "name": "CPU High", + "ds_type": "prometheus", + "created_at": 1712000000 + } } } } @@ -14117,29 +13339,57 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleFolderIDRequest" + "$ref": "#/components/schemas/AlertRule" }, "example": { - "folder_id": 100 + "folder_id": 100, + "name": "CPU High", + "ds_type": "prometheus", + "ds_list": [ + "prometheus*" + ], + "enabled": true, + "cron_pattern": "* * * * *", + "channel_ids": [ + 20001 + ], + "rule_configs": { + "queries": [ + { + "name": "A", + "expr": "avg(cpu_usage_idle) < 10" + } + ], + "check_threshold": { + "enabled": true, + "critical": "A", + "alerting_check_times": 1, + "recovery_check_times": 1, + "push_recovery_event": true, + "recovery": { + "mode": "invert" + } + } + } } } } } } }, - "/monit/rule/audits": { + "/monit/rule/delete": { "post": { - "operationId": "monit-rule-read-audits", - "summary": "List rule change history", - "description": "Return the change history (audit records) for an alert rule.", + "operationId": "monit-rule-write-delete", + "summary": "Delete alert rule", + "description": "Delete a single alert rule by its ID.", "tags": [ "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-audits", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-delete", "metadata": { - "sidebarTitle": "List rule change history" + "sidebarTitle": "Delete alert rule" } }, "responses": { @@ -14156,7 +13406,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleAuditListResponse" + "$ref": "#/components/schemas/RuleEmptyResponse" } } } @@ -14164,17 +13414,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - { - "id": 9001, - "account_id": 10023, - "alert_rule_id": 50001, - "action": "update", - "creator_id": 80011, - "creator_name": "Alice", - "created_at": 1712000000 - } - ] + "data": {} } } } @@ -14207,19 +13447,19 @@ } } }, - "/monit/rule/audit/detail": { + "/monit/rule/delete/batch": { "post": { - "operationId": "monit-rule-read-audit-detail", - "summary": "Get rule audit snapshot", - "description": "Return the audit record (including the `content` field, a JSON string of the rule snapshot at that point in time).", + "operationId": "monit-rule-write-delete-batch", + "summary": "Batch delete alert rules", + "description": "Delete multiple alert rules in a single request.", "tags": [ "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |\n\n## Usage\n\n- Pass the audit record `id` (not the rule `id`) from `POST /monit/rule/audits`.\n- `content` is a JSON string — parse it to get the full rule snapshot.", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-audit-detail", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **30 requests/minute**; **5 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-delete-batch", "metadata": { - "sidebarTitle": "Get rule audit snapshot" + "sidebarTitle": "Batch delete alert rules" } }, "responses": { @@ -14236,7 +13476,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertRuleAudit" + "$ref": "#/components/schemas/RuleEmptyResponse" } } } @@ -14244,16 +13484,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "id": 9001, - "account_id": 10023, - "alert_rule_id": 50001, - "action": "update", - "content": "{\"id\":50001,\"name\":\"CPU High\"}", - "creator_id": 80011, - "creator_name": "Alice", - "created_at": 1712000000 - } + "data": {} } } } @@ -14276,10 +13507,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AuditRecordIDRequest" + "$ref": "#/components/schemas/RuleIDsRequest" }, "example": { - "id": 9001 + "ids": [ + 50001, + 50002 + ] } } } @@ -14362,19 +13596,19 @@ } } }, - "/monit/rule/counter/total": { + "/monit/rule/export": { "post": { - "operationId": "monit-rule-read-counter-total", - "summary": "Get rule counter time series", - "description": "Return the stored time series of the total rule count across the account — one sample per `clock` timestamp.", + "operationId": "monit-rule-read-export", + "summary": "Export alert rules", + "description": "Export the configuration of selected alert rules as a portable JSON array, compatible with `POST /monit/rule/import`.", "tags": [ "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |\n\n## Usage\n\n- Each item is a historical snapshot: `num` is the total rule count at the given `clock` (Unix epoch seconds).", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-counter-total", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **10 requests/minute**; **1 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-export", "metadata": { - "sidebarTitle": "Get rule counter time series" + "sidebarTitle": "Export alert rules" } }, "responses": { @@ -14391,7 +13625,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleCounterTotalResponse" + "$ref": "#/components/schemas/AlertRuleExportListResponse" } } } @@ -14401,10 +13635,13 @@ "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": [ { - "id": 1, - "account_id": 10023, - "num": 50, - "clock": 1712000000 + "name": "CPU High", + "ds_type": "prometheus", + "ds_list": [ + "prometheus*" + ], + "enabled": true, + "cron_pattern": "* * * * *" } ] } @@ -14429,27 +13666,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleEmptyRequest" + "$ref": "#/components/schemas/RuleIDsRequest" }, - "example": {} + "example": { + "ids": [ + 50001 + ] + } } } } } }, - "/monit/rule/counter/node": { + "/monit/rule/import": { "post": { - "operationId": "monit-rule-read-counter-node", - "summary": "Get rule counts by folder node", - "description": "Return an object mapping top-level folder name to the total number of rules under that folder and all its descendants.", + "operationId": "monit-rule-write-import", + "summary": "Import alert rules", + "description": "Import one or more alert rules from a JSON array. Returns the result for each rule, indicating success or failure.", "tags": [ "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-counter-node", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **20 requests/minute**; **2 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- The request body is a JSON array of rule export objects (compatible with the output of `POST /monit/rule/export`).\n- Each object must include `folder_id`, `ds_type`, and either `ds_list` or `ds_ids`.\n- Some rules may fail (e.g. duplicate name). Check each result for individual status.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-import", "metadata": { - "sidebarTitle": "Get rule counts by folder node" + "sidebarTitle": "Import alert rules" } }, "responses": { @@ -14466,7 +13707,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleCounterNodeResponse" + "$ref": "#/components/schemas/RuleImportResponse" } } } @@ -14474,10 +13715,12 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "Production": 10, - "Staging": 3 - } + "data": [ + { + "name": "CPU High", + "message": "" + } + ] } } } @@ -14500,27 +13743,46 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleEmptyRequest" + "$ref": "#/components/schemas/RuleImportRequest" }, - "example": {} + "example": [ + { + "folder_id": 100, + "name": "CPU High", + "ds_type": "prometheus", + "ds_list": [ + "prometheus*" + ], + "enabled": true, + "cron_pattern": "* * * * *", + "rule_configs": { + "queries": [ + { + "name": "A", + "expr": "avg(cpu_usage_idle) < 10" + } + ] + } + } + ] } } } } }, - "/monit/rule/counter/channel": { + "/monit/rule/info": { "post": { - "operationId": "monit-rule-read-counter-channel", - "summary": "Get rule counts by channel", - "description": "Return an object mapping channel name to the number of rules routing alerts to that channel. If a channel name cannot be resolved, the channel ID (as a string) is used as the key.", + "operationId": "monit-rule-read-info", + "summary": "Get alert rule detail", + "description": "Return the full configuration of an alert rule by its ID, including rule queries, thresholds, and notification settings.", "tags": [ "Monitors/Alert rules" ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-counter-channel", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-info", "metadata": { - "sidebarTitle": "Get rule counts by channel" + "sidebarTitle": "Get alert rule detail" } }, "responses": { @@ -14537,7 +13799,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleCounterChannelResponse" + "$ref": "#/components/schemas/AlertRuleInfoResponse" } } } @@ -14546,7 +13808,18 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "Production": 8 + "id": 50001, + "folder_id": 100, + "name": "CPU High", + "ds_type": "prometheus", + "ds_list": [ + "prometheus*" + ], + "enabled": true, + "cron_pattern": "* * * * *", + "channel_ids": [ + 20001 + ] } } } @@ -14570,27 +13843,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleEmptyRequest" + "$ref": "#/components/schemas/RuleIDRequest" }, - "example": {} + "example": { + "id": 50001 + } } } } } }, - "/monit/rule/counter/status": { + "/monit/rule/list/basic": { "post": { - "operationId": "monit-rule-read-counter-status", - "summary": "Get rule status counters for top-level folders", - "description": "Return trigger status summary for all top-level folder nodes — used for the overview dashboard.", + "operationId": "monit-rule-read-list", + "summary": "List alert rules", + "description": "Return the basic information of all alert rules in a folder. For full rule details, call `POST /monit/rule/info`.", "tags": [ "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |", - "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-counter-status", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Read** (`monit`) |\n\n## Usage\n\n- Set `folder_id` to `0` to list all rules across all folders visible to the current user.\n- The `triggered` field indicates whether the rule has any currently active alerts.", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-read-list", "metadata": { - "sidebarTitle": "Get rule status counters for top-level folders" + "sidebarTitle": "List alert rules" } }, "responses": { @@ -14607,7 +13882,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleStatusResponse" + "$ref": "#/components/schemas/RuleBasicListResponse" } } } @@ -14617,10 +13892,13 @@ "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": [ { + "id": 50001, "folder_id": 100, - "folder_name": "Production", - "rule_total": 10, - "triggered_rule_count": 2 + "name": "CPU High", + "ds_type": "prometheus", + "enabled": true, + "triggered": true, + "created_at": 1710000000 } ] } @@ -14645,27 +13923,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleEmptyRequest" + "$ref": "#/components/schemas/RuleListRequest" }, - "example": {} + "example": { + "folder_id": 100 + } } } } } }, - "/monit/datasource/list": { + "/monit/rule/move": { "post": { - "operationId": "monit-datasource-read-list", - "summary": "List datasources", - "description": "Return all data sources for the current account. Optionally filter by `type_ident`.", + "operationId": "monit-rule-write-move", + "summary": "Move alert rules to folder", + "description": "Move one or more alert rules to a different folder.", "tags": [ - "Monitors/Data sources" + "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Datasources Read** (`monit`) |\n\n## Usage\n\n- Omit `type_ident` to return all types.\n- Sensitive credential fields (passwords, keys) are not returned in the list response.", - "href": "/en/api-reference/monitors/data-sources/monit-datasource-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-move", "metadata": { - "sidebarTitle": "List datasources" + "sidebarTitle": "Move alert rules to folder" } }, "responses": { @@ -14682,7 +13962,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DataSourceListResponse" + "$ref": "#/components/schemas/RuleNameMessageListResponse" } } } @@ -14692,15 +13972,8 @@ "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": [ { - "id": 10, - "account_id": 10023, - "type_ident": "prometheus", - "name": "Prometheus Prod", - "enabled": true, - "note": "Production Prometheus", - "address": "http://prometheus.example.com:9090", - "edge_cluster_name": "default", - "updated_at": 1712000000 + "name": "CPU High", + "message": "" } ] } @@ -14725,29 +13998,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceListRequest" + "$ref": "#/components/schemas/RuleMoveRequest" }, "example": { - "type": "prometheus" + "ids": [ + 50001, + 50002 + ], + "dest_folder_id": 200 } } } } } }, - "/monit/datasource/info": { + "/monit/rule/status": { "post": { - "operationId": "monit-datasource-read-info", - "summary": "Get datasource detail", - "description": "Retrieve full details of a single data source by its ID, including the `payload` configuration.", + "operationId": "monit-rule-write-status", + "summary": "Get rule trigger status under folder", + "description": "Return the rule trigger summary for all rules under a folder node and its descendants.", "tags": [ - "Monitors/Data sources" + "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Datasources Read** (`monit`) |", - "href": "/en/api-reference/monitors/data-sources/monit-datasource-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- Set `folder_id` to `0` to get summary across all folders.\n- If the folder contains too many rules, computation is skipped for self-protection.", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-status", "metadata": { - "sidebarTitle": "Get datasource detail" + "sidebarTitle": "Get rule trigger status under folder" } }, "responses": { @@ -14764,7 +14041,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DataSourceItem" + "$ref": "#/components/schemas/RuleStatusResponse" } } } @@ -14772,25 +14049,14 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "id": 10, - "account_id": 10023, - "type_ident": "prometheus", - "name": "Prometheus Prod", - "enabled": true, - "note": "Production Prometheus", - "address": "http://prometheus.example.com:9090", - "payload": { - "prometheus": { - "basic_auth_enabled": false, - "basic_auth_username": "", - "basic_auth_password": "", - "tls_skip_verify": false - } - }, - "edge_cluster_name": "default", - "updated_at": 1712000000 - } + "data": [ + { + "folder_id": 100, + "folder_name": "Production", + "rule_total": 10, + "triggered_rule_count": 2 + } + ] } } } @@ -14813,29 +14079,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IDRequest" + "$ref": "#/components/schemas/RuleFolderIDRequest" }, "example": { - "id": 10 + "folder_id": 100 } } } } } }, - "/monit/datasource/create": { + "/monit/rule/update": { "post": { - "operationId": "monit-datasource-write-create", - "summary": "Create datasource", - "description": "Create a new monitoring data source. The `payload` must include the type-specific configuration block.", + "operationId": "monit-rule-write-update", + "summary": "Update alert rule", + "description": "Replace the full configuration of an existing alert rule. All fields are overwritten.", "tags": [ - "Monitors/Data sources" + "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Datasources Manage** (`monit`) |\n\n## Usage\n\n- `type_ident` must be one of: `prometheus`, `loki`, `mysql`, `oracle`, `postgres`, `clickhouse`, `elasticsearch`, `sls`, `victorialogs`.\n- `edge_cluster_name` specifies which Monitors edge cluster evaluates rules using this datasource.\n- For `elasticsearch`, set `payload.elasticsearch.deployment` to `cloud` or `self-managed`.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/monitors/data-sources/monit-datasource-write-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- `id` is required. All other fields follow the same rules as `POST /monit/rule/create`.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-update", "metadata": { - "sidebarTitle": "Create datasource" + "sidebarTitle": "Update alert rule" } }, "responses": { @@ -14852,7 +14118,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DataSourceItem" + "$ref": "#/components/schemas/AlertRule" } } } @@ -14861,12 +14127,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "id": 10, - "type_ident": "prometheus", - "name": "Prometheus Prod", - "enabled": true, - "edge_cluster_name": "default", - "updated_at": 1712000000 + "id": 50001, + "updated_at": 1712100000 } } } @@ -14890,18 +14152,25 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceUpsertRequest" + "$ref": "#/components/schemas/AlertRule" }, "example": { - "type_ident": "prometheus", - "name": "Prometheus Prod", - "note": "Production Prometheus", - "address": "http://prometheus.example.com:9090", - "edge_cluster_name": "default", - "payload": { - "prometheus": { - "basic_auth_enabled": false - } + "id": 50001, + "folder_id": 100, + "name": "CPU High v2", + "ds_type": "prometheus", + "ds_list": [ + "prometheus*" + ], + "enabled": true, + "cron_pattern": "* * * * *", + "rule_configs": { + "queries": [ + { + "name": "A", + "expr": "avg(cpu_usage_idle) < 5" + } + ] } } } @@ -14909,19 +14178,19 @@ } } }, - "/monit/datasource/update": { + "/monit/rule/update/fields": { "post": { - "operationId": "monit-datasource-write-update", - "summary": "Update datasource", - "description": "Update an existing data source. Supply `id` plus the fields to change.", + "operationId": "monit-rule-write-fields-update", + "summary": "Batch update rule fields", + "description": "Update specific fields across multiple alert rules at once. Only the fields listed in `fields` are applied.", "tags": [ - "Monitors/Data sources" + "Monitors/Alert rules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Datasources Manage** (`monit`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/monitors/data-sources/monit-datasource-write-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Alerting Rules Manage** (`monit`) |\n\n## Usage\n\n- Include the field names you want to update in the `fields` array, e.g. `[\"enabled\", \"channel_ids\"]`.\n- Only the specified fields are updated; others are left unchanged.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/monitors/alert-rules/monit-rule-write-fields-update", "metadata": { - "sidebarTitle": "Update datasource" + "sidebarTitle": "Batch update rule fields" } }, "responses": { @@ -14938,7 +14207,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DataSourceItem" + "$ref": "#/components/schemas/RuleNameMessageListResponse" } } } @@ -14946,14 +14215,16 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "id": 10, - "type_ident": "prometheus", - "name": "Prometheus Prod v2", - "enabled": true, - "edge_cluster_name": "default", - "updated_at": 1712100000 - } + "data": [ + { + "name": "CPU High", + "message": "" + }, + { + "name": "Disk High", + "message": "" + } + ] } } } @@ -14976,39 +14247,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceUpsertRequest" + "$ref": "#/components/schemas/RuleFieldsUpdateRequest" }, "example": { - "id": 10, - "type_ident": "prometheus", - "name": "Prometheus Prod v2", - "note": "Updated", - "address": "http://prometheus-v2.example.com:9090", - "edge_cluster_name": "default", - "payload": { - "prometheus": { - "basic_auth_enabled": false - } - } + "ids": [ + 50001, + 50002 + ], + "fields": [ + "enabled" + ], + "enabled": false } } } } } }, - "/monit/datasource/delete": { + "/monit/store/ruleset/create": { "post": { - "operationId": "monit-datasource-write-delete", - "summary": "Delete datasource", - "description": "Delete a data source by ID. Alert rules referencing this datasource must be updated or deleted first.", + "operationId": "monit-store-ruleset-create", + "summary": "Create ruleset", + "description": "Create a new ruleset in the rule repository.", "tags": [ - "Monitors/Data sources" + "Monitors/Rule sets" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Datasources Manage** (`monit`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/monitors/data-sources/monit-datasource-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Rule Repository Manage** (`monit`) |\n\n## Usage\n\n- `open_flag`: `0` = private (creator only), `1` = account-shared, `2` = public.\n- `payload` is a required JSON string containing the alert rule definitions.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/monitors/rule-sets/monit-store-ruleset-create", "metadata": { - "sidebarTitle": "Delete datasource" + "sidebarTitle": "Create ruleset" } }, "responses": { @@ -15025,7 +14293,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/StoreRulesetItem" } } } @@ -15033,7 +14301,14 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "id": 1, + "type_ident": "prometheus", + "note": "CPU usage alerts", + "open_flag": 1, + "created_at": 1712000000, + "updated_at": 1712000000 + } } } } @@ -15056,29 +14331,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IDRequest" + "$ref": "#/components/schemas/StoreRulesetUpsertRequest" }, "example": { - "id": 10 + "type_ident": "prometheus", + "note": "CPU usage alerts", + "open_flag": 1, + "payload": "[{\"prom_ql\":\"rate(cpu_usage[5m]) > 0.8\"}]" } } } } } }, - "/monit/datasource/sls/projects": { + "/monit/store/ruleset/delete": { "post": { - "operationId": "monit-datasource-read-sls-projects", - "summary": "List SLS projects", - "description": "List Alibaba Cloud SLS (Simple Log Service) projects available in the specified SLS datasource.", + "operationId": "monit-store-ruleset-delete", + "summary": "Delete ruleset", + "description": "Delete a ruleset from the rule repository by ID.", "tags": [ - "Monitors/Data sources" + "Monitors/Rule sets" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Datasources Read** (`monit`) |\n\n## Usage\n\n- The datasource identified by `id` must be of type `sls`.\n- Use `query` to filter projects by name prefix. Use `offset` and `size` for pagination.", - "href": "/en/api-reference/monitors/data-sources/monit-datasource-read-sls-projects", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Rule Repository Manage** (`monit`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/monitors/rule-sets/monit-store-ruleset-delete", "metadata": { - "sidebarTitle": "List SLS projects" + "sidebarTitle": "Delete ruleset" } }, "responses": { @@ -15095,7 +14373,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SLSProjectsResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -15103,10 +14381,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - "project-a", - "project-b" - ] + "data": {} } } } @@ -15129,32 +14404,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SLSProjectsRequest" + "$ref": "#/components/schemas/IDRequest" }, "example": { - "id": 10, - "query": "", - "offset": 0, - "size": 50 + "id": 1 } } } } } }, - "/monit/datasource/sls/logstores": { + "/monit/store/ruleset/info": { "post": { - "operationId": "monit-datasource-read-sls-logstores", - "summary": "List SLS logstores", - "description": "List logstores within an SLS project for the specified SLS datasource.", + "operationId": "monit-store-ruleset-info", + "summary": "Get ruleset detail", + "description": "Retrieve the full details of a ruleset including its `payload` (the alert rule definitions as a JSON string).", "tags": [ - "Monitors/Data sources" + "Monitors/Rule sets" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Datasources Read** (`monit`) |\n\n## Usage\n\n- The datasource identified by `id` must be of type `sls`.\n- Supply `project` to select the SLS project whose logstores to list.", - "href": "/en/api-reference/monitors/data-sources/monit-datasource-read-sls-logstores", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Rule Repository Read** (`monit`) |", + "href": "/en/api-reference/monitors/rule-sets/monit-store-ruleset-info", "metadata": { - "sidebarTitle": "List SLS logstores" + "sidebarTitle": "Get ruleset detail" } }, "responses": { @@ -15171,7 +14443,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SLSLogstoresResponse" + "$ref": "#/components/schemas/StoreRulesetItem" } } } @@ -15179,10 +14451,18 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - "logstore-1", - "logstore-2" - ] + "data": { + "id": 1, + "type_ident": "prometheus", + "note": "CPU usage alerts", + "open_flag": 2, + "payload": "[{\"prom_ql\":\"...\"}]", + "creator_account_id": 10023, + "creator_id": 80011, + "creator_name": "Alice", + "created_at": 1710000000, + "updated_at": 1712000000 + } } } } @@ -15205,13 +14485,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SLSLogstoresRequest" + "$ref": "#/components/schemas/IDRequest" }, "example": { - "id": 10, - "project": "project-a", - "offset": 0, - "size": 50 + "id": 1 } } } @@ -15300,19 +14577,19 @@ } } }, - "/monit/store/ruleset/info": { + "/monit/store/ruleset/update": { "post": { - "operationId": "monit-store-ruleset-info", - "summary": "Get ruleset detail", - "description": "Retrieve the full details of a ruleset including its `payload` (the alert rule definitions as a JSON string).", + "operationId": "monit-store-ruleset-update", + "summary": "Update ruleset", + "description": "Update the note, sharing flag, and payload of an existing ruleset.", "tags": [ "Monitors/Rule sets" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Rule Repository Read** (`monit`) |", - "href": "/en/api-reference/monitors/rule-sets/monit-store-ruleset-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Rule Repository Manage** (`monit`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/monitors/rule-sets/monit-store-ruleset-update", "metadata": { - "sidebarTitle": "Get ruleset detail" + "sidebarTitle": "Update ruleset" } }, "responses": { @@ -15339,15 +14616,9 @@ "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { "id": 1, - "type_ident": "prometheus", - "note": "CPU usage alerts", + "note": "Updated CPU alerts", "open_flag": 2, - "payload": "[{\"prom_ql\":\"...\"}]", - "creator_account_id": 10023, - "creator_id": 80011, - "creator_name": "Alice", - "created_at": 1710000000, - "updated_at": 1712000000 + "updated_at": 1712100000 } } } @@ -15371,29 +14642,46 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IDRequest" + "$ref": "#/components/schemas/StoreRulesetUpdateRequest" }, "example": { - "id": 1 + "id": 1, + "note": "Updated CPU alerts", + "open_flag": 2, + "payload": "[{\"prom_ql\":\"rate(cpu_usage[5m]) > 0.9\"}]" } } } } } }, - "/monit/store/ruleset/create": { + "/monit/targets": { "post": { - "operationId": "monit-store-ruleset-create", - "summary": "Create ruleset", - "description": "Create a new ruleset in the rule repository.", + "operationId": "monit-read-targets-list", + "summary": "List monitored targets", + "description": "List the targets observed under the current tenant by the monit-agent route projection. Supports `target_locator` prefix search and cursor pagination. Use this to drive `target_locator` selection for `/monit/tools/catalog` and `/monit/tools/invoke`.", "tags": [ - "Monitors/Rule sets" + "Monitors/Diagnostics" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Rule Repository Manage** (`monit`) |\n\n## Usage\n\n- `open_flag`: `0` = private (creator only), `1` = account-shared, `2` = public.\n- `payload` is a required JSON string containing the alert rule definitions.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/monitors/rule-sets/monit-store-ruleset-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **600 requests/minute**; **10 requests/second** per account |\n| Permissions | Any valid `app_key` (read-only; not gated by a specific permission class) |\n\n## Usage\n\n- This is a **UI projection view**, not the live source-of-truth used by `/monit/tools/invoke`. A row in the list is no guarantee the target is currently invokable.\n- `keyword` is a **prefix** match against `target_locator` (ASCII-only, no whitespace, no `|`, max 256 bytes). Substring search is not supported in v1.\n- `limit` defaults to 50, max 200. Pagination is cursor-based: pass the previous response's `next_cursor` to fetch the next page; an empty / missing `next_cursor` means the last page.\n- Resetting `keyword`, `limit`, or the tenant context requires resetting `cursor`; never mix a cursor across different filter sets.\n- `total` is the unfiltered-by-cursor match count for the current `(account_id, keyword)` pair and stays stable across pages.\n- Fields surface `cluster_name` / `edge_ipport` for diagnostics; treat `updated_at` as \"most recently observed\" rather than a live online indicator.", + "href": "/en/api-reference/monitors/diagnostics/monit-read-targets-list", "metadata": { - "sidebarTitle": "Create ruleset" + "sidebarTitle": "List monitored targets" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TargetsListRequest" + }, + "example": { + "keyword": "db-prod", + "limit": 50 + } + } } }, "responses": { @@ -15410,7 +14698,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StoreRulesetItem" + "$ref": "#/components/schemas/TargetsListResponse" } } } @@ -15419,12 +14707,18 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "id": 1, - "type_ident": "prometheus", - "note": "CPU usage alerts", - "open_flag": 1, - "created_at": 1712000000, - "updated_at": 1712000000 + "items": [ + { + "target_kind": "host", + "target_locator": "db-prod-01", + "agent_version": "2.0.0", + "cluster_name": "edge-a", + "edge_ipport": "10.0.0.1:19090", + "updated_at": 1710000000 + } + ], + "total": 120, + "next_cursor": "eyJ0YXJnZXRfbG9jYXRvciI6ImRiLXByb2QtMDEiLCJpZCI6MTIzNDV9" } } } @@ -15442,39 +14736,38 @@ "500": { "$ref": "#/components/responses/ServerError" } + } + } + }, + "/monit/tools/catalog": { + "post": { + "operationId": "monit-read-tools-catalog", + "summary": "List target tool catalog", + "description": "Look up the tools that the per-target monit-agent currently exposes for a given `target_locator` (host, mysql, …). Returns each tool's name, description, and JSON-Schema `input_schema`. Pair with `/monit/tools/invoke` to drive AI-SRE tool calls.", + "tags": [ + "Monitors/Diagnostics" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **600 requests/minute**; **10 requests/second** per account |\n| Permissions | Any valid `app_key` (read-only; not gated by a specific permission class) |\n\n## Usage\n\n- Use `target_locator` to identify the target; `target_kind` is optional and is auto-inferred when omitted. Built-in target kinds are `host` and `mysql`.\n- If multiple kinds match the same locator, the response is HTTP 200 with `data.error.code = \"ambiguous_target_kind\"` and a `target_kinds` list — retry with an explicit `target_kind`.\n- The catalog is a *candidate capability* view, not an execution guarantee. The target Agent may go offline between catalog and invoke, or local Agent policy may block individual tools at invoke time.\n- Set `include_output_shape: true` to additionally receive each tool's `output_shape`. Default is `false` to keep the response small for LLM consumption.\n- Business errors (`target_unavailable`, `unknown_toolset_hash`, `ambiguous_target_kind`) come back as HTTP 200 with a non-null `data.error`. Only protocol / auth / internal errors use the standard error envelope.", + "href": "/en/api-reference/monitors/diagnostics/monit-read-tools-catalog", + "metadata": { + "sidebarTitle": "List target tool catalog" + } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StoreRulesetUpsertRequest" + "$ref": "#/components/schemas/ToolCatalogRequest" }, "example": { - "type_ident": "prometheus", - "note": "CPU usage alerts", - "open_flag": 1, - "payload": "[{\"prom_ql\":\"rate(cpu_usage[5m]) > 0.8\"}]" + "account_id": 10001, + "target_locator": "web-01", + "include_output_shape": true } } } - } - } - }, - "/monit/store/ruleset/update": { - "post": { - "operationId": "monit-store-ruleset-update", - "summary": "Update ruleset", - "description": "Update the note, sharing flag, and payload of an existing ruleset.", - "tags": [ - "Monitors/Rule sets" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Rule Repository Manage** (`monit`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/monitors/rule-sets/monit-store-ruleset-update", - "metadata": { - "sidebarTitle": "Update ruleset" - } }, "responses": { "200": { @@ -15490,7 +14783,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StoreRulesetItem" + "$ref": "#/components/schemas/ToolCatalogResponse" } } } @@ -15499,10 +14792,42 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "id": 1, - "note": "Updated CPU alerts", - "open_flag": 2, - "updated_at": 1712100000 + "target": { + "kind": "host", + "locator": "web-01" + }, + "tools": [ + { + "name": "os.overview", + "target_kind": "host", + "description": "Returns a bounded overview of host health (CPU, memory, disk, network, top processes).", + "input_schema": { + "type": "object", + "additionalProperties": false, + "properties": {} + }, + "output_shape": { + "type": "object", + "required": [ + "data", + "summary", + "truncated" + ], + "properties": { + "data": { + "type": "object" + }, + "summary": { + "type": "string" + }, + "truncated": { + "type": "object" + } + } + } + } + ], + "error": null } } } @@ -15520,39 +14845,50 @@ "500": { "$ref": "#/components/responses/ServerError" } + } + } + }, + "/monit/tools/invoke": { + "post": { + "operationId": "monit-read-tools-invoke", + "summary": "Invoke target tools", + "description": "Invoke up to 8 monit-agent tools concurrently on a single target. Results come back in the order of the input `tools` array. Long-running — individual tools have per-tool timeouts on the agent and the whole request may take tens of seconds.", + "tags": [ + "Monitors/Diagnostics" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **600 requests/minute**; **10 requests/second** per account |\n| Permissions | Any valid `app_key` (read-only; not gated by a specific permission class) |\n\n## Usage\n\n- Up to **8** tools per call (`MaxToolsPerInvoke`); larger batches must be split client-side. The 8-tool cap aligns with the per-target agent concurrency.\n- Tools execute in parallel on the agent; webapi returns `results[]` aligned with the request `tools[]` order.\n- Long-running: set client timeouts to **at least 35 s**. The endpoint is intended for AI-SRE / human-RCA flows, not interactive UI.\n- Request-level errors (`target_unavailable`, `ambiguous_target_kind`, `unknown_toolset_hash`, `forward_failed`) appear as HTTP 200 with `data.error` set and `data.results = []`.\n- Per-tool failures appear as HTTP 200 with `data.error = null` and `results[i].error` populated — always check **all three** layers (outer envelope `error`, `data.error`, then each `results[i].error`).\n- Each result carries two latency fields: `agent_elapsed_ms` (agent-self-reported, excludes network) and `e2e_elapsed_ms` (webapi-observed end-to-end). A large gap between them indicates network / edge slowness rather than slow tool execution.\n- Construct `tools[].params` against the `input_schema` returned by `/monit/tools/catalog`. For no-arg tools always pass `params: {}` explicitly.", + "href": "/en/api-reference/monitors/diagnostics/monit-read-tools-invoke", + "metadata": { + "sidebarTitle": "Invoke target tools" + } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StoreRulesetUpdateRequest" + "$ref": "#/components/schemas/ToolInvokeRequest" }, "example": { - "id": 1, - "note": "Updated CPU alerts", - "open_flag": 2, - "payload": "[{\"prom_ql\":\"rate(cpu_usage[5m]) > 0.9\"}]" + "account_id": 10001, + "target_locator": "web-01", + "tools": [ + { + "tool": "os.overview", + "params": {} + }, + { + "tool": "net.tcp_ping", + "params": { + "host": "10.0.0.10", + "port": 3306 + } + } + ] } } } - } - } - }, - "/monit/store/ruleset/delete": { - "post": { - "operationId": "monit-store-ruleset-delete", - "summary": "Delete ruleset", - "description": "Delete a ruleset from the rule repository by ID.", - "tags": [ - "Monitors/Rule sets" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Rule Repository Manage** (`monit`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/monitors/rule-sets/monit-store-ruleset-delete", - "metadata": { - "sidebarTitle": "Delete ruleset" - } }, "responses": { "200": { @@ -15568,7 +14904,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ToolInvokeResponse" } } } @@ -15576,7 +14912,44 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "target": { + "kind": "host", + "locator": "web-01" + }, + "results": [ + { + "tool": "os.overview", + "tool_version": "0.5.0", + "data": { + "data": { + "sample_interval_sec": 3, + "degraded": false, + "degradation_reasons": [] + }, + "summary": "os.overview ...", + "truncated": { + "truncated": false + } + }, + "error": null, + "agent_elapsed_ms": 3120, + "e2e_elapsed_ms": 3188 + }, + { + "tool": "net.tcp_ping", + "tool_version": "0.5.0", + "data": null, + "error": { + "code": "target_unreachable", + "message": "dial tcp 10.0.0.10:3306: i/o timeout" + }, + "agent_elapsed_ms": 0, + "e2e_elapsed_ms": 2008 + } + ], + "error": null + } } } } @@ -15593,35 +14966,22 @@ "500": { "$ref": "#/components/responses/ServerError" } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IDRequest" - }, - "example": { - "id": 1 - } - } - } } } }, - "/rum/application/list": { + "/person/infos": { "post": { - "operationId": "rum-application-read-list", - "summary": "List applications", - "description": "Return a paginated list of RUM applications accessible to the current user.", + "operationId": "personInfos", + "summary": "Batch get persons", + "description": "Return profile information for a batch of person IDs (members or accounts).", "tags": [ - "RUM/Applications" + "Platform/Members" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Use `is_my_team` to filter applications belonging to the current user's teams.\n- Default page size is 20, maximum is 100.\n- `orderby` accepts `created_at` or `updated_at`.", - "href": "/en/api-reference/rum/applications/rum-application-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/platform/members/person-infos", "metadata": { - "sidebarTitle": "List applications" + "sidebarTitle": "Batch get persons" } }, "responses": { @@ -15638,7 +14998,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationListResponse" + "$ref": "#/components/schemas/PersonInfosResponse" } } } @@ -15647,65 +15007,29 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "has_next_page": true, - "total": 7, "items": [ { "account_id": 2451002751131, - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "flashcat-rum", - "type": "browser", - "client_token": "a3cea433a8685a398cdfd68f54a45e06131", - "team_id": 2477033058131, - "is_private": true, - "no_ip": true, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": false, - "open_type": "", - "endpoint": "" - }, - "status": "enabled", - "created_by": 4441703362131, - "updated_by": 3790925372131, - "created_at": 1746673831462, - "updated_at": 1773398630657 - }, - { - "account_id": 2451002751131, - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "type": "browser", - "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", - "team_id": 2477033058131, - "is_private": false, - "no_ip": false, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 5962711836131, - 5967875767131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": true, - "open_type": "popup", - "endpoint": "https://www.tracing.com/${trace_id}" - }, - "status": "enabled", - "created_by": 2476444212131, - "updated_by": 3122470302131, - "created_at": 1742958482000, - "updated_at": 1772096392711 + "person_id": 2476444212131, + "person_name": "Alice", + "avatar": "/image/avatar1.png", + "locale": "zh-CN", + "time_zone": "Asia/Shanghai", + "email": "alice@example.com", + "phone_verified": false, + "email_verified": true, + "as": "member", + "status": "enabled" + }, + { + "account_id": 2451002751131, + "person_id": 3790925372131, + "person_name": "Bob", + "email": "bob@example.com", + "phone_verified": false, + "email_verified": true, + "as": "member", + "status": "enabled" } ] } @@ -15731,32 +15055,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationListRequest" + "$ref": "#/components/schemas/PersonInfosRequest" }, "example": { - "p": 1, - "limit": 20, - "query": "", - "is_my_team": false + "person_ids": [ + 2476444212131, + 3790925372131 + ] } } } } } }, - "/rum/application/info": { + "/role/delete": { "post": { - "operationId": "rum-application-read-info", - "summary": "Get application detail", - "description": "Retrieve full details of a single RUM application by `application_id`.", + "operationId": "role-write-delete", + "summary": "Delete a role", + "description": "Permanently delete a custom role and revoke it from all members.", "tags": [ - "RUM/Applications" + "Platform/Roles & permissions" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/rum/applications/rum-application-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Roles Manage** (`organization`) |\n\n## Usage\n\n- Built-in roles cannot be deleted.\n- All members who held this role lose its permissions immediately.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/platform/roles-permissions/role-write-delete", "metadata": { - "sidebarTitle": "Get application detail" + "sidebarTitle": "Delete a role" } }, "responses": { @@ -15773,7 +15097,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationItem" + "$ref": "#/components/schemas/PlatformEmptyObject" } } } @@ -15781,34 +15105,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "account_id": 2451002751131, - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "flashcat-rum", - "type": "browser", - "client_token": "a3cea433a8685a398cdfd68f54a45e06131", - "team_id": 2477033058131, - "is_private": true, - "no_ip": true, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": false, - "open_type": "", - "endpoint": "" - }, - "status": "enabled", - "created_by": 4441703362131, - "updated_by": 3790925372131, - "created_at": 1746673831462, - "updated_at": 1773398630657 - } + "data": {} } } } @@ -15819,6 +15116,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -15831,29 +15131,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationIDRequest" + "$ref": "#/components/schemas/RoleIDRequest" }, "example": { - "application_id": "WoyQQ3BohkdtPivubEvE8o" + "role_id": 150 } } } } } }, - "/rum/application/infos": { + "/role/disable": { "post": { - "operationId": "rum-application-read-infos", - "summary": "Batch get applications", - "description": "Retrieve details for multiple RUM applications by their IDs in one request.", + "operationId": "role-write-disable", + "summary": "Disable a role", + "description": "Disable a custom role to prevent it from granting permissions.", "tags": [ - "RUM/Applications" + "Platform/Roles & permissions" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Maximum 200 IDs per request.", - "href": "/en/api-reference/rum/applications/rum-application-read-infos", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Roles Manage** (`organization`) |\n\n## Usage\n\n- Members who held this role lose its permissions immediately.\n- Only custom roles can be disabled.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/platform/roles-permissions/role-write-disable", "metadata": { - "sidebarTitle": "Batch get applications" + "sidebarTitle": "Disable a role" } }, "responses": { @@ -15870,7 +15170,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationInfosResponse" + "$ref": "#/components/schemas/PlatformEmptyObject" } } } @@ -15878,67 +15178,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "account_id": 2451002751131, - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "type": "browser", - "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", - "team_id": 2477033058131, - "is_private": false, - "no_ip": false, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 5962711836131, - 5967875767131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": true, - "open_type": "popup", - "endpoint": "https://www.tracing.com/${trace_id}" - }, - "status": "enabled", - "created_by": 2476444212131, - "updated_by": 3122470302131, - "created_at": 1742958482000, - "updated_at": 1772096392711 - }, - { - "account_id": 2451002751131, - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "flashcat-rum", - "type": "browser", - "client_token": "a3cea433a8685a398cdfd68f54a45e06131", - "team_id": 2477033058131, - "is_private": true, - "no_ip": true, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": false, - "open_type": "", - "endpoint": "" - }, - "status": "enabled", - "created_by": 4441703362131, - "updated_by": 3790925372131, - "created_at": 1746673831462, - "updated_at": 1773398630657 - } - ] - } + "data": {} } } } @@ -15949,6 +15189,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -15961,32 +15204,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationInfosRequest" + "$ref": "#/components/schemas/RoleIDRequest" }, "example": { - "application_ids": [ - "eWbr4xk3ZRnLabRa6unqwD", - "WoyQQ3BohkdtPivubEvE8o" - ] + "role_id": 150 } } } } } }, - "/rum/application/create": { + "/role/enable": { "post": { - "operationId": "rum-application-write-create", - "summary": "Create application", - "description": "Create a new RUM application. Returns the generated `application_id` and `client_token`.", + "operationId": "role-write-enable", + "summary": "Enable a role", + "description": "Re-enable a previously disabled custom role.", "tags": [ - "RUM/Applications" + "Platform/Roles & permissions" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- `type` must be one of: `browser`, `ios`, `android`, `react-native`, `flutter`, `kotlin-multiplatform`, `roku`, `unity`.\n- `client_token` is auto-generated and used to initialize the RUM SDK.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/rum/applications/rum-application-write-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Roles Manage** (`organization`) |\n\n## Usage\n\n- Only custom roles can be enabled/disabled. Built-in roles always remain enabled.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/platform/roles-permissions/role-write-enable", "metadata": { - "sidebarTitle": "Create application" + "sidebarTitle": "Enable a role" } }, "responses": { @@ -16003,7 +15243,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationCreateResponse" + "$ref": "#/components/schemas/PlatformEmptyObject" } } } @@ -16011,11 +15251,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "application_id": "qLpu24Dz4CAzWsESPbJYWA", - "application_name": "My Web App", - "client_token": "e090078724855a4ca168c3884880dfbc131" - } + "data": {} } } } @@ -16026,6 +15262,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -16038,32 +15277,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationCreateRequest" + "$ref": "#/components/schemas/RoleIDRequest" }, "example": { - "application_name": "My Web App", - "type": "browser", - "team_id": 2477033058131, - "is_private": false + "role_id": 150 } } } } } }, - "/rum/application/update": { + "/role/info": { "post": { - "operationId": "rum-application-write-update", - "summary": "Update application", - "description": "Update an existing RUM application. All fields except `application_id` are optional — only provided fields are updated.", + "operationId": "role-read-info", + "summary": "Get role detail", + "description": "Return the detail of a single role by its ID.", "tags": [ - "RUM/Applications" + "Platform/Roles & permissions" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/rum/applications/rum-application-write-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/platform/roles-permissions/role-read-info", "metadata": { - "sidebarTitle": "Update application" + "sidebarTitle": "Get role detail" } }, "responses": { @@ -16080,7 +15316,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/RoleItem" } } } @@ -16088,7 +15324,20 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "role_id": 2, + "role_name": "Account Admin", + "description": "Account admin with all permissions.", + "status": "enabled", + "permission_ids": [ + 101, + 102, + 201 + ], + "editable": false, + "created_at": 1700000000, + "updated_at": 1700000000 + } } } } @@ -16111,36 +15360,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationUpdateRequest" + "$ref": "#/components/schemas/RoleInfoRequest" }, "example": { - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "My Web App v2", - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 - ] - } + "role_id": 2 } } } } } }, - "/rum/application/delete": { + "/role/list": { "post": { - "operationId": "rum-application-write-delete", - "summary": "Delete application", - "description": "Delete a RUM application by `application_id`.", + "operationId": "role-read-list", + "summary": "List roles", + "description": "Return all custom and built-in roles for the current account.", "tags": [ - "RUM/Applications" + "Platform/Roles & permissions" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/rum/applications/rum-application-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Built-in roles (`editable: false`) cannot be modified or deleted.", + "href": "/en/api-reference/platform/roles-permissions/role-read-list", "metadata": { - "sidebarTitle": "Delete application" + "sidebarTitle": "List roles" } }, "responses": { @@ -16157,7 +15399,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/RoleListResponse" } } } @@ -16165,7 +15407,21 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "total": 3, + "items": [ + { + "role_id": 2, + "role_name": "Account Admin", + "description": "", + "status": "enabled", + "permission_ids": [], + "editable": false, + "created_at": 1700000000, + "updated_at": 1700000000 + } + ] + } } } } @@ -16188,29 +15444,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationIDRequest" + "$ref": "#/components/schemas/RoleListRequest" }, "example": { - "application_id": "qLpu24Dz4CAzWsESPbJYWA" + "orderby": "created_at", + "asc": false } } } } } }, - "/rum/issue/list": { + "/role/member/grant": { "post": { - "operationId": "rum-issue-read-list", - "summary": "List issues", - "description": "Return a paginated list of RUM error tracking issues matching the given filters.", + "operationId": "role-write-grant-role", + "summary": "Grant role to members", + "description": "Assign a role to one or more members, giving them its permissions.", "tags": [ - "RUM/Issues" + "Platform/Roles & permissions" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `start_time` and `end_time` are millisecond timestamps. Maximum range: 183 days.\n- `statuses` filters by issue status. Valid values: `for_review`, `reviewed`, `ignored`, `resolved`.\n- `orderby` accepts: `created_at`, `updated_at`, `session_count`, `error_count`.\n- Use `dql` or `sql` for advanced filtering. Cannot provide both.", - "href": "/en/api-reference/rum/issues/rum-issue-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Roles Manage** (`organization`) |\n\n## Usage\n\n- Up to 100 member IDs per request.\n- Members who already have the role are silently skipped.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/platform/roles-permissions/role-write-grant-role", "metadata": { - "sidebarTitle": "List issues" + "sidebarTitle": "Grant role to members" } }, "responses": { @@ -16227,7 +15484,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumIssueListResponse" + "$ref": "#/components/schemas/PlatformEmptyObject" } } } @@ -16235,88 +15492,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "team_id": 2477033058131, - "issue_id": "NHEacQHi2DhXqobr9qPQz9", - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "service": "fd-console", - "status": "for_review", - "error_count": 752, - "session_count": 381, - "is_crash": false, - "age": 5078684, - "resolved_at": 0, - "resolved_by": 0, - "created_at": 1770883154944, - "updated_at": 1775961914595, - "first_seen": { - "timestamp": 1770883154944, - "version": "1.0.0" - }, - "last_seen": { - "timestamp": 1775961839090, - "version": "1.0.0" - }, - "error": { - "message": "Script error.", - "type": "Error" - }, - "suspected_cause": { - "source": "auto", - "value": "code.exception", - "reason": "The error message 'Script error.' typically indicates an unhandled exception in JavaScript.", - "person_id": 0 - }, - "versions": [ - "1.0.0" - ], - "severity": "Info" - }, - { - "team_id": 2477033058131, - "issue_id": "H8kZSmxiE7EgdyD4fCyyNa", - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "service": "fd-console", - "status": "for_review", - "error_count": 3, - "session_count": 1, - "is_crash": false, - "age": 48, - "resolved_at": 0, - "resolved_by": 0, - "created_at": 1775189479566, - "updated_at": 1775191284163, - "first_seen": { - "timestamp": 1775189479566, - "version": "1.0.0" - }, - "last_seen": { - "timestamp": 1775189527762, - "version": "1.0.0" - }, - "error": { - "message": "API ERROR: We encountered an internal error | POST /api/access/logout", - "type": "Error" - }, - "suspected_cause": { - "source": "auto", - "value": "api.failed_request", - "reason": "The error indicates an internal server error during a POST request to /api/access/logout.", - "person_id": 0 - }, - "versions": [ - "1.0.0" - ], - "severity": "Info" - } - ], - "has_next_page": true, - "total": 111 - } + "data": {} } } } @@ -16327,6 +15503,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -16339,39 +15518,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumIssueListRequest" + "$ref": "#/components/schemas/RoleGrantRequest" }, "example": { - "start_time": 1772611200000, - "end_time": 1775961914595, - "application_ids": [ - "eWbr4xk3ZRnLabRa6unqwD" - ], - "statuses": [ - "for_review" + "member_ids": [ + 80011, + 80012 ], - "p": 1, - "limit": 20, - "orderby": "updated_at" + "role_id": 150 } } } } } }, - "/rum/issue/info": { + "/role/member/revoke": { "post": { - "operationId": "rum-issue-read-info", - "summary": "Get issue detail", - "description": "Retrieve full details of a single issue by `issue_id`.", + "operationId": "role-write-revoke-role", + "summary": "Revoke role from members", + "description": "Remove a role from one or more members, revoking the permissions it granted.", "tags": [ - "RUM/Issues" + "Platform/Roles & permissions" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/rum/issues/rum-issue-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Roles Manage** (`organization`) |\n\n## Usage\n\n- Members who don't have the role are silently skipped.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/platform/roles-permissions/role-write-revoke-role", "metadata": { - "sidebarTitle": "Get issue detail" + "sidebarTitle": "Revoke role from members" } }, "responses": { @@ -16388,7 +15561,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumIssueItem" + "$ref": "#/components/schemas/PlatformEmptyObject" } } } @@ -16396,44 +15569,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "team_id": 2477033058131, - "issue_id": "NHEacQHi2DhXqobr9qPQz9", - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "service": "fd-console", - "status": "for_review", - "error_count": 752, - "session_count": 381, - "is_crash": false, - "age": 5078684, - "resolved_at": 0, - "resolved_by": 0, - "created_at": 1770883154944, - "updated_at": 1775961914595, - "first_seen": { - "timestamp": 1770883154944, - "version": "1.0.0" - }, - "last_seen": { - "timestamp": 1775961839090, - "version": "1.0.0" - }, - "error": { - "message": "Script error.", - "type": "Error" - }, - "suspected_cause": { - "source": "auto", - "value": "code.exception", - "reason": "The error message 'Script error.' typically indicates an unhandled exception in JavaScript.", - "person_id": 0 - }, - "versions": [ - "1.0.0" - ], - "severity": "Info" - } + "data": {} } } } @@ -16444,6 +15580,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -16456,29 +15595,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumIssueIDRequest" + "$ref": "#/components/schemas/RoleGrantRequest" }, "example": { - "issue_id": "NHEacQHi2DhXqobr9qPQz9" + "member_ids": [ + 80011 + ], + "role_id": 150 } } } } } }, - "/rum/issue/update": { + "/role/permission/factor/list": { "post": { - "operationId": "rum-issue-write-update", - "summary": "Update issue", - "description": "Update the status or suspected cause of an issue.", + "operationId": "role-read-list-permission-factor", + "summary": "List permission factors", + "description": "Return all permission factors (API, button, menu, URL, visit) optionally filtered by type.", "tags": [ - "RUM/Issues" + "Platform/Roles & permissions" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `status` valid values: `for_review`, `reviewed`, `ignored`, `resolved`.\n- `suspected_cause` valid values: `api.failed_request`, `network.error`, `code.exception`, `code.invalid_object_access`, `code.invalid_argument`, `unknown`.\n- Setting `status` to `resolved` also stamps `resolved_at` and `resolved_by` on the issue; moving a resolved issue back to another status clears them.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/rum/issues/rum-issue-write-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Permission factors are the fine-grained controls that make up each permission.\n- `factor_types` accepts: `api`, `button`, `visit`, `menu`, `url`.", + "href": "/en/api-reference/platform/roles-permissions/role-read-list-permission-factor", "metadata": { - "sidebarTitle": "Update issue" + "sidebarTitle": "List permission factors" } }, "responses": { @@ -16495,7 +15637,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/PermissionFactorListResponse" } } } @@ -16503,7 +15645,12 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": [ + { + "factor_name": "template:read:info", + "factor_type": "api" + } + ] } } } @@ -16526,30 +15673,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumIssueUpdateRequest" + "$ref": "#/components/schemas/PermissionFactorListRequest" }, "example": { - "issue_id": "NHEacQHi2DhXqobr9qPQz9", - "status": "resolved" + "factor_types": [ + "api" + ] } } } } } }, - "/sourcemap/list": { + "/role/permission/list": { "post": { - "operationId": "sourcemap-read-list", - "summary": "List sourcemaps", - "description": "Return a paginated list of uploaded sourcemap files filtered by platform type, service, and version.", + "operationId": "role-read-list-permission", + "summary": "List permissions", + "description": "Return all available permissions, optionally filtered to those granted to specific roles.", "tags": [ - "RUM/Sourcemaps" + "Platform/Roles & permissions" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `start_time` and `end_time` are required — both use Unix epoch **milliseconds**. Maximum window is 365 days.\n- The `type` field selects the platform: `browser` (JavaScript), `android`, or `ios`. Defaults to `browser` when omitted.\n- Default page size is 20; maximum is 100. Default sort is `created_at` descending.\n- For Android, `build_id` matches the Gradle plugin build identifier. For iOS, `uuid` matches the dSYM bundle UUID.", - "href": "/en/api-reference/rum/sourcemaps/sourcemap-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Pass `role_ids` to filter permissions to those granted to those roles.\n- Pass `with_all: true` to include all permissions regardless of role filter, with `is_granted` set to indicate which are granted to the specified roles.", + "href": "/en/api-reference/platform/roles-permissions/role-read-list-permission", "metadata": { - "sidebarTitle": "List sourcemaps" + "sidebarTitle": "List permissions" } }, "responses": { @@ -16566,7 +15714,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SourcemapListResponse" + "$ref": "#/components/schemas/RolePermissionListResponse" } } } @@ -16575,19 +15723,16 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 3, "items": [ { - "key": "browser/my-web-app/1.0.0/main.js.map", - "type": "browser", - "service": "my-web-app", - "version": "1.0.0", - "size": 204800, - "git_repository_url": "https://github.com/example/my-web-app", - "git_commit_sha": "abc1234def5678", - "created_at": 1712700000, - "updated_at": 1712700000, - "metadata": {} + "id": 501, + "permission_name": "Templates Read", + "permission_type": "read", + "description": "View notification templates", + "class": "On-call", + "scope": "on-call", + "status": "enabled", + "is_granted": true } ] } @@ -16613,36 +15758,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SourcemapListRequest" + "$ref": "#/components/schemas/RolePermissionListRequest" }, "example": { - "start_time": 1712000000000, - "end_time": 1712700000000, - "type": "browser", - "services": [ - "my-web-app" + "role_ids": [ + 150 ], - "p": 1, - "limit": 20 + "with_all": true } } } } } }, - "/member/info": { + "/role/upsert": { "post": { - "operationId": "memberInfo", - "summary": "Get current member info", - "description": "Return the current session member's full profile.", + "operationId": "role-write-upsert", + "summary": "Create or update a role", + "description": "Create a new custom role or update an existing one. Pass `role_id` to update.", "tags": [ - "Platform/Members" + "Platform/Roles & permissions" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/platform/members/member-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Roles Manage** (`organization`) |\n\n## Usage\n\n- Omit `role_id` (or set to 0) to create; pass an existing ID to update.\n- `role_name` must be 1–39 characters and unique within the account.\n- `permission_ids` sets the full permission set for the role, replacing any previous assignment.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/platform/roles-permissions/role-write-upsert", "metadata": { - "sidebarTitle": "Get current member info" + "sidebarTitle": "Create or update a role" } }, "responses": { @@ -16659,7 +15800,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberInfoResponse" + "$ref": "#/components/schemas/RoleUpsertResponse" } } } @@ -16668,28 +15809,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "account_avatar": "", - "account_email": "alice@example.com", - "account_id": 2451002751131, - "account_locale": "en-US", - "account_name": "Acme Corp", - "account_role_ids": [ - 6 - ], - "account_time_zone": "Asia/Shanghai", - "avatar": "/image/avatar1.png", - "country_code": "CN", - "created_at": 1701399971, - "domain": "acme", - "email": "alice@example.com", - "email_verified": true, - "is_external": false, - "locale": "zh-CN", - "member_id": 2476444212131, - "member_name": "Alice", - "phone": "+86185****0300", - "phone_verified": true, - "time_zone": "Asia/Shanghai" + "role_id": 150, + "role_name": "On-call Manager" } } } @@ -16701,6 +15822,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -16713,27 +15837,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberInfoRequest" + "$ref": "#/components/schemas/RoleUpsertRequest" }, - "example": {} + "example": { + "role_name": "On-call Manager", + "description": "Manage on-call rotations and incidents.", + "permission_ids": [ + 501, + 502 + ] + } } } } } }, - "/member/list": { + "/route/info": { "post": { - "operationId": "memberList", - "summary": "List members", - "description": "Return a paginated list of organization members.", + "operationId": "routeInfo", + "summary": "Get routing rule detail", + "description": "Retrieve the routing rule configuration for a specific integration. Returns null when the integration has no routing rule configured.", "tags": [ - "Platform/Members" + "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/platform/members/member-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/route-info", "metadata": { - "sidebarTitle": "List members" + "sidebarTitle": "Get routing rule detail" } }, "responses": { @@ -16750,7 +15881,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberListResponse" + "$ref": "#/components/schemas/RouteItem" } } } @@ -16759,50 +15890,51 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "p": 1, - "limit": 5, - "total": 148, - "items": [ + "integration_id": 6113996590131, + "cases": [ { - "account_id": 2451002751131, - "member_id": 5068740052131, - "member_name": "Bob", - "country_code": "", - "phone": "+86151****6519", - "email": "bob@example.com", - "phone_verified": true, - "email_verified": true, - "avatar": "", - "status": "enabled", - "account_role_ids": [ - 2, - 6 + "if": [ + { + "key": "labels.check", + "oper": "IN", + "vals": [ + "cpu.idle<20%" + ] + } ], - "created_at": 1752030749, - "updated_at": 1775962064, - "ref_id": "", - "is_external": false + "channel_ids": [ + 2533748993131 + ], + "fallthrough": false, + "routing_mode": "standard" }, { - "account_id": 2451002751131, - "member_id": 2476444212131, - "member_name": "Alice", - "country_code": "CN", - "phone": "+86185****0300", - "email": "alice@example.com", - "phone_verified": true, - "email_verified": true, - "avatar": "/image/avatar1.png", - "status": "enabled", - "account_role_ids": [ - 6 + "if": [ + { + "key": "severity", + "oper": "IN", + "vals": [ + "Warning" + ] + } ], - "created_at": 1701399971, - "updated_at": 1775809507, - "ref_id": "", - "is_external": false + "channel_ids": null, + "fallthrough": false, + "routing_mode": "name_mapping", + "name_mapping_label": "labels.service" } - ] + ], + "default": { + "channel_ids": [ + 3521074710131 + ] + }, + "status": "enabled", + "version": 6, + "updated_by": 3790925372131, + "creator_id": 3790925372131, + "created_at": 1774606136, + "updated_at": 1774606136 } } } @@ -16826,30 +15958,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberListRequest" + "$ref": "#/components/schemas/RouteInfoRequest" }, "example": { - "p": 1, - "limit": 5 + "integration_id": 6113996590131 } } } } } }, - "/member/delete": { + "/route/list": { "post": { - "operationId": "memberDelete", - "summary": "Delete member", - "description": "Remove a member from the organization by ID, email, phone, or name.", + "operationId": "routeList", + "summary": "List routing rules", + "description": "Return routing rules for the specified integrations. Integrations without a configured rule are omitted from the response.", "tags": [ - "Platform/Members" + "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Members Manage** (`organization`) |\n\n## Usage\n\n- By default (`is_force=false`), the system checks whether the member is referenced by other resources (e.g., escalation rules, schedules). If references exist, the API returns error code `ReferenceExist` with the reference list in `data.refs`. Set `is_force=true` to skip the reference check and force delete.\n- Members provisioned via SSO with `sso_user_non_editable=true` cannot be deleted through this API. Disable that SSO restriction first.\n- This operation is recorded in the audit log.", - "href": "/en/api-reference/platform/members/member-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/route-list", "metadata": { - "sidebarTitle": "Delete member" + "sidebarTitle": "List routing rules" } }, "responses": { @@ -16866,7 +15997,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberEmptyObject" + "$ref": "#/components/schemas/ListRoutesResponse" } } } @@ -16874,7 +16005,42 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "integration_id": 6113996590131, + "cases": [ + { + "if": [ + { + "key": "labels.check", + "oper": "IN", + "vals": [ + "cpu.idle<20%" + ] + } + ], + "channel_ids": [ + 2533748993131 + ], + "fallthrough": false, + "routing_mode": "standard" + } + ], + "default": { + "channel_ids": [ + 3521074710131 + ] + }, + "status": "enabled", + "version": 6, + "updated_by": 3790925372131, + "creator_id": 3790925372131, + "created_at": 1774606136, + "updated_at": 1774606136 + } + ] + } } } } @@ -16897,29 +16063,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberDeleteRequest" + "$ref": "#/components/schemas/ListRoutesRequest" }, "example": { - "member_id": 5068740052131 + "integration_ids": [ + 6113996590131, + 6113996590132 + ] } } } } } }, - "/member/invite": { + "/route/upsert": { "post": { - "operationId": "memberInvite", - "summary": "Invite members", - "description": "Batch invite new members to the organization by email or phone.", + "operationId": "routeUpsert", + "summary": "Upsert routing rule", + "description": "Create or update routing rules for an integration to direct alerts to specific channels. At least one of `cases` or `default` must be provided.", "tags": [ - "Platform/Members" + "On-call/Channels" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Members Manage** (`organization`) |", - "href": "/en/api-reference/platform/members/member-invite", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/channels/route-upsert", "metadata": { - "sidebarTitle": "Invite members" + "sidebarTitle": "Upsert routing rule" } }, "responses": { @@ -16936,7 +16105,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberInviteResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -16944,14 +16113,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "member_id": 5068740052131, - "member_name": "Charlie" - } - ] - } + "data": {} } } } @@ -16974,39 +16136,52 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberInviteRequest" + "$ref": "#/components/schemas/UpsertRouteRequest" }, "example": { - "members": [ + "integration_id": 6113996590131, + "cases": [ { - "member_name": "Charlie", - "email": "charlie@example.com", - "locale": "en-US", - "time_zone": "Asia/Shanghai", - "role_ids": [ - 6 - ] + "if": [ + { + "key": "severity", + "oper": "IN", + "vals": [ + "Critical" + ] + } + ], + "channel_ids": [ + 3521074710131 + ], + "fallthrough": false, + "routing_mode": "standard" } - ] + ], + "default": { + "channel_ids": [ + 3521074710131 + ] + } } } } } } }, - "/member/role/grant": { + "/rum/application/create": { "post": { - "operationId": "memberGrantRole", - "summary": "Grant role to member", - "description": "Add a role assignment to a member.", + "operationId": "rum-application-write-create", + "summary": "Create application", + "description": "Create a new RUM application. Returns the generated `application_id` and `client_token`.", "tags": [ - "Platform/Members" + "RUM/Applications" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Members Manage** (`organization`) |", - "href": "/en/api-reference/platform/members/member-grant-role", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- `type` must be one of: `browser`, `ios`, `android`, `react-native`, `flutter`, `kotlin-multiplatform`, `roku`, `unity`.\n- `client_token` is auto-generated and used to initialize the RUM SDK.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/rum/applications/rum-application-write-create", "metadata": { - "sidebarTitle": "Grant role to member" + "sidebarTitle": "Create application" } }, "responses": { @@ -17023,7 +16198,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberEmptyObject" + "$ref": "#/components/schemas/RumApplicationCreateResponse" } } } @@ -17031,7 +16206,11 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "application_id": "qLpu24Dz4CAzWsESPbJYWA", + "application_name": "My Web App", + "client_token": "e090078724855a4ca168c3884880dfbc131" + } } } } @@ -17054,32 +16233,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberRoleGrantRequest" + "$ref": "#/components/schemas/RumApplicationCreateRequest" }, "example": { - "member_id": 5068740052131, - "role_ids": [ - 6 - ] + "application_name": "My Web App", + "type": "browser", + "team_id": 2477033058131, + "is_private": false } } } } } }, - "/member/role/revoke": { + "/rum/application/delete": { "post": { - "operationId": "memberRevokeRole", - "summary": "Revoke role from member", - "description": "Remove a role assignment from a member.", + "operationId": "rum-application-write-delete", + "summary": "Delete application", + "description": "Delete a RUM application by `application_id`.", "tags": [ - "Platform/Members" + "RUM/Applications" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Members Manage** (`organization`) |", - "href": "/en/api-reference/platform/members/member-revoke-role", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/rum/applications/rum-application-write-delete", "metadata": { - "sidebarTitle": "Revoke role from member" + "sidebarTitle": "Delete application" } }, "responses": { @@ -17096,7 +16275,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberEmptyObject" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -17127,32 +16306,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberRoleRevokeRequest" + "$ref": "#/components/schemas/RumApplicationIDRequest" }, "example": { - "member_id": 5068740052131, - "role_ids": [ - 6 - ] + "application_id": "qLpu24Dz4CAzWsESPbJYWA" } } } } } }, - "/member/role/update": { + "/rum/application/info": { "post": { - "operationId": "memberUpdateRole", - "summary": "Update member roles", - "description": "Replace all role assignments for a member at once.", + "operationId": "rum-application-read-info", + "summary": "Get application detail", + "description": "Retrieve full details of a single RUM application by `application_id`.", "tags": [ - "Platform/Members" + "RUM/Applications" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Members Manage** (`organization`) |", - "href": "/en/api-reference/platform/members/member-update-role", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/rum/applications/rum-application-read-info", "metadata": { - "sidebarTitle": "Update member roles" + "sidebarTitle": "Get application detail" } }, "responses": { @@ -17169,7 +16345,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberEmptyObject" + "$ref": "#/components/schemas/RumApplicationItem" } } } @@ -17177,7 +16353,34 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "account_id": 2451002751131, + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "flashcat-rum", + "type": "browser", + "client_token": "a3cea433a8685a398cdfd68f54a45e06131", + "team_id": 2477033058131, + "is_private": true, + "no_ip": true, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": false, + "open_type": "", + "endpoint": "" + }, + "status": "enabled", + "created_by": 4441703362131, + "updated_by": 3790925372131, + "created_at": 1746673831462, + "updated_at": 1773398630657 + } } } } @@ -17200,33 +16403,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberRoleUpdateRequest" + "$ref": "#/components/schemas/RumApplicationIDRequest" }, "example": { - "member_id": 5068740052131, - "role_ids": [ - 2, - 6 - ] + "application_id": "WoyQQ3BohkdtPivubEvE8o" } } } } } }, - "/member/info/reset": { + "/rum/application/infos": { "post": { - "operationId": "memberResetInfo", - "summary": "Reset member info", - "description": "Batch-update multiple profile fields of the current member.", + "operationId": "rum-application-read-infos", + "summary": "Batch get applications", + "description": "Retrieve details for multiple RUM applications by their IDs in one request.", "tags": [ - "Platform/Members" + "RUM/Applications" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/platform/members/member-reset-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Maximum 200 IDs per request.", + "href": "/en/api-reference/rum/applications/rum-application-read-infos", "metadata": { - "sidebarTitle": "Reset member info" + "sidebarTitle": "Batch get applications" } }, "responses": { @@ -17243,7 +16442,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberEmptyObject" + "$ref": "#/components/schemas/RumApplicationInfosResponse" } } } @@ -17251,55 +16450,115 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemberResetInfoRequest" - }, - "example": { - "member_id": 2476444212131, - "member_name": "Alice", - "locale": "zh-CN", - "time_zone": "Asia/Shanghai" + "data": { + "items": [ + { + "account_id": 2451002751131, + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "type": "browser", + "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", + "team_id": 2477033058131, + "is_private": false, + "no_ip": false, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 5962711836131, + 5967875767131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": true, + "open_type": "popup", + "endpoint": "https://www.tracing.com/${trace_id}" + }, + "status": "enabled", + "created_by": 2476444212131, + "updated_by": 3122470302131, + "created_at": 1742958482000, + "updated_at": 1772096392711 + }, + { + "account_id": 2451002751131, + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "flashcat-rum", + "type": "browser", + "client_token": "a3cea433a8685a398cdfd68f54a45e06131", + "team_id": 2477033058131, + "is_private": true, + "no_ip": true, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": false, + "open_type": "", + "endpoint": "" + }, + "status": "enabled", + "created_by": 4441703362131, + "updated_by": 3790925372131, + "created_at": 1746673831462, + "updated_at": 1773398630657 + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RumApplicationInfosRequest" + }, + "example": { + "application_ids": [ + "eWbr4xk3ZRnLabRa6unqwD", + "WoyQQ3BohkdtPivubEvE8o" + ] } } } } } }, - "/person/infos": { + "/rum/application/list": { "post": { - "operationId": "personInfos", - "summary": "Batch get persons", - "description": "Return profile information for a batch of person IDs (members or accounts).", + "operationId": "rum-application-read-list", + "summary": "List applications", + "description": "Return a paginated list of RUM applications accessible to the current user.", "tags": [ - "Platform/Members" + "RUM/Applications" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/platform/members/person-infos", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Use `is_my_team` to filter applications belonging to the current user's teams.\n- Default page size is 20, maximum is 100.\n- `orderby` accepts `created_at` or `updated_at`.", + "href": "/en/api-reference/rum/applications/rum-application-read-list", "metadata": { - "sidebarTitle": "Batch get persons" + "sidebarTitle": "List applications" } }, "responses": { @@ -17316,7 +16575,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PersonInfosResponse" + "$ref": "#/components/schemas/RumApplicationListResponse" } } } @@ -17325,29 +16584,65 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "has_next_page": true, + "total": 7, "items": [ { "account_id": 2451002751131, - "person_id": 2476444212131, - "person_name": "Alice", - "avatar": "/image/avatar1.png", - "locale": "zh-CN", - "time_zone": "Asia/Shanghai", - "email": "alice@example.com", - "phone_verified": false, - "email_verified": true, - "as": "member", - "status": "enabled" + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "flashcat-rum", + "type": "browser", + "client_token": "a3cea433a8685a398cdfd68f54a45e06131", + "team_id": 2477033058131, + "is_private": true, + "no_ip": true, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": false, + "open_type": "", + "endpoint": "" + }, + "status": "enabled", + "created_by": 4441703362131, + "updated_by": 3790925372131, + "created_at": 1746673831462, + "updated_at": 1773398630657 }, { "account_id": 2451002751131, - "person_id": 3790925372131, - "person_name": "Bob", - "email": "bob@example.com", - "phone_verified": false, - "email_verified": true, - "as": "member", - "status": "enabled" + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "type": "browser", + "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", + "team_id": 2477033058131, + "is_private": false, + "no_ip": false, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 5962711836131, + 5967875767131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": true, + "open_type": "popup", + "endpoint": "https://www.tracing.com/${trace_id}" + }, + "status": "enabled", + "created_by": 2476444212131, + "updated_by": 3122470302131, + "created_at": 1742958482000, + "updated_at": 1772096392711 } ] } @@ -17373,32 +16668,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PersonInfosRequest" + "$ref": "#/components/schemas/RumApplicationListRequest" }, "example": { - "person_ids": [ - 2476444212131, - 3790925372131 - ] + "p": 1, + "limit": 20, + "query": "", + "is_my_team": false } } } } } }, - "/team/info": { + "/rum/application/update": { "post": { - "operationId": "team-read-info", - "summary": "Get team detail", - "description": "Return a single team by ID, name, or external reference ID.", + "operationId": "rum-application-write-update", + "summary": "Update application", + "description": "Update an existing RUM application. All fields except `application_id` are optional — only provided fields are updated.", "tags": [ - "Platform/Teams" + "RUM/Applications" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- At least one of `team_id`, `team_name`, or `ref_id` must be provided.", - "href": "/en/api-reference/platform/teams/team-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/rum/applications/rum-application-write-update", "metadata": { - "sidebarTitle": "Get team detail" + "sidebarTitle": "Update application" } }, "responses": { @@ -17415,7 +16710,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TeamItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -17423,24 +16718,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "account_id": 10023, - "team_id": 1001, - "team_name": "Backend SRE", - "description": "Backend reliability engineering team", - "status": "enabled", - "updated_by_name": "alice", - "updated_by": 80011, - "creator_id": 80011, - "creator_name": "alice", - "created_at": 1710000000, - "updated_at": 1712000000, - "person_ids": [ - 80011, - 80012 - ], - "ref_id": "" - } + "data": {} } } } @@ -17463,29 +16741,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TeamInfoRequest" + "$ref": "#/components/schemas/RumApplicationUpdateRequest" }, "example": { - "team_id": 1001 + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "My Web App v2", + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 + ] + } } } } } } }, - "/team/infos": { + "/rum/application/webhook/test": { "post": { - "operationId": "team-read-infos", - "summary": "Batch get teams", - "description": "Return basic info for multiple teams by their IDs in a single request.", + "operationId": "rum-application-webhook-test", + "summary": "Test application webhook", + "description": "Send a sample RUM alert event to verify an application's webhook URL.", "tags": [ - "Platform/Teams" + "RUM/Applications" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Up to 100 team IDs per request.", - "href": "/en/api-reference/platform/teams/team-read-infos", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- The endpoint validates the URL before sending the sample event.\n- A failed delivery still returns HTTP 200 with `ok=false` and the delivery error in `message`.", + "href": "/en/api-reference/rum/applications/rum-application-webhook-test", "metadata": { - "sidebarTitle": "Batch get teams" + "sidebarTitle": "Test application webhook" } }, "responses": { @@ -17502,7 +16787,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TeamInfosResponse" + "$ref": "#/components/schemas/RumWebhookTestResponse" } } } @@ -17511,23 +16796,9 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ - { - "team_id": 1001, - "team_name": "Backend SRE", - "person_ids": [ - 80011, - 80012 - ] - }, - { - "team_id": 1002, - "team_name": "Frontend", - "person_ids": [ - 80013 - ] - } - ] + "ok": true, + "status_code": 200, + "message": "ok" } } } @@ -17551,32 +16822,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TeamInfosRequest" + "$ref": "#/components/schemas/RumWebhookTestRequest" }, "example": { - "team_ids": [ - 1001, - 1002 - ] + "application_id": "rum-app-prod", + "webhook_url": "https://hooks.example.com/rum-alerts" } } } } } }, - "/team/list": { + "/rum/issue/info": { "post": { - "operationId": "team-read-list", - "summary": "List teams", - "description": "Return a paginated list of teams in the current account.", + "operationId": "rum-issue-read-info", + "summary": "Get issue detail", + "description": "Retrieve full details of a single issue by `issue_id`.", "tags": [ - "Platform/Teams" + "RUM/Issues" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Filter by `person_id` to return teams that a specific person belongs to.\n- Defaults: p=1, limit=20.", - "href": "/en/api-reference/platform/teams/team-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/rum/issues/rum-issue-read-info", "metadata": { - "sidebarTitle": "List teams" + "sidebarTitle": "Get issue detail" } }, "responses": { @@ -17593,7 +16862,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TeamListResponse" + "$ref": "#/components/schemas/RumIssueItem" } } } @@ -17602,28 +16871,42 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "p": 1, - "limit": 20, - "total": 5, - "items": [ - { - "account_id": 10023, - "team_id": 1001, - "team_name": "Backend SRE", - "status": "enabled", - "creator_id": 80011, - "created_at": 1710000000, - "updated_at": 1712000000, - "person_ids": [ - 80011 - ], - "description": "", - "updated_by_name": "", - "updated_by": 0, - "creator_name": "alice", - "ref_id": "" - } - ] + "team_id": 2477033058131, + "issue_id": "NHEacQHi2DhXqobr9qPQz9", + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "service": "fd-console", + "status": "for_review", + "error_count": 752, + "session_count": 381, + "is_crash": false, + "age": 5078684, + "resolved_at": 0, + "resolved_by": 0, + "created_at": 1770883154944, + "updated_at": 1775961914595, + "first_seen": { + "timestamp": 1770883154944, + "version": "1.0.0" + }, + "last_seen": { + "timestamp": 1775961839090, + "version": "1.0.0" + }, + "error": { + "message": "Script error.", + "type": "Error" + }, + "suspected_cause": { + "source": "auto", + "value": "code.exception", + "reason": "The error message 'Script error.' typically indicates an unhandled exception in JavaScript.", + "person_id": 0 + }, + "versions": [ + "1.0.0" + ], + "severity": "Info" } } } @@ -17647,32 +16930,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TeamListRequest" + "$ref": "#/components/schemas/RumIssueIDRequest" }, "example": { - "p": 1, - "limit": 20, - "orderby": "created_at", - "asc": false + "issue_id": "NHEacQHi2DhXqobr9qPQz9" } } } } } }, - "/team/upsert": { + "/rum/issue/list": { "post": { - "operationId": "team-write-upsert", - "summary": "Create or update a team", - "description": "Create a new team or update an existing one. Pass `team_id` to update.", + "operationId": "rum-issue-read-list", + "summary": "List issues", + "description": "Return a paginated list of RUM error tracking issues matching the given filters.", "tags": [ - "Platform/Teams" + "RUM/Issues" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Teams Manage** (`organization`) |\n\n## Usage\n\n- Omit `team_id` (or set to 0) to create a new team; pass an existing ID to update.\n- `team_name` must be 1–39 characters and unique within the account.\n- Pass `person_ids` to set team membership; this replaces the entire member list.\n- Pass `emails` or `phones` to invite members who don't yet have accounts.\n- `ref_id` is an external identifier for integration with third-party HR systems.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/platform/teams/team-write-upsert", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `start_time` and `end_time` are millisecond timestamps. Maximum range: 183 days.\n- `statuses` filters by issue status. Valid values: `for_review`, `reviewed`, `ignored`, `resolved`.\n- `orderby` accepts: `created_at`, `updated_at`, `session_count`, `error_count`.\n- Use `dql` or `sql` for advanced filtering. Cannot provide both.", + "href": "/en/api-reference/rum/issues/rum-issue-read-list", "metadata": { - "sidebarTitle": "Create or update a team" + "sidebarTitle": "List issues" } }, "responses": { @@ -17689,7 +16969,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TeamUpsertResponse" + "$ref": "#/components/schemas/RumIssueListResponse" } } } @@ -17698,8 +16978,86 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "team_id": 1001, - "team_name": "Backend SRE" + "items": [ + { + "team_id": 2477033058131, + "issue_id": "NHEacQHi2DhXqobr9qPQz9", + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "service": "fd-console", + "status": "for_review", + "error_count": 752, + "session_count": 381, + "is_crash": false, + "age": 5078684, + "resolved_at": 0, + "resolved_by": 0, + "created_at": 1770883154944, + "updated_at": 1775961914595, + "first_seen": { + "timestamp": 1770883154944, + "version": "1.0.0" + }, + "last_seen": { + "timestamp": 1775961839090, + "version": "1.0.0" + }, + "error": { + "message": "Script error.", + "type": "Error" + }, + "suspected_cause": { + "source": "auto", + "value": "code.exception", + "reason": "The error message 'Script error.' typically indicates an unhandled exception in JavaScript.", + "person_id": 0 + }, + "versions": [ + "1.0.0" + ], + "severity": "Info" + }, + { + "team_id": 2477033058131, + "issue_id": "H8kZSmxiE7EgdyD4fCyyNa", + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "service": "fd-console", + "status": "for_review", + "error_count": 3, + "session_count": 1, + "is_crash": false, + "age": 48, + "resolved_at": 0, + "resolved_by": 0, + "created_at": 1775189479566, + "updated_at": 1775191284163, + "first_seen": { + "timestamp": 1775189479566, + "version": "1.0.0" + }, + "last_seen": { + "timestamp": 1775189527762, + "version": "1.0.0" + }, + "error": { + "message": "API ERROR: We encountered an internal error | POST /api/access/logout", + "type": "Error" + }, + "suspected_cause": { + "source": "auto", + "value": "api.failed_request", + "reason": "The error indicates an internal server error during a POST request to /api/access/logout.", + "person_id": 0 + }, + "versions": [ + "1.0.0" + ], + "severity": "Info" + } + ], + "has_next_page": true, + "total": 111 } } } @@ -17711,9 +17069,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -17726,34 +17081,39 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TeamUpsertRequest" + "$ref": "#/components/schemas/RumIssueListRequest" }, "example": { - "team_name": "Backend SRE", - "description": "Backend reliability engineering team", - "person_ids": [ - 80011, - 80012 - ] + "start_time": 1772611200000, + "end_time": 1775961914595, + "application_ids": [ + "eWbr4xk3ZRnLabRa6unqwD" + ], + "statuses": [ + "for_review" + ], + "p": 1, + "limit": 20, + "orderby": "updated_at" } } } } } }, - "/team/delete": { + "/rum/issue/update": { "post": { - "operationId": "team-write-delete", - "summary": "Delete a team", - "description": "Permanently delete a team by ID, name, or external reference ID.", + "operationId": "rum-issue-write-update", + "summary": "Update issue", + "description": "Update the status or suspected cause of an issue.", "tags": [ - "Platform/Teams" + "RUM/Issues" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Teams Manage** (`organization`) |\n\n## Usage\n\n- At least one of `team_id`, `team_name`, or `ref_id` must be provided.\n- Fails with `400 ReferenceExist` if the team is still referenced by schedules, escalation rules, or other resources.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/platform/teams/team-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `status` valid values: `for_review`, `reviewed`, `ignored`, `resolved`.\n- `suspected_cause` valid values: `api.failed_request`, `network.error`, `code.exception`, `code.invalid_object_access`, `code.invalid_argument`, `unknown`.\n- Setting `status` to `resolved` also stamps `resolved_at` and `resolved_by` on the issue; moving a resolved issue back to another status clears them.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/rum/issues/rum-issue-write-update", "metadata": { - "sidebarTitle": "Delete a team" + "sidebarTitle": "Update issue" } }, "responses": { @@ -17770,7 +17130,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PlatformEmptyObject" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -17789,9 +17149,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -17804,29 +17161,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TeamDeleteRequest" + "$ref": "#/components/schemas/RumIssueUpdateRequest" }, "example": { - "team_id": 1001 + "issue_id": "NHEacQHi2DhXqobr9qPQz9", + "status": "resolved" } } } } } }, - "/role/info": { + "/safari/a2a-agent/create": { "post": { - "operationId": "role-read-info", - "summary": "Get role detail", - "description": "Return the detail of a single role by its ID.", + "operationId": "remote-agent-write-create", + "summary": "Create A2A agent", + "description": "Register a new A2A remote agent from its agent-card URL.", "tags": [ - "Platform/Roles & permissions" + "AI SRE/A2A agents" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/platform/roles-permissions/role-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- `card_url` must resolve to a valid agent card; an unreachable or invalid card returns InvalidParameter.\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-create", "metadata": { - "sidebarTitle": "Get role detail" + "sidebarTitle": "Create A2A agent" } }, "responses": { @@ -17837,13 +17200,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RoleItem" + "$ref": "#/components/schemas/A2AAgentCreateResponse" } } } @@ -17852,18 +17215,7 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "role_id": 2, - "role_name": "Account Admin", - "description": "Account admin with all permissions.", - "status": "enabled", - "permission_ids": [ - 101, - 102, - 201 - ], - "editable": false, - "created_at": 1700000000, - "updated_at": 1700000000 + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } @@ -17875,6 +17227,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -17887,29 +17242,39 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleInfoRequest" + "$ref": "#/components/schemas/A2AAgentCreateRequest" }, "example": { - "role_id": 2 + "agent_name": "deploy-bot", + "instructions": "Use when deployment pipelines need inspection or rollback advice.", + "card_url": "https://agents.example.com/deploy-bot/card", + "auth_type": "bearer", + "streaming": true, + "team_id": 0 } } } } } }, - "/role/list": { + "/safari/a2a-agent/delete": { "post": { - "operationId": "role-read-list", - "summary": "List roles", - "description": "Return all custom and built-in roles for the current account.", + "operationId": "remote-agent-write-delete", + "summary": "Delete A2A agent", + "description": "Soft-delete an A2A agent by ID.", "tags": [ - "Platform/Roles & permissions" + "AI SRE/A2A agents" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Built-in roles (`editable: false`) cannot be modified or deleted.", - "href": "/en/api-reference/platform/roles-permissions/role-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-delete", "metadata": { - "sidebarTitle": "List roles" + "sidebarTitle": "Delete A2A agent" } }, "responses": { @@ -17920,13 +17285,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RoleListResponse" + "type": "null", + "description": "Always null on success." } } } @@ -17934,21 +17300,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 3, - "items": [ - { - "role_id": 2, - "role_name": "Account Admin", - "description": "", - "status": "enabled", - "permission_ids": [], - "editable": false, - "created_at": 1700000000, - "updated_at": 1700000000 - } - ] - } + "data": null } } } @@ -17959,6 +17311,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -17971,30 +17326,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleListRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "orderby": "created_at", - "asc": false + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/role/upsert": { + "/safari/a2a-agent/disable": { "post": { - "operationId": "role-write-upsert", - "summary": "Create or update a role", - "description": "Create a new custom role or update an existing one. Pass `role_id` to update.", + "operationId": "remote-agent-write-disable", + "summary": "Disable A2A agent", + "description": "Disable an enabled A2A agent.", "tags": [ - "Platform/Roles & permissions" + "AI SRE/A2A agents" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Roles Manage** (`organization`) |\n\n## Usage\n\n- Omit `role_id` (or set to 0) to create; pass an existing ID to update.\n- `role_name` must be 1–39 characters and unique within the account.\n- `permission_ids` sets the full permission set for the role, replacing any previous assignment.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/platform/roles-permissions/role-write-upsert", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-disable", "metadata": { - "sidebarTitle": "Create or update a role" + "sidebarTitle": "Disable A2A agent" } }, "responses": { @@ -18005,13 +17364,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RoleUpsertResponse" + "type": "null", + "description": "Always null on success." } } } @@ -18019,10 +17379,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "role_id": 150, - "role_name": "On-call Manager" - } + "data": null } } } @@ -18048,34 +17405,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleUpsertRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "role_name": "On-call Manager", - "description": "Manage on-call rotations and incidents.", - "permission_ids": [ - 501, - 502 - ] + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/role/enable": { + "/safari/a2a-agent/enable": { "post": { - "operationId": "role-write-enable", - "summary": "Enable a role", - "description": "Re-enable a previously disabled custom role.", + "operationId": "remote-agent-write-enable", + "summary": "Enable A2A agent", + "description": "Enable a disabled A2A agent.", "tags": [ - "Platform/Roles & permissions" + "AI SRE/A2A agents" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Roles Manage** (`organization`) |\n\n## Usage\n\n- Only custom roles can be enabled/disabled. Built-in roles always remain enabled.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/platform/roles-permissions/role-write-enable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-enable", "metadata": { - "sidebarTitle": "Enable a role" + "sidebarTitle": "Enable A2A agent" } }, "responses": { @@ -18086,13 +17443,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PlatformEmptyObject" + "type": "null", + "description": "Always null on success." } } } @@ -18100,7 +17458,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": null } } } @@ -18126,29 +17484,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleIDRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "role_id": 150 + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/role/disable": { + "/safari/a2a-agent/get": { "post": { - "operationId": "role-write-disable", - "summary": "Disable a role", - "description": "Disable a custom role to prevent it from granting permissions.", + "operationId": "remote-agent-read-get", + "summary": "Get A2A agent detail", + "description": "Get one A2A agent by ID.", "tags": [ - "Platform/Roles & permissions" + "AI SRE/A2A agents" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Roles Manage** (`organization`) |\n\n## Usage\n\n- Members who held this role lose its permissions immediately.\n- Only custom roles can be disabled.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/platform/roles-permissions/role-write-disable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", + "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-read-get", "metadata": { - "sidebarTitle": "Disable a role" + "sidebarTitle": "Get A2A agent detail" } }, "responses": { @@ -18159,13 +17522,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PlatformEmptyObject" + "$ref": "#/components/schemas/A2AAgentItem" } } } @@ -18173,7 +17536,29 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "agent_name": "deploy-bot", + "card_url": "https://agents.example.com/deploy-bot/card", + "auth_type": "bearer", + "streaming": true, + "status": "enabled", + "agent_card_name": "Deploy Bot", + "agent_card_skills": [ + "rollback", + "diff" + ], + "card_resolve_timeout": 10, + "task_timeout": 120, + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "instructions": "Remote agent that inspects deployment pipelines." + } } } } @@ -18184,9 +17569,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -18199,29 +17581,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleIDRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "role_id": 150 + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/role/delete": { + "/safari/a2a-agent/list": { "post": { - "operationId": "role-write-delete", - "summary": "Delete a role", - "description": "Permanently delete a custom role and revoke it from all members.", + "operationId": "remote-agent-read-list", + "summary": "List A2A agents", + "description": "List A2A agents visible to the caller across account and team scopes, with pagination.", "tags": [ - "Platform/Roles & permissions" + "AI SRE/A2A agents" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Roles Manage** (`organization`) |\n\n## Usage\n\n- Built-in roles cannot be deleted.\n- All members who held this role lose its permissions immediately.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/platform/roles-permissions/role-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Pagination uses `offset`/`limit` (not `p`/`limit`).\n", + "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-read-list", "metadata": { - "sidebarTitle": "Delete a role" + "sidebarTitle": "List A2A agents" } }, "responses": { @@ -18232,13 +17619,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PlatformEmptyObject" + "$ref": "#/components/schemas/A2AAgentListResponse" } } } @@ -18246,7 +17633,34 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "agent_name": "deploy-bot", + "card_url": "https://agents.example.com/deploy-bot/card", + "auth_type": "bearer", + "streaming": true, + "status": "enabled", + "agent_card_name": "Deploy Bot", + "agent_card_skills": [ + "rollback", + "diff" + ], + "card_resolve_timeout": 10, + "task_timeout": 120, + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "instructions": "Remote agent that inspects deployment pipelines." + } + ], + "total": 1 + } } } } @@ -18257,9 +17671,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -18272,29 +17683,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleIDRequest" + "$ref": "#/components/schemas/A2AAgentListRequest" }, "example": { - "role_id": 150 + "offset": 0, + "limit": 20, + "include_account": true } } } } } }, - "/role/permission/list": { + "/safari/a2a-agent/update": { "post": { - "operationId": "role-read-list-permission", - "summary": "List permissions", - "description": "Return all available permissions, optionally filtered to those granted to specific roles.", + "operationId": "remote-agent-write-update", + "summary": "Update A2A agent", + "description": "Apply a partial update to an A2A agent. Omit a field to leave it unchanged.", "tags": [ - "Platform/Roles & permissions" + "AI SRE/A2A agents" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Pass `role_ids` to filter permissions to those granted to those roles.\n- Pass `with_all: true` to include all permissions regardless of role filter, with `is_granted` set to indicate which are granted to the specified roles.", - "href": "/en/api-reference/platform/roles-permissions/role-read-list-permission", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-update", "metadata": { - "sidebarTitle": "List permissions" + "sidebarTitle": "Update A2A agent" } }, "responses": { @@ -18305,13 +17723,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RolePermissionListResponse" + "type": "null", + "description": "Always null on success." } } } @@ -18319,20 +17738,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "id": 501, - "permission_name": "Templates Read", - "permission_type": "read", - "description": "View notification templates", - "class": "On-call", - "scope": "on-call", - "status": "enabled", - "is_granted": true - } - ] - } + "data": null } } } @@ -18343,6 +17749,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -18355,32 +17764,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RolePermissionListRequest" + "$ref": "#/components/schemas/A2AAgentUpdateRequest" }, "example": { - "role_ids": [ - 150 - ], - "with_all": true + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", + "instructions": "Inspect deployment pipelines and propose rollback steps." } } } } } }, - "/role/permission/factor/list": { + "/safari/automation/rule/create": { "post": { - "operationId": "role-read-list-permission-factor", - "summary": "List permission factors", - "description": "Return all permission factors (API, button, menu, URL, visit) optionally filtered by type.", + "operationId": "automation-rule-write-create", + "summary": "Create automation rule", + "description": "Create an AI SRE automation rule with schedule and optional HTTP trigger settings.", "tags": [ - "Platform/Roles & permissions" + "AI SRE/Automations" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Permission factors are the fine-grained controls that make up each permission.\n- `factor_types` accepts: `api`, `button`, `visit`, `menu`, `url`.", - "href": "/en/api-reference/platform/roles-permissions/role-read-list-permission-factor", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Use `team_id=0` for a personal rule or a team ID for a team-owned rule.\n- The request accepts a four-field cron expression; the response normalizes it to five fields with a leading zero minute.\n- If `http_post_trigger_enabled` is true, the response includes a one-time `http_post_token`. Save it immediately; later reads do not return it.\n- Every call is recorded in the account audit log. Do not place secrets in request fields.\n", + "href": "/en/api-reference/ai-sre/automations/automation-rule-write-create", "metadata": { - "sidebarTitle": "List permission factors" + "sidebarTitle": "Create automation rule" } }, "responses": { @@ -18391,26 +17803,42 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PermissionFactorListResponse" + "$ref": "#/components/schemas/AutomationRuleItem" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - { - "factor_name": "template:read:info", - "factor_type": "api" - } - ] + "request_id": "01J1D8PMZEB54X6E5M9K0JD8TZ", + "data": { + "rule_id": "arule_weekly_insight", + "account_id": 10023, + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": true, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": true, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, + "http_post_token": "sat_live_3Qmz7bKp9f6nR2xT1vHd", + "can_edit": true, + "created_at": 1780272000000, + "updated_at": 1780275600000 + } } } } @@ -18433,31 +17861,42 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PermissionFactorListRequest" + "$ref": "#/components/schemas/AutomationRuleCreateRequest" }, "example": { - "factor_types": [ - "api" - ] + "name": "Weekly on-call insight", + "team_id": 7, + "enabled": true, + "cron_expr": "9 * * 1", + "schedule_trigger_enabled": true, + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "http_post_trigger_enabled": true } } } } } }, - "/role/member/grant": { + "/safari/automation/rule/delete": { "post": { - "operationId": "role-write-grant-role", - "summary": "Grant role to members", - "description": "Assign a role to one or more members, giving them its permissions.", + "operationId": "automation-rule-write-delete", + "summary": "Delete automation rule", + "description": "Delete an AI SRE automation rule. Future triggers stop immediately after deletion.", "tags": [ - "Platform/Roles & permissions" + "AI SRE/Automations" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Roles Manage** (`organization`) |\n\n## Usage\n\n- Up to 100 member IDs per request.\n- Members who already have the role are silently skipped.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/platform/roles-permissions/role-write-grant-role", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Deleting a rule stops future schedule and HTTP-trigger executions; retained run history is cleaned up by the backend retention job later.\n- Every call is recorded in the account audit log. Do not place secrets in request fields.\n", + "href": "/en/api-reference/ai-sre/automations/automation-rule-write-delete", "metadata": { - "sidebarTitle": "Grant role to members" + "sidebarTitle": "Delete automation rule" } }, "responses": { @@ -18468,21 +17907,22 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PlatformEmptyObject" + "type": "null", + "description": "Always null on success." } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "request_id": "01J1D8W5SF6G8JQ8Y4S60AV45M", + "data": null } } } @@ -18493,9 +17933,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -18508,33 +17945,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleGrantRequest" + "$ref": "#/components/schemas/AutomationRuleIDRequest" }, "example": { - "member_ids": [ - 80011, - 80012 - ], - "role_id": 150 + "rule_id": "arule_weekly_insight" } } } } } }, - "/role/member/revoke": { + "/safari/automation/rule/get": { "post": { - "operationId": "role-write-revoke-role", - "summary": "Revoke role from members", - "description": "Remove a role from one or more members, revoking the permissions it granted.", + "operationId": "automation-rule-read-get", + "summary": "Get automation rule detail", + "description": "Get one automation rule together with its resolved trigger metadata.", "tags": [ - "Platform/Roles & permissions" + "AI SRE/Automations" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Roles Manage** (`organization`) |\n\n## Usage\n\n- Members who don't have the role are silently skipped.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/platform/roles-permissions/role-write-revoke-role", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The stored `cron_expr` is returned in normalized five-field form.\n- `http_post_token` is usually absent on reads; it is only surfaced immediately after create or token rotation.\n", + "href": "/en/api-reference/ai-sre/automations/automation-rule-read-get", "metadata": { - "sidebarTitle": "Revoke role from members" + "sidebarTitle": "Get automation rule detail" } }, "responses": { @@ -18545,21 +17983,41 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PlatformEmptyObject" + "$ref": "#/components/schemas/AutomationRuleItem" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "request_id": "01J1D8TANR2PCD3W3EJ0H8Y74M", + "data": { + "rule_id": "arule_weekly_insight", + "account_id": 10023, + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": true, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": true, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, + "can_edit": true, + "created_at": 1780272000000, + "updated_at": 1780275600000 + } } } } @@ -18570,9 +18028,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -18585,32 +18040,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleGrantRequest" + "$ref": "#/components/schemas/AutomationRuleIDRequest" }, "example": { - "member_ids": [ - 80011 - ], - "role_id": 150 + "rule_id": "arule_weekly_insight" } } } } } }, - "/audit/search": { + "/safari/automation/rule/list": { "post": { - "operationId": "audit-read-search", - "summary": "Search audit logs", - "description": "Return a cursor-paginated list of audit log entries within a time range.", + "operationId": "automation-rule-read-list", + "summary": "List automation rules", + "description": "List AI SRE automation rules visible to the caller across personal and team scopes.", "tags": [ - "Platform/Audit logs" + "AI SRE/Automations" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Audit Read** (`organization`) |\n\n## Usage\n\n- Time range is required. Maximum span is 90 days. Both `start_time` and `end_time` are Unix epoch **seconds**.\n- Use `search_after_ctx` from the previous response to fetch the next page. The token is opaque — do not construct it manually.\n- The retention window depends on the account's license. Queries beyond the retention boundary silently return an empty result rather than an error.\n- Default page size is 20 rows; maximum is 99.", - "href": "/en/api-reference/platform/audit-logs/audit-read-search", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `scope=all` returns the caller's personal rules plus team rules visible through membership; `team_ids` narrows the result after scope resolution.\n- Use `enabled` to filter active vs disabled rules without changing the visibility rules.\n", + "href": "/en/api-reference/ai-sre/automations/automation-rule-read-list", "metadata": { - "sidebarTitle": "Search audit logs" + "sidebarTitle": "List automation rules" } }, "responses": { @@ -18621,37 +18078,43 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AuditSearchResponse" + "$ref": "#/components/schemas/AutomationRuleListResponse" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "request_id": "01J1D8Q7M5QR2RM8ZBJW7V1F8N", "data": { - "total": 2, - "search_after_ctx": "", - "docs": [ + "total": 1, + "rules": [ { - "created_at": 1712700123456, + "rule_id": "arule_weekly_insight", "account_id": 10023, - "member_id": 80011, - "member_name": "Alice", - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "ip": "203.0.113.42", - "operation": "template:write:create", - "operation_name": "创建模板", - "body": "{\"template_name\":\"Prod default\"}", - "params": [], - "is_dangerous": false, - "is_write": true + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": true, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": true, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, + "can_edit": true, + "created_at": 1780272000000, + "updated_at": 1780275600000 } ] } @@ -18677,35 +18140,40 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AuditSearchRequest" + "$ref": "#/components/schemas/AutomationRuleListRequest" }, "example": { - "start_time": 1712620800, - "end_time": 1712707200, + "p": 1, "limit": 20, - "operations": [ - "template:write:create", - "template:write:delete" - ] + "scope": "team", + "team_ids": [ + 7 + ], + "enabled": true } } } } } }, - "/audit/operation/list": { + "/safari/automation/rule/update": { "post": { - "operationId": "audit-read-operation-list", - "summary": "List auditable operation types", - "description": "Return all operation names that are recorded in the audit log, for use as `operations` filter values.", + "operationId": "automation-rule-write-update", + "summary": "Update automation rule", + "description": "Partially update an AI SRE automation rule and optionally rotate its HTTP trigger token.", "tags": [ - "Platform/Audit logs" + "AI SRE/Automations" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Audit Read** (`organization`) |\n\n## Usage\n\n- Use the `name` values from this response as `operations` filter values in `POST /audit/search`.\n- `name_cn` is the human-readable Chinese label shown in the console; `name` is the stable wire value to filter on.", - "href": "/en/api-reference/platform/audit-logs/audit-read-operation-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Omit any field you do not want to change.\n- Set `rotate_http_post_trigger_token=true` to mint a replacement HTTP trigger token; the previous token becomes invalid immediately.\n- Every call is recorded in the account audit log. Do not place secrets in request fields.\n", + "href": "/en/api-reference/ai-sre/automations/automation-rule-write-update", "metadata": { - "sidebarTitle": "List auditable operation types" + "sidebarTitle": "Update automation rule" } }, "responses": { @@ -18716,35 +18184,41 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AuditOperationListResponse" + "$ref": "#/components/schemas/AutomationRuleItem" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "request_id": "01J1D8V011TBKCX3T7FPQ4T5W7", "data": { - "items": [ - { - "name": "template:write:create", - "name_cn": "创建模板" - }, - { - "name": "template:write:delete", - "name_cn": "删除模板" - }, - { - "name": "incident:write:acknowledge", - "name_cn": "认领故障" - } - ] + "rule_id": "arule_weekly_insight", + "account_id": 10023, + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": false, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": false, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, + "can_edit": true, + "created_at": 1780272000000, + "updated_at": 1780275600000, + "http_post_token": "sat_live_r1N6m2YQ9sH4v8Pe0KcA" } } } @@ -18768,27 +18242,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AuditOperationListRequest" + "$ref": "#/components/schemas/AutomationRuleUpdateRequest" }, - "example": {} + "example": { + "rule_id": "arule_weekly_insight", + "enabled": false, + "schedule_trigger_enabled": false, + "http_post_trigger_enabled": true, + "rotate_http_post_trigger_token": true + } } } } } }, - "/field/info": { + "/safari/automation/run/list": { "post": { - "operationId": "field-read-info", - "summary": "Get field detail", - "description": "Return the configuration of a single incident custom field by ID.", + "operationId": "automation-run-read-list", + "summary": "List automation runs", + "description": "List execution history rows for one AI SRE automation rule.", "tags": [ - "On-call/Alert enrichment" + "AI SRE/Automations" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) or **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Only fields whose status is not `deleted` are returned; a deleted or unknown `field_id` yields a 400 error.\n- The shape of `options` and `default_value` varies by `field_type` — see the `FieldItem` schema.", - "href": "/en/api-reference/on-call/alert-enrichment/field-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `started_after_ms` and `started_before_ms` are Unix timestamps in milliseconds.\n- `trigger_kind` distinguishes schedule, debug, and HTTP-triggered runs for the same rule.\n", + "href": "/en/api-reference/ai-sre/automations/automation-run-read-list", "metadata": { - "sidebarTitle": "Get field detail" + "sidebarTitle": "List automation runs" } }, "responses": { @@ -18799,40 +18284,49 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/FieldItem" + "$ref": "#/components/schemas/AutomationRunListResponse" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "request_id": "01J1D8RSGQ3CS2R2ZH4WFPB0D0", "data": { - "account_id": 80001, - "field_id": "66e9d3a4f7c2b04a1c8a91b3", - "field_name": "severity_class", - "display_name": "Severity Class", - "description": "Business severity tier.", - "field_type": "single_select", - "value_type": "string", - "options": [ - "Critical", - "High", - "Medium", - "Low" - ], - "default_value": "Medium", - "status": "enabled", - "creator_id": 80011, - "updated_by": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 + "total": 1, + "runs": [ + { + "run_id": "trun_weekly_20260630", + "kind": "automation_rule", + "account_id": 10023, + "rule_id": "arule_weekly_insight", + "trigger_kind": "schedule", + "occurrence_key": "2026-06-30T01:00:00Z", + "status": "succeeded", + "attempts": 1, + "started_at": 1782781200000, + "completed_at": 1782781685000, + "duration_ms": 485000, + "error_code": "", + "error_message": "", + "stats_json": { + "messages": 128, + "tool_calls": 9 + }, + "result_json": { + "session_id": "sess_hidden_weekly", + "final_event_id": "evt_final_weekly" + }, + "created_at": 1782781200000, + "updated_at": 1782781685000 + } + ] } } } @@ -18856,29 +18350,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FieldInfoRequest" + "$ref": "#/components/schemas/AutomationRunListRequest" }, "example": { - "field_id": "66e9d3a4f7c2b04a1c8a91b3" + "rule_id": "arule_weekly_insight", + "limit": 20, + "status": "succeeded", + "trigger_kind": "schedule", + "started_after_ms": 1780272000000 } } } } } }, - "/field/list": { + "/safari/automation/template/list": { "post": { - "operationId": "field-read-list", - "summary": "List fields", - "description": "Return all incident custom fields configured for the account.", + "operationId": "automation-template-read-list", + "summary": "List automation templates", + "description": "List preset automation templates that prefill rule creation forms for the caller locale.", "tags": [ - "On-call/Alert enrichment" + "AI SRE/Automations" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) or **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- All non-deleted fields are returned in a single response — there is no pagination and no `total` counter.\n- `query` matches against `field_name` and `display_name`; invalid regular expressions are auto-escaped to a literal substring match.", - "href": "/en/api-reference/on-call/alert-enrichment/field-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- When `locale` is omitted, the backend falls back to the caller UI locale before loading the template file.\n", + "href": "/en/api-reference/ai-sre/automations/automation-template-read-list", "metadata": { - "sidebarTitle": "List fields" + "sidebarTitle": "List automation templates" } }, "responses": { @@ -18889,42 +18392,28 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/FieldListResponse" + "$ref": "#/components/schemas/AutomationTemplateListResponse" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "request_id": "01J1D8QZ3NVJ4H0N1JBBM4WE1R", "data": { - "items": [ + "templates": [ { - "account_id": 80001, - "field_id": "66e9d3a4f7c2b04a1c8a91b3", - "field_name": "severity_class", - "display_name": "Severity Class", - "description": "Business severity tier.", - "field_type": "single_select", - "value_type": "string", - "options": [ - "Critical", - "High", - "Medium", - "Low" - ], - "default_value": "Medium", - "status": "enabled", - "creator_id": 80011, - "updated_by": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 + "name": "Weekly On-Call Insights", + "description": "Generate a weekly operational report for the on-call team.", + "icon": "clipboard-list", + "enabled": true, + "prompt": "Summarize this week's incidents, escalations, and noisy alerts for the on-call team." } ] } @@ -18950,31 +18439,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FieldListRequest" + "$ref": "#/components/schemas/AutomationTemplateListRequest" }, "example": { - "orderby": "updated_at", - "asc": false, - "query": "severity" + "locale": "en-US" } } } } } }, - "/field/create": { + "/safari/mcp/server/create": { "post": { - "operationId": "field-write-create", - "summary": "Create field", - "description": "Create a new incident custom field on the account.", + "operationId": "mcp-write-server-create", + "summary": "Create MCP server", + "description": "Register a new MCP server (connector) on the account.", "tags": [ - "On-call/Alert enrichment" + "AI SRE/MCP servers" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Maximum **15** custom fields per account.\n- `field_name` must match `^[a-zA-Z_][a-zA-Z0-9_]{0,39}$` and is immutable after creation; `display_name` must also be unique within the account.\n- Type-specific rules: `checkbox` requires `value_type=bool` and no `options`; `single_select`/`multi_select` require `value_type=string` and a non-empty unique `options` list; `text` requires `value_type=string` and no `options`.\n- Response contains only `field_id` and `field_name`; use `/field/info` to fetch the full object.\n- Audited — changes are recorded in the audit log.", - "href": "/en/api-reference/on-call/alert-enrichment/field-write-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- `command`/`args`/`env` apply to `stdio`; `url`/`headers` apply to `sse`/`streamable-http`.\n- Server name must be unique within the account; duplicates return InvalidParameter.\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-create", "metadata": { - "sidebarTitle": "Create field" + "sidebarTitle": "Create MCP server" } }, "responses": { @@ -18985,13 +18477,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CreateFieldResponse" + "$ref": "#/components/schemas/MCPServerItem" } } } @@ -19000,8 +18492,32 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "field_id": "66e9d3a4f7c2b04a1c8a91b3", - "field_name": "severity_class" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ + { + "name": "query", + "description": "Run a PromQL instant query." + }, + { + "name": "query_range", + "description": "Run a PromQL range query." + } + ], + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 } } } @@ -19013,6 +18529,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -19025,40 +18544,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateFieldRequest" + "$ref": "#/components/schemas/MCPServerCreateRequest" }, "example": { - "field_name": "severity_class", - "display_name": "Severity Class", - "description": "Business severity tier.", - "field_type": "single_select", - "value_type": "string", - "options": [ - "Critical", - "High", - "Medium", - "Low" - ], - "default_value": "Medium" + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled" } } } } } }, - "/field/update": { + "/safari/mcp/server/delete": { "post": { - "operationId": "field-write-update", - "summary": "Update field", - "description": "Update mutable attributes of an existing incident custom field.", + "operationId": "mcp-write-server-delete", + "summary": "Delete MCP server", + "description": "Delete an MCP server by ID.", "tags": [ - "On-call/Alert enrichment" + "AI SRE/MCP servers" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Only `display_name`, `description`, `options`, and `default_value` can be changed; `field_name`, `field_type`, and `value_type` are immutable.\n- `options` and `default_value` must remain consistent with the field's existing type — same rules as create.\n- Audited — changes are recorded in the audit log.", - "href": "/en/api-reference/on-call/alert-enrichment/field-write-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-delete", "metadata": { - "sidebarTitle": "Update field" + "sidebarTitle": "Delete MCP server" } }, "responses": { @@ -19069,13 +18586,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "type": "object" + "type": "null", + "description": "Always null on success." } } } @@ -19083,7 +18601,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": null } } } @@ -19094,6 +18612,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -19106,38 +18627,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateFieldRequest" + "$ref": "#/components/schemas/MCPServerDeleteRequest" }, "example": { - "field_id": "66e9d3a4f7c2b04a1c8a91b3", - "display_name": "Severity Class", - "description": "Business severity tier.", - "options": [ - "Critical", - "High", - "Medium", - "Low" - ], - "default_value": "Medium" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } } } }, - "/field/delete": { + "/safari/mcp/server/disable": { "post": { - "operationId": "field-write-delete", - "summary": "Delete field", - "description": "Delete an incident custom field and asynchronously strip it from existing incidents.", + "operationId": "mcp-write-server-disable", + "summary": "Disable MCP server", + "description": "Disable an enabled MCP server.", "tags": [ - "On-call/Alert enrichment" + "AI SRE/MCP servers" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- The field is marked deleted synchronously; clearing its values from historical incidents runs in the background and may take time on large datasets.\n- Re-creating a field with the same `field_name` is only allowed if `field_type` and `value_type` match the deleted entry.\n- Audited — changes are recorded in the audit log.", - "href": "/en/api-reference/on-call/alert-enrichment/field-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-disable", "metadata": { - "sidebarTitle": "Delete field" + "sidebarTitle": "Disable MCP server" } }, "responses": { @@ -19148,13 +18665,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "type": "object" + "type": "null", + "description": "Always null on success." } } } @@ -19162,7 +18680,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": null } } } @@ -19173,6 +18691,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -19185,46 +18706,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteFieldRequest" + "$ref": "#/components/schemas/MCPServerStatusRequest" }, "example": { - "field_id": "66e9d3a4f7c2b04a1c8a91b3" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } } } }, - "/monit/query/rows": { + "/safari/mcp/server/enable": { "post": { - "operationId": "monit-read-query-rows", - "summary": "Query data source rows", - "description": "Run a synchronous ad-hoc query against a configured data source and get back its raw rows. Used by Flashduty AI SRE and by UI preview. The request is forwarded over WebSocket to monit-edge, which executes the query against the underlying source (Prometheus / Loki / VictoriaLogs / SLS / MySQL / Postgres / Oracle / ClickHouse / Elasticsearch).", + "operationId": "mcp-write-server-enable", + "summary": "Enable MCP server", + "description": "Enable a disabled MCP server.", "tags": [ - "Monitors/Diagnostics" + "AI SRE/MCP servers" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **600 requests/minute**; **10 requests/second** per account |\n| Permissions | Any valid `app_key` (read-only; not gated by a specific permission class) |\n\n## Usage\n\n- The request is forwarded to `monit-edge` over WebSocket; the data source named by `ds_type` + `ds_name` must already exist under the calling account.\n- `account_id` in the body is optional. When supplied it must equal the authenticated account; mismatched values are rejected.\n- Two error layers: webapi-level failures use the standard error envelope, but errors raised by `monit-edge` while executing the query are returned as HTTP 200 with an `error` object in the body. Always check the response body for `error` in addition to the HTTP status.\n- monit-edge enforces a row cap; large result sets come back as `error.message = \"too many rows\"`. Narrow the time range or aggregate at the source.\n- `args` is a polymorphic `string→string` map that is forwarded verbatim. Semantics depend on `ds_type` (SLS requires `sls.project` + `sls.logstore`; Loki / VictoriaLogs raw mode requires a time range via `*.start`/`*.end` or `*.timespan.value`/`*.timespan.unit`; Prometheus and SQL sources ignore it). See the monit-webapi query-api docs for the per-source key list.", - "href": "/en/api-reference/monitors/diagnostics/monit-read-query-rows", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-enable", "metadata": { - "sidebarTitle": "Query data source rows" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryRowsRequest" - }, - "example": { - "account_id": 10001, - "ds_type": "prometheus", - "ds_name": "prod-prom", - "expr": "up", - "delay_seconds": 30 - } - } + "sidebarTitle": "Enable MCP server" } }, "responses": { @@ -19235,13 +18744,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/QueryRowsResponse" + "type": "null", + "description": "Always null on success." } } } @@ -19249,18 +18759,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - { - "fields": { - "__name__": "up", - "instance": "10.0.0.1:9100", - "job": "node" - }, - "values": { - "__value__": 1 - } - } - ] + "data": null } } } @@ -19271,67 +18770,50 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, "500": { "$ref": "#/components/responses/ServerError" } - } - } - }, - "/monit/query/diagnose": { - "post": { - "operationId": "monit-read-query-diagnose", - "summary": "Diagnose data source", - "description": "Run a synchronous diagnostic query (`log_patterns` for Loki/VictoriaLogs, `metric_trends` for Prometheus). Used by Flashduty AI SRE for log-pattern clustering and time-series trend analysis. Long-running — up to 35 s.", - "tags": [ - "Monitors/Diagnostics" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **600 requests/minute**; **10 requests/second** per account |\n| Permissions | Any valid `app_key` (read-only; not gated by a specific permission class) |\n\n## Usage\n\n- This is a diagnostic / RCA endpoint, not a raw data query — pair it with `/monit/query/rows` when you need detailed rows.\n- `operation` defaults from `ds_type`: `loki` / `victorialogs` → `log_patterns`, `prometheus` → `metric_trends`. Other sources must pass `operation` explicitly.\n- `methods` selects the analyses to run; when omitted, `log_patterns` defaults to `pattern_snapshot + pattern_compare(previous_window)` and `metric_trends` defaults to `single_window_shape + window_compare(previous_window)`.\n- `time_range` is in Unix seconds; missing or invalid values default to the last 15 minutes; a window wider than 6 hours is rejected.\n- The request is forwarded over WebSocket to `monit-edge`. Long-running: the request may take up to ~30 s on the edge side plus webapi overhead. Set client timeouts to **at least 35 s**.\n- `options.*` are upper-bounded by edge (`max_logs_scanned` ≤ 50 000, `max_patterns` ≤ 50, `examples_per_pattern` ≤ 3, `step_seconds` ∈ [15, 300], `max_series` ≤ 200, `topk` ≤ 50, `timeout_seconds` ≤ 30).\n- Two error layers as with `/monit/query/rows`: edge-level execution errors come back as HTTP 200 with an `error` object in the body — check both layers.\n- Log examples are basic-redacted before being returned; expect `warnings: [\"examples redacted\"]`. Do not treat them as raw logs.", - "href": "/en/api-reference/monitors/diagnostics/monit-read-query-diagnose", - "metadata": { - "sidebarTitle": "Diagnose data source" - } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DiagnoseRequest" + "$ref": "#/components/schemas/MCPServerStatusRequest" }, "example": { - "account_id": 10001, - "ds_type": "victorialogs", - "ds_name": "vmlogs-read", - "operation": "log_patterns", - "time_range": { - "start": 1776847544, - "end": 1776849344 - }, - "methods": [ - { - "name": "pattern_snapshot" - }, - { - "name": "pattern_compare", - "baseline": "same_window_yesterday" - } - ], - "input": { - "query": "_stream:{status='500'}" - }, - "options": { - "max_logs_scanned": 10000, - "max_patterns": 20, - "examples_per_pattern": 2, - "timeout_seconds": 25 - } + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } + } + } + }, + "/safari/mcp/server/get": { + "post": { + "operationId": "mcp-read-server-get", + "summary": "Get MCP server detail", + "description": "Get one MCP server and run a live probe of its tool list.", + "tags": [ + "AI SRE/MCP servers" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The detail call live-probes tools; on failure `list_error` is set and the request still succeeds.\n", + "href": "/en/api-reference/ai-sre/mcp-servers/mcp-read-server-get", + "metadata": { + "sidebarTitle": "Get MCP server detail" + } }, "responses": { "200": { @@ -19341,13 +18823,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DiagnoseResponse" + "$ref": "#/components/schemas/MCPServerItem" } } } @@ -19356,61 +18838,32 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "operation": "log_patterns", - "ds_type": "victorialogs", - "ds_name": "vmlogs-read", - "query": "_stream:{status='500'}", - "window": { - "start": 1776847544, - "end": 1776849344 - }, - "results": [ + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ { - "method": "pattern_snapshot", - "window": { - "start": 1776847544, - "end": 1776849344 - }, - "summary": { - "logs_scanned": 405, - "baseline_logs_scanned": 0, - "current_truncated": false, - "baseline_truncated": false, - "patterns_total": 2, - "returned_patterns": 2, - "new_patterns": 0, - "surging_patterns": 0, - "surging_threshold": { - "change_ratio_min": 3, - "count_min": 5 - } - }, - "patterns": [ - { - "pattern_hash": "239fa5da", - "template": "POST /api/v/orders/ HTTP/", - "count": 213, - "first_seen": 1776847562, - "last_seen": 1776849336, - "severity": "unknown", - "approximate": false, - "sources": [ - { - "field": "pod", - "value": "order-api-7f69d8d9b6-m4x9n", - "count": 130 - } - ], - "examples": [ - "POST /api/v/orders/ HTTP/" - ] - } - ], - "warnings": [ - "examples redacted" - ] + "name": "query", + "description": "Run a PromQL instant query." + }, + { + "name": "query_range", + "description": "Run a PromQL range query." } - ] + ], + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 } } } @@ -19428,38 +18881,41 @@ "500": { "$ref": "#/components/responses/ServerError" } - } - } - }, - "/monit/tools/catalog": { - "post": { - "operationId": "monit-read-tools-catalog", - "summary": "List target tool catalog", - "description": "Look up the tools that the per-target monit-agent currently exposes for a given `target_locator` (host, mysql, …). Returns each tool's name, description, and JSON-Schema `input_schema`. Pair with `/monit/tools/invoke` to drive AI-SRE tool calls.", - "tags": [ - "Monitors/Diagnostics" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **600 requests/minute**; **10 requests/second** per account |\n| Permissions | Any valid `app_key` (read-only; not gated by a specific permission class) |\n\n## Usage\n\n- Use `target_locator` to identify the target; `target_kind` is optional and is auto-inferred when omitted. Built-in target kinds are `host` and `mysql`.\n- If multiple kinds match the same locator, the response is HTTP 200 with `data.error.code = \"ambiguous_target_kind\"` and a `target_kinds` list — retry with an explicit `target_kind`.\n- The catalog is a *candidate capability* view, not an execution guarantee. The target Agent may go offline between catalog and invoke, or local Agent policy may block individual tools at invoke time.\n- Set `include_output_shape: true` to additionally receive each tool's `output_shape`. Default is `false` to keep the response small for LLM consumption.\n- Business errors (`target_unavailable`, `unknown_toolset_hash`, `ambiguous_target_kind`) come back as HTTP 200 with a non-null `data.error`. Only protocol / auth / internal errors use the standard error envelope.", - "href": "/en/api-reference/monitors/diagnostics/monit-read-tools-catalog", - "metadata": { - "sidebarTitle": "List target tool catalog" - } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ToolCatalogRequest" + "$ref": "#/components/schemas/MCPServerGetRequest" }, "example": { - "account_id": 10001, - "target_locator": "web-01", - "include_output_shape": true + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } + } + } + }, + "/safari/mcp/server/list": { + "post": { + "operationId": "mcp-read-server-list", + "summary": "List MCP servers", + "description": "List MCP servers visible to the caller across account and team scopes, with pagination.", + "tags": [ + "AI SRE/MCP servers" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The live tool list is not included; fetch a single server to probe its tools.\n", + "href": "/en/api-reference/ai-sre/mcp-servers/mcp-read-server-list", + "metadata": { + "sidebarTitle": "List MCP servers" + } }, "responses": { "200": { @@ -19469,13 +18925,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ToolCatalogResponse" + "$ref": "#/components/schemas/MCPServerListResponse" } } } @@ -19484,42 +18940,37 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "target": { - "kind": "host", - "locator": "web-01" - }, - "tools": [ - { - "name": "os.overview", - "target_kind": "host", - "description": "Returns a bounded overview of host health (CPU, memory, disk, network, top processes).", - "input_schema": { - "type": "object", - "additionalProperties": false, - "properties": {} - }, - "output_shape": { - "type": "object", - "required": [ - "data", - "summary", - "truncated" - ], - "properties": { - "data": { - "type": "object" - }, - "summary": { - "type": "string" - }, - "truncated": { - "type": "object" - } + "total": 1, + "servers": [ + { + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ + { + "name": "query", + "description": "Run a PromQL instant query." + }, + { + "name": "query_range", + "description": "Run a PromQL range query." } - } + ], + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 } - ], - "error": null + ] } } } @@ -19537,50 +18988,43 @@ "500": { "$ref": "#/components/responses/ServerError" } - } - } - }, - "/monit/tools/invoke": { - "post": { - "operationId": "monit-read-tools-invoke", - "summary": "Invoke target tools", - "description": "Invoke up to 8 monit-agent tools concurrently on a single target. Results come back in the order of the input `tools` array. Long-running — individual tools have per-tool timeouts on the agent and the whole request may take tens of seconds.", - "tags": [ - "Monitors/Diagnostics" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **600 requests/minute**; **10 requests/second** per account |\n| Permissions | Any valid `app_key` (read-only; not gated by a specific permission class) |\n\n## Usage\n\n- Up to **8** tools per call (`MaxToolsPerInvoke`); larger batches must be split client-side. The 8-tool cap aligns with the per-target agent concurrency.\n- Tools execute in parallel on the agent; webapi returns `results[]` aligned with the request `tools[]` order.\n- Long-running: set client timeouts to **at least 35 s**. The endpoint is intended for AI-SRE / human-RCA flows, not interactive UI.\n- Request-level errors (`target_unavailable`, `ambiguous_target_kind`, `unknown_toolset_hash`, `forward_failed`) appear as HTTP 200 with `data.error` set and `data.results = []`.\n- Per-tool failures appear as HTTP 200 with `data.error = null` and `results[i].error` populated — always check **all three** layers (outer envelope `error`, `data.error`, then each `results[i].error`).\n- Each result carries two latency fields: `agent_elapsed_ms` (agent-self-reported, excludes network) and `e2e_elapsed_ms` (webapi-observed end-to-end). A large gap between them indicates network / edge slowness rather than slow tool execution.\n- Construct `tools[].params` against the `input_schema` returned by `/monit/tools/catalog`. For no-arg tools always pass `params: {}` explicitly.", - "href": "/en/api-reference/monitors/diagnostics/monit-read-tools-invoke", - "metadata": { - "sidebarTitle": "Invoke target tools" - } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ToolInvokeRequest" + "$ref": "#/components/schemas/MCPServerListRequest" }, "example": { - "account_id": 10001, - "target_locator": "web-01", - "tools": [ - { - "tool": "os.overview", - "params": {} - }, - { - "tool": "net.tcp_ping", - "params": { - "host": "10.0.0.10", - "port": 3306 - } - } - ] + "p": 1, + "limit": 20, + "include_account": true } } } + } + } + }, + "/safari/mcp/server/update": { + "post": { + "operationId": "mcp-write-server-update", + "summary": "Update MCP server", + "description": "Update an MCP server's configuration. Omit a field to leave it unchanged.", + "tags": [ + "AI SRE/MCP servers" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Masked secret values in `env`/`headers` are preserved — sending the masked value back does not overwrite the stored secret.\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-update", + "metadata": { + "sidebarTitle": "Update MCP server" + } }, "responses": { "200": { @@ -19590,13 +19034,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ToolInvokeResponse" + "$ref": "#/components/schemas/MCPServerItem" } } } @@ -19605,42 +19049,32 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "target": { - "kind": "host", - "locator": "web-01" - }, - "results": [ + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics, alerts, and rules.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ { - "tool": "os.overview", - "tool_version": "0.5.0", - "data": { - "data": { - "sample_interval_sec": 3, - "degraded": false, - "degradation_reasons": [] - }, - "summary": "os.overview ...", - "truncated": { - "truncated": false - } - }, - "error": null, - "agent_elapsed_ms": 3120, - "e2e_elapsed_ms": 3188 + "name": "query", + "description": "Run a PromQL instant query." }, { - "tool": "net.tcp_ping", - "tool_version": "0.5.0", - "data": null, - "error": { - "code": "target_unreachable", - "message": "dial tcp 10.0.0.10:3306: i/o timeout" - }, - "agent_elapsed_ms": 0, - "e2e_elapsed_ms": 2008 + "name": "query_range", + "description": "Run a PromQL range query." } ], - "error": null + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 } } } @@ -19652,43 +19086,51 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, "500": { "$ref": "#/components/responses/ServerError" } - } - } - }, - "/monit/targets": { - "post": { - "operationId": "monit-read-targets-list", - "summary": "List monitored targets", - "description": "List the targets observed under the current tenant by the monit-agent route projection. Supports `target_locator` prefix search and cursor pagination. Use this to drive `target_locator` selection for `/monit/tools/catalog` and `/monit/tools/invoke`.", - "tags": [ - "Monitors/Diagnostics" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **600 requests/minute**; **10 requests/second** per account |\n| Permissions | Any valid `app_key` (read-only; not gated by a specific permission class) |\n\n## Usage\n\n- This is a **UI projection view**, not the live source-of-truth used by `/monit/tools/invoke`. A row in the list is no guarantee the target is currently invokable.\n- `keyword` is a **prefix** match against `target_locator` (ASCII-only, no whitespace, no `|`, max 256 bytes). Substring search is not supported in v1.\n- `limit` defaults to 50, max 200. Pagination is cursor-based: pass the previous response's `next_cursor` to fetch the next page; an empty / missing `next_cursor` means the last page.\n- Resetting `keyword`, `limit`, or the tenant context requires resetting `cursor`; never mix a cursor across different filter sets.\n- `total` is the unfiltered-by-cursor match count for the current `(account_id, keyword)` pair and stays stable across pages.\n- Fields surface `cluster_name` / `edge_ipport` for diagnostics; treat `updated_at` as \"most recently observed\" rather than a live online indicator.", - "href": "/en/api-reference/monitors/diagnostics/monit-read-targets-list", - "metadata": { - "sidebarTitle": "List monitored targets" - } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TargetsListRequest" + "$ref": "#/components/schemas/MCPServerUpdateRequest" }, "example": { - "keyword": "db-prod", - "limit": 50 + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "description": "Query Prometheus metrics, alerts, and rules." } } } + } + } + }, + "/safari/session/delete": { + "post": { + "operationId": "session-write-delete", + "summary": "Delete session", + "description": "Delete a session by ID.", + "tags": [ + "AI SRE/Sessions" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Requires manage rights on the session (creator, account admin, or owning-team member).\n", + "href": "/en/api-reference/ai-sre/sessions/session-write-delete", + "metadata": { + "sidebarTitle": "Delete session" + } }, "responses": { "200": { @@ -19698,13 +19140,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TargetsListResponse" + "type": "null", + "description": "Always null on success." } } } @@ -19712,20 +19155,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "target_kind": "host", - "target_locator": "db-prod-01", - "agent_version": "2.0.0", - "cluster_name": "edge-a", - "edge_ipport": "10.0.0.1:19090", - "updated_at": 1710000000 - } - ], - "total": 120, - "next_cursor": "eyJ0YXJnZXRfbG9jYXRvciI6ImRiLXByb2QtMDEiLCJpZCI6MTIzNDV9" - } + "data": null } } } @@ -19742,73 +19172,50 @@ "500": { "$ref": "#/components/responses/ServerError" } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionDeleteRequest" + }, + "example": { + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u" + } + } + } } } }, - "/change/list": { + "/safari/session/export": { "post": { - "operationId": "change-read-list", - "summary": "List changes", - "description": "Query change records within a time window, with filtering, search, and pagination.", + "operationId": "session-read-export", + "summary": "Export session transcript", + "description": "Stream a session's full event transcript as newline-delimited JSON.", "tags": [ - "On-call/Changes" + "AI SRE/Sessions" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", - "href": "/en/api-reference/on-call/changes/change-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The response is `application/x-ndjson` — parse line-by-line and write to a file; do not buffer the whole body in memory.\n- The first line is always a `session_meta` envelope; `include_subagents=true` inlines each child session's stream after its dispatch line.\n", + "href": "/en/api-reference/ai-sre/sessions/session-read-export", "metadata": { - "sidebarTitle": "List changes" + "sidebarTitle": "Export session transcript" } }, "responses": { "200": { - "description": "Success", + "description": "Streaming NDJSON (application/x-ndjson). One JSON object per line, terminated by a newline. The first line is always a `session_meta` envelope; subsequent lines are session events.", "content": { - "application/json": { + "application/x-ndjson": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/ListChangeResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 1, - "has_next_page": false, - "items": [ - { - "change_id": "664a1b2c3d4e5f6a7b8c9d0e", - "account_id": 10001, - "channel_id": 5001, - "channel_name": "Production", - "channel_status": "active", - "integration_id": 362, - "integration_name": "GitHub Deploy", - "title": "Deploy api-server v2.3.1", - "description": "Rolling deploy to production cluster", - "change_key": "deploy-api-server-2311", - "change_status": "Done", - "start_time": 1716962400, - "last_time": 1716962700, - "end_time": 1716963000, - "labels": { - "service": "api-server", - "env": "prod" - }, - "link": "https://github.com/acme/api-server/actions/runs/123" - } - ] - } + "type": "string", + "description": "Newline-delimited JSON stream. Parse line-by-line; do not buffer the whole body." } } } @@ -19831,38 +19238,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListChangeRequest" + "$ref": "#/components/schemas/SessionExportRequest" }, "example": { - "start_time": 1716960000, - "end_time": 1717046400, - "p": 1, - "limit": 10, - "integration_ids": [ - 362 - ], - "orderby": "start_time", - "asc": false, - "include_events": false + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "include_subagents": false } } } } } }, - "/incident/war-room/default-observers": { + "/safari/session/get": { "post": { - "operationId": "incident-read-get-war-room-default-observers", - "summary": "Get war-room default observers", - "description": "Return historical responders suggested as default observers when opening a war room.", + "operationId": "session-read-info", + "summary": "Get session detail", + "description": "Fetch one session plus a backward-paged window of its most recent events.", "tags": [ - "On-call/Incidents" + "AI SRE/Sessions" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", - "href": "/en/api-reference/on-call/incidents/incident-read-get-war-room-default-observers", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Page older history with `search_after_ctx` from the previous response.\n- `limit` (or legacy `num_recent_events`) caps the event page; default 100, max 1000.\n", + "href": "/en/api-reference/ai-sre/sessions/session-read-info", "metadata": { - "sidebarTitle": "Get war-room default observers" + "sidebarTitle": "Get session detail" } }, "responses": { @@ -19873,13 +19277,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/GetWarRoomDefaultObserversResponse" + "$ref": "#/components/schemas/SessionGetResponse" } } } @@ -19888,20 +19292,62 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "observers": [ + "session": { + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "session_name": "Investigate cloud-assistant first heartbeat", + "app_name": "ai-sre", + "entry_kind": "web", + "person_id": "3790925372131", + "team_id": 0, + "is_mine": false, + "can_manage": true, + "status": "enabled", + "incognito": false, + "created_at": 1780367971228, + "updated_at": 1780367993457, + "token_usage": { + "input_tokens": 14948, + "cached_tokens": 11520, + "output_tokens": 888, + "reasoning_tokens": 351 + }, + "current_context_tokens": 14948, + "context_window": 0, + "archived_at": 0, + "pinned_at": 0, + "last_event_at": 1780367992649, + "is_running": false, + "has_unread": true + }, + "events": [ { - "account_id": 10001, - "person_id": 20001, - "person_name": "Alice Chen", - "avatar": "https://cdn.flashcat.cloud/avatar/20001.png", - "email": "alice@acme.com", - "phone": "+8613800000000", - "locale": "zh-CN", - "time_zone": "Asia/Shanghai", - "as": "responder", - "status": "active" + "event_id": "evt_3aZQ9p", + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "author": "user", + "partial": false, + "turn_complete": false, + "status": "normal", + "created_at": 1780367971241 + }, + { + "event_id": "evt_7bWk2r", + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "author": "ai-sre", + "content": { + "role": "model", + "parts": [ + { + "text": "..." + } + ] + }, + "partial": false, + "turn_complete": true, + "status": "normal", + "created_at": 1780367992649 } - ] + ], + "has_more_older": false } } } @@ -19925,29 +19371,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetWarRoomDefaultObserversRequest" + "$ref": "#/components/schemas/SessionGetRequest" }, "example": { - "incident_id": "664a1b2c3d4e5f6a7b8c9d0e" + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "num_recent_events": 50 } } } } } }, - "/incident/war-room/add-member": { + "/safari/session/list": { "post": { - "operationId": "incident-write-add-war-room-member", - "summary": "Add war-room member", - "description": "Add one or more members to the IM war room bound to an incident integration.", + "operationId": "session-read-list", + "summary": "List sessions", + "description": "List agent sessions visible to the caller, filtered by app, surface, archive status, and team.", "tags": [ - "On-call/Incidents" + "AI SRE/Sessions" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", - "href": "/en/api-reference/on-call/incidents/incident-write-add-war-room-member", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Pagination uses `p`/`limit` (max 100); `scope` defaults to `all` (own + member-of-team rows).\n- `is_running` reflects the live run-set; `has_unread` is computed per calling user.\n", + "href": "/en/api-reference/ai-sre/sessions/session-read-list", "metadata": { - "sidebarTitle": "Add war-room member" + "sidebarTitle": "List sessions" } }, "responses": { @@ -19958,14 +19410,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "type": "string", - "description": "Returns the literal \"ok\" on success." + "$ref": "#/components/schemas/SessionListResponse" } } } @@ -19973,7 +19424,38 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": "ok" + "data": { + "total": 988, + "sessions": [ + { + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "session_name": "Investigate cloud-assistant first heartbeat", + "app_name": "ai-sre", + "entry_kind": "web", + "person_id": "3790925372131", + "team_id": 0, + "is_mine": false, + "can_manage": true, + "status": "enabled", + "incognito": false, + "created_at": 1780367971228, + "updated_at": 1780367993457, + "token_usage": { + "input_tokens": 14948, + "cached_tokens": 11520, + "output_tokens": 888, + "reasoning_tokens": 351 + }, + "current_context_tokens": 14948, + "context_window": 0, + "archived_at": 0, + "pinned_at": 0, + "last_event_at": 1780367992649, + "is_running": false, + "has_unread": true + } + ] + } } } } @@ -19996,34 +19478,37 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AddWarRoomMemberRequest" + "$ref": "#/components/schemas/SessionListRequest" }, "example": { - "integration_id": 362, - "chat_id": "oc_5ce6d572455d361153b7cb51da133945", - "member_ids": [ - 20001, - 20002 - ] + "app_name": "ai-sre", + "limit": 2, + "orderby": "updated_at", + "scope": "all" } } } } } }, - "/template/preview": { + "/safari/skill/delete": { "post": { - "operationId": "template-read-preview", - "summary": "Preview template", - "description": "Render a notification template against incident data or mock data and return the output.", + "operationId": "skill-write-delete", + "summary": "Delete skill", + "description": "Delete a skill by ID.", "tags": [ - "On-call/Notification templates" + "AI SRE/Skills" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **60 requests/minute**; **10 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", - "href": "/en/api-reference/on-call/notification-templates/template-read-preview", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/skills/skill-write-delete", "metadata": { - "sidebarTitle": "Preview template" + "sidebarTitle": "Delete skill" } }, "responses": { @@ -20034,13 +19519,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PreviewTemplateResponse" + "type": "null", + "description": "Always null on success." } } } @@ -20048,11 +19534,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "success": true, - "content": "Incident Database latency spike is Critical", - "message": "" - } + "data": null } } } @@ -20063,6 +19545,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -20075,31 +19560,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PreviewTemplateRequest" + "$ref": "#/components/schemas/SkillDeleteRequest" }, "example": { - "content": "Incident {{.Title}} is {{.Status}}", - "type": "feishu_app", - "incident_id": "664a1b2c3d4e5f6a7b8c9d0e" + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" } } } } } }, - "/datasource/im/war-room-enabled/list": { + "/safari/skill/disable": { "post": { - "operationId": "im-war-room-enabled-list", - "summary": "List war-room-enabled IM integrations", - "description": "List IM integrations that have the war-room feature enabled for the account.", + "operationId": "skill-write-disable", + "summary": "Disable skill", + "description": "Disable an enabled skill so the agent stops loading it.", "tags": [ - "On-call/IM integrations" + "AI SRE/Skills" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", - "href": "/en/api-reference/on-call/integrations/im-war-room-enabled-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Only an `enabled` skill can be disabled; otherwise returns InvalidParameter.\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/skills/skill-write-disable", "metadata": { - "sidebarTitle": "List war-room-enabled IM integrations" + "sidebarTitle": "Disable skill" } }, "responses": { @@ -20110,13 +19598,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListWarRoomEnabledResponse" + "type": "null", + "description": "Always null on success." } } } @@ -20124,35 +19613,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "data_source_id": 362, - "account_id": 10001, - "team_id": 0, - "plugin_id": 101, - "name": "Feishu Ops", - "status": "enabled", - "category": "im", - "plugin_type": "feishu", - "plugin_type_name": "Feishu", - "description": "Feishu war-room integration", - "integration_key": "ik_8f3a2b1c9d0e", - "ref_id": "", - "settings": { - "war_room_enabled": true - }, - "no_editable": false, - "creator_id": 20001, - "updated_by": 20001, - "created_at": 1716962400, - "updated_at": 1716962700, - "last_time": 1716963000, - "exclusive_data_source_id": 0, - "integration_id": 362 - } - ] - } + "data": null } } } @@ -20163,6 +19624,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -20175,27 +19639,34 @@ "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/SkillStatusRequest" }, - "example": {} + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + } } } } } }, - "/status-page/list": { - "get": { - "operationId": "status-page-read-page-list", - "summary": "List status pages", - "description": "List all status pages owned by the account, including their components and sections.", + "/safari/skill/enable": { + "post": { + "operationId": "skill-read-enable", + "summary": "Enable skill", + "description": "Enable a disabled skill so the agent can load it.", "tags": [ - "On-call/Status pages" + "AI SRE/Skills" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", - "href": "/en/api-reference/on-call/status-pages/status-page-read-page-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Only a `disabled` skill can be enabled; otherwise returns InvalidParameter.\n", + "href": "/en/api-reference/ai-sre/skills/skill-read-enable", "metadata": { - "sidebarTitle": "List status pages" + "sidebarTitle": "Enable skill" } }, "responses": { @@ -20206,13 +19677,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListStatusPageResponse" + "type": "null", + "description": "Always null on success." } } } @@ -20220,53 +19692,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "page_id": 7001, - "name": "Acme Status", - "url_name": "acme", - "type": "public", - "custom_domain": "status.acme.com", - "logo_url": "https://acme.com", - "page_header": "Acme System Status", - "date_view": "calendar", - "display_uptime_mode": "chart_and_percentage", - "custom_links": [ - { - "name": "Home", - "url": "https://acme.com" - } - ], - "contact_info": "mailto:support@acme.com", - "components": [ - { - "component_id": "cmp_001", - "section_id": "sec_001", - "name": "API", - "description": "Core API service", - "available_since_seconds": 1716962400, - "order_id": 1, - "hide_uptime": false, - "hide_all": false - } - ], - "sections": [ - { - "section_id": "sec_001", - "name": "Core Services", - "order_id": 1, - "hide_uptime": false, - "hide_all": false - } - ], - "subscription": { - "email": true, - "im": false - } - } - ] - } + "data": null } } } @@ -20277,41 +19703,54 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, "500": { "$ref": "#/components/responses/ServerError" } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillStatusRequest" + }, + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + } + } + } } } }, - "/account/info": { + "/safari/skill/get": { "post": { - "summary": "Get account detail", - "description": "Return the current account's profile and settings.", - "operationId": "account-read-info", + "operationId": "skill-read-get", + "summary": "Get skill detail", + "description": "Get one skill including its full SKILL.md content.", "tags": [ - "Platform/Account" + "AI SRE/Skills" ], "security": [ { "AppKeyAuth": [] } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - }, - "example": {} - } + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", + "href": "/en/api-reference/ai-sre/skills/skill-read-get", + "metadata": { + "sidebarTitle": "Get skill detail" } }, "responses": { "200": { - "description": "OK", + "description": "Success", "content": { "application/json": { "schema": { @@ -20323,37 +19762,38 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AccountInfo" + "$ref": "#/components/schemas/SkillItem" } } } ] }, "example": { - "error_code": 0, + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "account_id": 1001, - "account_name": "acme", - "domain": "acme", - "extra_domains": [ - "acme-corp" + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "account_id": 10023, + "team_id": 0, + "skill_name": "k8s-triage", + "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", + "version": "1.2.0", + "tags": [ + "kubernetes", + "triage" ], - "phone": "138****8000", - "country_code": "86", - "email": "ops@acme.example", - "avatar": "https://cdn.flashcat.cloud/avatar/acme.png", - "locale": "zh-CN", - "time_zone": "Asia/Shanghai", - "created_at": 1716960000, - "restrictions": { - "ips": [ - "203.0.113.0/24" - ], - "email_domains": [ - "acme.example" - ], - "allow_subdomain": true - } + "author": "sre-team", + "tools": [ + "bash", + "mcp:prometheus/query" + ], + "status": "enabled", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "can_edit": true, + "update_available": false, + "is_modified": false, + "content": "---\nname: k8s-triage\ndescription: ...\n---\n# Triage steps" } } } @@ -20369,14 +19809,21 @@ "$ref": "#/components/responses/TooManyRequests" }, "500": { - "$ref": "#/components/responses/InternalError" + "$ref": "#/components/responses/ServerError" } }, - "x-mint": { - "metadata": { - "sidebarTitle": "Get account detail" - }, - "content": "| Permission | Description |\n| --- | --- |\n| None | None — any valid app_key can call this operation. |\n\nFind this operation in the [Platform API reference](/en/api-reference/platform/account/account-read-info)." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillGetRequest" + }, + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + } + } + } } } }, @@ -20485,11 +19932,11 @@ } } }, - "/safari/skill/get": { + "/safari/skill/update": { "post": { - "operationId": "skill-read-get", - "summary": "Get skill detail", - "description": "Get one skill including its full SKILL.md content.", + "operationId": "skill-write-update", + "summary": "Update skill", + "description": "Update a skill's description or reassign its team scope.", "tags": [ "AI SRE/Skills" ], @@ -20499,10 +19946,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", - "href": "/en/api-reference/ai-sre/skills/skill-read-get", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Only `description` and `team_id` are editable; the skill body is changed by re-uploading.\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/skills/skill-write-update", "metadata": { - "sidebarTitle": "Get skill detail" + "sidebarTitle": "Update skill" } }, "responses": { @@ -20532,7 +19979,7 @@ "account_id": 10023, "team_id": 0, "skill_name": "k8s-triage", - "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", + "description": "Updated triage runbook.", "version": "1.2.0", "tags": [ "kubernetes", @@ -20549,8 +19996,7 @@ "updated_at": 1717046400000, "can_edit": true, "update_available": false, - "is_modified": false, - "content": "---\nname: k8s-triage\ndescription: ...\n---\n# Triage steps" + "is_modified": false } } } @@ -20562,6 +20008,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -20574,21 +20023,22 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillGetRequest" + "$ref": "#/components/schemas/SkillUpdateRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "description": "Updated triage runbook." } } } } } }, - "/safari/skill/update": { + "/safari/skill/upload": { "post": { - "operationId": "skill-write-update", - "summary": "Update skill", - "description": "Update a skill's description or reassign its team scope.", + "operationId": "skill-write-upload", + "summary": "Upload skill", + "description": "Upload a skill archive (.skill/.zip/.tar.gz/.tgz) to create or replace a skill.", "tags": [ "AI SRE/Skills" ], @@ -20598,10 +20048,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Only `description` and `team_id` are editable; the skill body is changed by re-uploading.\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/skills/skill-write-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **30 requests/minute**; **3 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Send as `multipart/form-data` with a `file` part. Max archive size is 100MB.\n- Set `replace=true` to overwrite an existing same-name skill.\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/skills/skill-write-upload", "metadata": { - "sidebarTitle": "Update skill" + "sidebarTitle": "Upload skill" } }, "responses": { @@ -20621,34 +20071,868 @@ "$ref": "#/components/schemas/SkillItem" } } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", - "account_id": 10023, - "team_id": 0, - "skill_name": "k8s-triage", - "description": "Updated triage runbook.", - "version": "1.2.0", - "tags": [ - "kubernetes", - "triage" - ], - "author": "sre-team", - "tools": [ - "bash", - "mcp:prometheus/query" + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "account_id": 10023, + "team_id": 0, + "skill_name": "k8s-triage", + "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", + "version": "1.2.0", + "tags": [ + "kubernetes", + "triage" + ], + "author": "sre-team", + "tools": [ + "bash", + "mcp:prometheus/query" + ], + "status": "enabled", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "can_edit": true, + "update_available": false, + "is_modified": false, + "created": true + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/SkillUploadRequest" + }, + "example": { + "team_id": 0, + "replace": false + } + } + } + } + } + }, + "/schedule/create": { + "post": { + "operationId": "scheduleCreate", + "summary": "Create schedule", + "description": "Create a new on-call schedule (escalation rule schedule).", + "tags": [ + "On-call/Schedules" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Schedules Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/schedules/schedule-create", + "metadata": { + "sidebarTitle": "Create schedule" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/ScheduleIDResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "schedule_id": 6294534917601 + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScheduleUpsertRequest" + }, + "example": { + "schedule_name": "Production On-Call", + "description": "Primary on-call rotation for the production team", + "team_id": 4291079133131, + "layers": [ + { + "layer_name": "Layer 1", + "name": "Layer 1", + "mode": 0, + "weight": 0, + "hidden": 0, + "groups": [ + { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2451002751131 + ] + } + ], + "start": 0, + "end": 0 + }, + { + "group_name": "B", + "name": "B", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2476123212131 + ] + } + ], + "start": 0, + "end": 0 + } + ], + "rotation_unit": "day", + "rotation_value": 1, + "rotation_duration": 86400, + "handoff_time": 0, + "enable_time": 1712000000, + "expire_time": 0, + "restrict_mode": 0, + "restrict_start": 0, + "restrict_end": 0, + "restrict_periods": [], + "day_mask": { + "repeat": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + "fair_rotation": false, + "mask_continuous_enabled": false + } + ], + "notify": { + "advance_in_time": 300, + "fixed_time": null, + "by": { + "follow_preference": true, + "personal_channels": null + }, + "webhooks": null + } + } + } + } + } + } + }, + "/schedule/delete": { + "post": { + "operationId": "scheduleDelete", + "summary": "Delete schedules", + "description": "Delete one or more on-call schedules by ID.", + "tags": [ + "On-call/Schedules" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Schedules Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/schedules/schedule-delete", + "metadata": { + "sidebarTitle": "Delete schedules" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/ScheduleEmptyObject" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": {} + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScheduleIDsBodyRequest" + }, + "example": { + "schedule_ids": [ + 2001 + ] + } + } + } + } + } + }, + "/schedule/info": { + "post": { + "operationId": "scheduleInfo", + "summary": "Get schedule info", + "description": "Return details of an on-call schedule including the computed schedule layers for the requested time window (max 45 days).", + "tags": [ + "On-call/Schedules" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Schedules Read** (`on-call`) or **Schedules Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/schedules/schedule-info", + "metadata": { + "sidebarTitle": "Get schedule info" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/ScheduleItem" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "id": 5789640530410, + "name": "test-000001", + "account_id": 2451002751131, + "group_id": 4291079133131, + "disabled": 0, + "create_at": 1766110836, + "create_by": 2476123212131, + "update_at": 1775205795, + "update_by": 2476123212131, + "layers": [ + { + "account_id": 2451002751131, + "name": "Layer 1", + "schedule_id": 5789640530410, + "hidden": 0, + "mode": 0, + "weight": 0, + "groups": [ + { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 3122470302131 + ] + } + ], + "start": 0, + "end": 0 + }, + { + "group_name": "B", + "name": "B", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2659460982131 + ] + } + ], + "start": 0, + "end": 0 + } + ], + "rotation_duration": 86400, + "handoff_time": 0, + "enable_time": 1767542400, + "expire_time": 0, + "restrict_mode": 0, + "restrict_start": 0, + "restrict_end": 0, + "restrict_periods": [], + "day_mask": { + "repeat": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + "create_at": 1775205795, + "create_by": 2476123212131, + "update_at": 1775205795, + "update_by": 2476123212131, + "layer_name": "Layer 1", + "fair_rotation": false, + "layer_start": 1767542400, + "layer_end": null, + "rotation_unit": "day", + "rotation_value": 1, + "mask_continuous_enabled": false + } + ], + "schedule_layers": [ + { + "layer_name": "Layer 1", + "name": "Layer 1", + "mode": 0, + "schedules": [ + { + "start": 1776009600, + "end": 1776096000, + "group": { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 3122470302131 + ] + } + ], + "start": 1776009600, + "end": 1776096000 + }, + "index": 0 + }, + { + "start": 1776096000, + "end": 1776182400, + "group": { + "group_name": "B", + "name": "B", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2659460982131 + ] + } + ], + "start": 1776096000, + "end": 1776182400 + }, + "index": 0 + } + ] + } + ], + "final_schedule": { + "layer_name": "", + "name": "", + "mode": 0, + "schedules": [ + { + "start": 1776009600, + "end": 1776096000, + "group": { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 3122470302131 + ] + } + ], + "start": 1776009600, + "end": 1776096000 + }, + "index": 0 + } + ] + }, + "notify": { + "advance_in_time": 300, + "fixed_time": null, + "by": { + "follow_preference": false, + "personal_channels": [ + "email" + ] + }, + "webhooks": [ + { + "type": "feishu_app", + "settings": { + "token": "", + "alias": "", + "data_source_id": 5427276014131, + "chat_ids": [ + "oc_60a6dc4c6e4e5cbc4934ef08aa7ff76d" + ], + "verify_token": "", + "sign_secret": "" + } + } + ] + }, + "schedule_id": 5789640530410, + "schedule_name": "test-000001", + "team_id": 4291079133131, + "description": "abc", + "layer_schedules": [ + { + "layer_name": "Layer 1", + "name": "Layer 1", + "mode": 0, + "schedules": [ + { + "start": 1776009600, + "end": 1776096000, + "group": { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 3122470302131 + ] + } + ], + "start": 1776009600, + "end": 1776096000 + }, + "index": 0 + } + ] + } + ], + "status": 0, + "cur_oncall": { + "start": 1775972040, + "end": 1776009600, + "group": { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2451002751131 + ] + } + ], + "start": 1775972040, + "end": 1776009600 + }, + "update_at": 0, + "weight": 0, + "index": 0 + }, + "next_oncall": { + "start": 1776009600, + "end": 1776096000, + "group": { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 3122470302131 + ] + } + ], + "start": 1776009600, + "end": 1776096000 + }, + "update_at": 0, + "weight": 0, + "index": 0 + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScheduleInfoRequest" + }, + "example": { + "schedule_id": 2001, + "start": 1712000000, + "end": 1712086400 + } + } + } + } + } + }, + "/schedule/infos": { + "post": { + "operationId": "scheduleInfos", + "summary": "Batch get schedules", + "description": "Return details of multiple on-call schedules by their IDs.", + "tags": [ + "On-call/Schedules" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Schedules Read** (`on-call`) or **Schedules Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/schedules/schedule-infos", + "metadata": { + "sidebarTitle": "Batch get schedules" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/ScheduleSelfResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "items": [ + { + "id": 5789640530410, + "name": "test-000001", + "account_id": 2451002751131, + "group_id": 4291079133131, + "disabled": 0, + "create_at": 1766110836, + "create_by": 2476123212131, + "update_at": 1775205795, + "update_by": 2476123212131, + "layers": null, + "schedule_layers": null, + "final_schedule": { + "layer_name": "", + "name": "", + "mode": 0, + "schedules": null + }, + "notify": { + "advance_in_time": 300, + "fixed_time": null, + "by": { + "follow_preference": false, + "personal_channels": [ + "email" + ] + }, + "webhooks": [ + { + "type": "feishu_app", + "settings": { + "token": "", + "alias": "", + "data_source_id": 5427276014131, + "chat_ids": [ + "oc_60a6dc4c6e4e5cbc4934ef08aa7ff76d" + ], + "verify_token": "", + "sign_secret": "" + } + } + ] + }, + "schedule_id": 5789640530410, + "schedule_name": "test-000001", + "team_id": 4291079133131, + "description": "abc", + "layer_schedules": null, + "status": 0, + "cur_oncall": null, + "next_oncall": null + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScheduleIDsRequest" + }, + "example": { + "schedule_ids": [ + 2001, + 2002, + 2003 + ] + } + } + } + } + } + }, + "/schedule/list": { + "post": { + "operationId": "scheduleList", + "summary": "List schedules", + "description": "Return a paginated list of on-call schedules. When both start and end are provided (max 45 days apart), computed layer schedules are included.", + "tags": [ + "On-call/Schedules" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/schedules/schedule-list", + "metadata": { + "sidebarTitle": "List schedules" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/ScheduleListResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "items": [ + { + "id": 5789640530410, + "name": "test-000001", + "account_id": 2451002751131, + "group_id": 4291079133131, + "disabled": 0, + "create_at": 1766110836, + "create_by": 2476123212131, + "update_at": 1775205795, + "update_by": 2476123212131, + "layers": null, + "schedule_layers": null, + "final_schedule": { + "layer_name": "", + "name": "", + "mode": 0, + "schedules": null + }, + "notify": { + "advance_in_time": 300, + "fixed_time": null, + "by": { + "follow_preference": false, + "personal_channels": [ + "email" + ] + }, + "webhooks": [ + { + "type": "feishu_app", + "settings": { + "token": "", + "alias": "", + "data_source_id": 5427276014131, + "chat_ids": [ + "oc_60a6dc4c6e4e5cbc4934ef08aa7ff76d" + ], + "verify_token": "", + "sign_secret": "" + } + } + ] + }, + "schedule_id": 5789640530410, + "schedule_name": "test-000001", + "team_id": 4291079133131, + "description": "abc", + "layer_schedules": null, + "status": 0, + "cur_oncall": null, + "next_oncall": null + }, + { + "id": 5432326025106, + "name": "test-2509300001", + "account_id": 2451002751131, + "group_id": 2477033058131, + "disabled": 0, + "create_at": 1759132037, + "create_by": 2476123212131, + "update_at": 1775207501, + "update_by": 2476123212131, + "layers": null, + "schedule_layers": null, + "final_schedule": { + "layer_name": "", + "name": "", + "mode": 0, + "schedules": null + }, + "notify": { + "advance_in_time": 300, + "fixed_time": null, + "by": { + "follow_preference": true, + "personal_channels": null + }, + "webhooks": null + }, + "schedule_id": 5432326025106, + "schedule_name": "test-2509300001", + "team_id": 2477033058131, + "description": "", + "layer_schedules": null, + "status": 0, + "cur_oncall": null, + "next_oncall": null + } ], - "status": "enabled", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "can_edit": true, - "update_available": false, - "is_modified": false + "total": 41 } } } @@ -20660,9 +20944,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -20675,35 +20956,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillUpdateRequest" + "$ref": "#/components/schemas/ScheduleListRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", - "description": "Updated triage runbook." + "p": 1, + "limit": 20, + "query": "production", + "is_my_team": true } } } } } }, - "/safari/skill/delete": { + "/schedule/preview": { "post": { - "operationId": "skill-write-delete", - "summary": "Delete skill", - "description": "Delete a skill by ID.", + "operationId": "schedulePreview", + "summary": "Preview schedule", + "description": "Preview the coverage generated by a schedule configuration without persisting it. The request accepts the same body as create/update plus a required start/end window (max 45 days).", "tags": [ - "AI SRE/Skills" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Schedules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/skills/skill-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **60 requests/minute**; **10 requests/second** per account |\n| Permissions | **Schedules Read** (`on-call`) or **Schedules Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/schedules/schedule-preview", "metadata": { - "sidebarTitle": "Delete skill" + "sidebarTitle": "Preview schedule" } }, "responses": { @@ -20714,14 +20992,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/ScheduleItem" } } } @@ -20729,7 +21006,169 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "id": null, + "name": null, + "account_id": 0, + "group_id": null, + "disabled": null, + "create_at": 0, + "create_by": 0, + "update_at": 0, + "update_by": 0, + "layers": [ + { + "account_id": 0, + "name": "Layer 1", + "schedule_id": 0, + "hidden": 0, + "mode": 0, + "weight": 0, + "groups": [ + { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2451002751131 + ] + } + ], + "start": 0, + "end": 0 + }, + { + "group_name": "B", + "name": "B", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2476123212131 + ] + } + ], + "start": 0, + "end": 0 + } + ], + "rotation_duration": 86400, + "handoff_time": 0, + "enable_time": 1775980800, + "expire_time": 0, + "restrict_mode": 0, + "restrict_start": 0, + "restrict_end": 0, + "restrict_periods": [], + "day_mask": { + "repeat": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + "create_at": 0, + "create_by": 0, + "update_at": 0, + "update_by": 0, + "layer_name": "Layer 1", + "fair_rotation": false, + "layer_start": 1775980800, + "layer_end": null, + "rotation_unit": "day", + "rotation_value": 1, + "mask_continuous_enabled": false + } + ], + "schedule_layers": [ + { + "layer_name": "Layer 1", + "name": "Layer 1", + "mode": 0, + "schedules": [ + { + "start": 1776009600, + "end": 1776096000, + "group": { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2451002751131 + ] + } + ], + "start": 1776009600, + "end": 1776096000 + }, + "index": 0 + }, + { + "start": 1776096000, + "end": 1776182400, + "group": { + "group_name": "B", + "name": "B", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2476123212131 + ] + } + ], + "start": 1776096000, + "end": 1776182400 + }, + "index": 0 + } + ] + } + ], + "final_schedule": { + "layer_name": "", + "name": "", + "mode": 0, + "schedules": [ + { + "start": 1776009600, + "end": 1776096000, + "group": { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2451002751131 + ] + } + ], + "start": 1776009600, + "end": 1776096000 + }, + "index": 0 + } + ] + }, + "start": 1775980800, + "end": 1776240000, + "notify": null, + "schedule_id": 0, + "schedule_name": null, + "team_id": null, + "description": null, + "layer_schedules": null, + "status": null, + "cur_oncall": null, + "next_oncall": null + } } } } @@ -20740,9 +21179,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -20755,34 +21191,77 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillDeleteRequest" + "$ref": "#/components/schemas/ScheduleUpsertRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "schedule_name": "Preview Schedule", + "start": 1712000000, + "end": 1712086400, + "layers": [ + { + "layer_name": "Layer 1", + "name": "Layer 1", + "mode": 0, + "weight": 0, + "hidden": 0, + "groups": [ + { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2451002751131 + ] + } + ], + "start": 0, + "end": 0 + } + ], + "rotation_unit": "day", + "rotation_value": 1, + "rotation_duration": 86400, + "handoff_time": 0, + "enable_time": 1712000000, + "expire_time": 0, + "restrict_mode": 0, + "restrict_start": 0, + "restrict_end": 0, + "restrict_periods": [], + "day_mask": { + "repeat": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + "fair_rotation": false, + "mask_continuous_enabled": false + } + ] } } } } } }, - "/safari/skill/upload": { + "/schedule/self": { "post": { - "operationId": "skill-write-upload", - "summary": "Upload skill", - "description": "Upload a skill archive (.skill/.zip/.tar.gz/.tgz) to create or replace a skill.", + "operationId": "scheduleSelf", + "summary": "List my schedules", + "description": "Return on-call schedules where the current user is assigned.", "tags": [ - "AI SRE/Skills" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Schedules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **30 requests/minute**; **3 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Send as `multipart/form-data` with a `file` part. Max archive size is 100MB.\n- Set `replace=true` to overwrite an existing same-name skill.\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/skills/skill-write-upload", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Schedules Read** (`on-call`) or **Schedules Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/schedules/schedule-self", "metadata": { - "sidebarTitle": "Upload skill" + "sidebarTitle": "List my schedules" } }, "responses": { @@ -20793,13 +21272,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SkillItem" + "$ref": "#/components/schemas/ScheduleSelfResponse" } } } @@ -20808,29 +21287,107 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", - "account_id": 10023, - "team_id": 0, - "skill_name": "k8s-triage", - "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", - "version": "1.2.0", - "tags": [ - "kubernetes", - "triage" - ], - "author": "sre-team", - "tools": [ - "bash", - "mcp:prometheus/query" - ], - "status": "enabled", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "can_edit": true, - "update_available": false, - "is_modified": false, - "created": true + "items": [ + { + "id": 2539108069860, + "name": "Open Source Q&A", + "account_id": 2451002751131, + "group_id": 2477033058131, + "disabled": 0, + "create_at": 1702623874, + "create_by": 2451002751131, + "update_at": 1710468081, + "update_by": 2476444212131, + "layers": [ + { + "account_id": 2451002751131, + "name": "Rule 1", + "schedule_id": 2539108069860, + "hidden": 0, + "mode": 0, + "weight": 0, + "groups": [ + { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2476444212131 + ] + } + ], + "start": 0, + "end": 0 + }, + { + "group_name": "B", + "name": "B", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2469167612131 + ] + } + ], + "start": 0, + "end": 0 + } + ], + "rotation_duration": 86400, + "handoff_time": 0, + "enable_time": 1702623874, + "expire_time": 0, + "restrict_mode": 0, + "restrict_start": 0, + "restrict_end": 0, + "restrict_periods": [], + "day_mask": { + "repeat": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + "create_at": 1702623874, + "create_by": 2451002751131, + "update_at": 1710468081, + "update_by": 2476444212131, + "layer_name": "Rule 1", + "fair_rotation": false, + "layer_start": 1702623874, + "layer_end": null, + "rotation_unit": "day", + "rotation_value": 1, + "mask_continuous_enabled": false + } + ], + "schedule_layers": null, + "final_schedule": { + "layer_name": "", + "name": "", + "mode": 0, + "schedules": null + }, + "notify": { + "fixed_time": null, + "by": null, + "webhooks": null + }, + "schedule_id": 2539108069860, + "schedule_name": "Open Source Q&A", + "team_id": 2477033058131, + "description": "", + "layer_schedules": null, + "status": 0, + "cur_oncall": null, + "next_oncall": null + } + ] } } } @@ -20842,9 +21399,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -20855,37 +21409,32 @@ "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { - "$ref": "#/components/schemas/SkillUploadRequest" + "$ref": "#/components/schemas/ScheduleSelfRequest" }, "example": { - "team_id": 0, - "replace": false + "start": 1712000000, + "end": 1712086400 } } } } } }, - "/safari/skill/enable": { + "/schedule/update": { "post": { - "operationId": "skill-read-enable", - "summary": "Enable skill", - "description": "Enable a disabled skill so the agent can load it.", + "operationId": "scheduleUpdate", + "summary": "Update schedule", + "description": "Update an existing on-call schedule. Provide schedule_id to identify the schedule.", "tags": [ - "AI SRE/Skills" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Schedules" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Only a `disabled` skill can be enabled; otherwise returns InvalidParameter.\n", - "href": "/en/api-reference/ai-sre/skills/skill-read-enable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Schedules Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/schedules/schedule-update", "metadata": { - "sidebarTitle": "Enable skill" + "sidebarTitle": "Update schedule" } }, "responses": { @@ -20896,14 +21445,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/ScheduleEmptyObject" } } } @@ -20911,7 +21459,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": {} } } } @@ -20922,9 +21470,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -20937,34 +21482,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillStatusRequest" + "$ref": "#/components/schemas/ScheduleUpsertRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "schedule_id": 2001, + "schedule_name": "Production On-Call (Updated)", + "description": "Updated primary on-call rotation", + "team_id": 4291079133131 } } } } } }, - "/safari/skill/disable": { + "/sourcemap/list": { "post": { - "operationId": "skill-write-disable", - "summary": "Disable skill", - "description": "Disable an enabled skill so the agent stops loading it.", + "operationId": "sourcemap-read-list", + "summary": "List sourcemaps", + "description": "Return a paginated list of uploaded sourcemap files filtered by platform type, service, and version.", "tags": [ - "AI SRE/Skills" - ], - "security": [ - { - "AppKeyAuth": [] - } + "RUM/Sourcemaps" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Only an `enabled` skill can be disabled; otherwise returns InvalidParameter.\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/skills/skill-write-disable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `start_time` and `end_time` are required — both use Unix epoch **milliseconds**. Maximum window is 365 days.\n- The `type` field selects the platform: `browser` (JavaScript), `android`, or `ios`. Defaults to `browser` when omitted.\n- Default page size is 20; maximum is 100. Default sort is `created_at` descending.\n- For Android, `build_id` matches the Gradle plugin build identifier. For iOS, `uuid` matches the dSYM bundle UUID.", + "href": "/en/api-reference/rum/sourcemaps/sourcemap-read-list", "metadata": { - "sidebarTitle": "Disable skill" + "sidebarTitle": "List sourcemaps" } }, "responses": { @@ -20975,14 +21518,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/SourcemapListResponse" } } } @@ -20990,7 +21532,23 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "total": 3, + "items": [ + { + "key": "browser/my-web-app/1.0.0/main.js.map", + "type": "browser", + "service": "my-web-app", + "version": "1.0.0", + "size": 204800, + "git_repository_url": "https://github.com/example/my-web-app", + "git_commit_sha": "abc1234def5678", + "created_at": 1712700000, + "updated_at": 1712700000, + "metadata": {} + } + ] + } } } } @@ -21001,9 +21559,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -21016,34 +21571,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillStatusRequest" + "$ref": "#/components/schemas/SourcemapListRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "start_time": 1712000000000, + "end_time": 1712700000000, + "type": "browser", + "services": [ + "my-web-app" + ], + "p": 1, + "limit": 20 } } } } } }, - "/safari/mcp/server/list": { - "post": { - "operationId": "mcp-read-server-list", - "summary": "List MCP servers", - "description": "List MCP servers visible to the caller across account and team scopes, with pagination.", + "/status-page/change/active/list": { + "get": { + "operationId": "statusPageChangeActiveList", + "summary": "List active status page events", + "description": "List in-progress (non-terminal) events of a given type for a status page.", "tags": [ - "AI SRE/MCP servers" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The live tool list is not included; fetch a single server to probe its tools.\n", - "href": "/en/api-reference/ai-sre/mcp-servers/mcp-read-server-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/status-pages/status-page-change-active-list", "metadata": { - "sidebarTitle": "List MCP servers" + "sidebarTitle": "List active status page events" } }, "responses": { @@ -21054,13 +21611,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerListResponse" + "$ref": "#/components/schemas/StatusPageChangeListResponse" } } } @@ -21069,35 +21626,41 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 1, - "servers": [ + "items": [ { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ + "change_id": 5821693893131, + "page_id": 5750613685214, + "type": "incident", + "title": "Web Console Degraded Performance", + "description": "We are currently investigating an issue affecting some services.", + "status": "investigating", + "affected_components": [ { - "name": "query", - "description": "Run a PromQL instant query." - }, + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", + "name": "Web Console", + "available_since_seconds": 1765349358, + "order_id": 1, + "status": "degraded" + } + ], + "start_at_seconds": 1766736878, + "updates": [ { - "name": "query_range", - "description": "Run a PromQL range query." + "update_id": "01KDCVJQ88SZPHWPTDV2Z2AZW8", + "at_seconds": 1766736876, + "status": "investigating", + "description": "We are currently investigating an issue affecting some services.", + "component_changes": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "component_name": "Web Console", + "status": "degraded" + } + ] } ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 + "notify_subscribers": true } ] } @@ -21118,41 +21681,46 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MCPServerListRequest" - }, - "example": { - "p": 1, - "limit": 20, - "include_account": true - } - } + "parameters": [ + { + "name": "page_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Status page ID." + }, + { + "name": "type", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "incident", + "maintenance" + ] + }, + "description": "Event type filter. Required. Returns only in-progress (non-terminal) events — `investigating`/`identified`/`monitoring` for `incident`, `scheduled`/`ongoing` for `maintenance`." } - } + ] } }, - "/safari/mcp/server/create": { + "/status-page/change/create": { "post": { - "operationId": "mcp-write-server-create", - "summary": "Create MCP server", - "description": "Register a new MCP server (connector) on the account.", + "operationId": "statusPageChangeCreate", + "summary": "Create status page event", + "description": "Create a new incident or maintenance event on a status page.", "tags": [ - "AI SRE/MCP servers" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- `command`/`args`/`env` apply to `stdio`; `url`/`headers` apply to `sse`/`streamable-http`.\n- Server name must be unique within the account; duplicates return InvalidParameter.\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Events Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-change-create", "metadata": { - "sidebarTitle": "Create MCP server" + "sidebarTitle": "Create status page event" } }, "responses": { @@ -21163,13 +21731,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerItem" + "$ref": "#/components/schemas/StatusPageChangeCreateResponse" } } } @@ -21178,32 +21746,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ - { - "name": "query", - "description": "Run a PromQL instant query." - }, - { - "name": "query_range", - "description": "Run a PromQL range query." - } - ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 + "change_id": 6294539747131, + "change_name": "API Test Incident" } } } @@ -21215,9 +21759,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -21230,38 +21771,47 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerCreateRequest" + "$ref": "#/components/schemas/CreateStatusPageChangeRequest" }, "example": { - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled" + "page_id": 5750613685214, + "type": "incident", + "title": "Web Console Degraded Performance", + "description": "We are investigating degraded performance affecting the web console.", + "status": "investigating", + "start_at_seconds": 1712000000, + "notify_subscribers": true, + "updates": [ + { + "status": "investigating", + "description": "We are currently investigating an issue affecting some users.", + "component_changes": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "status": "degraded" + } + ] + } + ] } } } } } }, - "/safari/mcp/server/get": { + "/status-page/change/delete": { "post": { - "operationId": "mcp-read-server-get", - "summary": "Get MCP server detail", - "description": "Get one MCP server and run a live probe of its tool list.", + "operationId": "statusPageChangeDelete", + "summary": "Delete status page event", + "description": "Delete a status page event.", "tags": [ - "AI SRE/MCP servers" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The detail call live-probes tools; on failure `list_error` is set and the request still succeeds.\n", - "href": "/en/api-reference/ai-sre/mcp-servers/mcp-read-server-get", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Events Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-change-delete", "metadata": { - "sidebarTitle": "Get MCP server detail" + "sidebarTitle": "Delete status page event" } }, "responses": { @@ -21272,13 +21822,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -21286,34 +21836,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ - { - "name": "query", - "description": "Run a PromQL instant query." - }, - { - "name": "query_range", - "description": "Run a PromQL range query." - } - ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 - } + "data": {} } } } @@ -21336,34 +21859,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerGetRequest" + "$ref": "#/components/schemas/DeleteStatusPageChangeRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" + "page_id": 5750613685214, + "change_id": 5821693893131 } } } } } }, - "/safari/mcp/server/update": { - "post": { - "operationId": "mcp-write-server-update", - "summary": "Update MCP server", - "description": "Update an MCP server's configuration. Omit a field to leave it unchanged.", + "/status-page/change/info": { + "get": { + "operationId": "statusPageChangeInfo", + "summary": "Get status page event detail", + "description": "Retrieve details of a specific status page event (incident or maintenance).", "tags": [ - "AI SRE/MCP servers" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Masked secret values in `env`/`headers` are preserved — sending the masked value back does not overwrite the stored secret.\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/status-pages/status-page-change-info", "metadata": { - "sidebarTitle": "Update MCP server" + "sidebarTitle": "Get status page event detail" } }, "responses": { @@ -21374,13 +21893,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerItem" + "$ref": "#/components/schemas/StatusPageChangeItem" } } } @@ -21389,32 +21908,53 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics, alerts, and rules.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ + "change_id": 5821693893131, + "page_id": 5750613685214, + "type": "incident", + "title": "Web Console Degraded Performance", + "description": "The issue has been resolved, and all services are operating normally.\n\nThank you for your patience.", + "status": "resolved", + "affected_components": [ { - "name": "query", - "description": "Run a PromQL instant query." + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", + "name": "Web Console", + "available_since_seconds": 1765349358, + "order_id": 1, + "status": "operational" + } + ], + "start_at_seconds": 1766736878, + "close_at_seconds": 1775529742, + "updates": [ + { + "update_id": "01KDCVJQ88SZPHWPTDV2Z2AZW8", + "at_seconds": 1766736876, + "status": "investigating", + "description": "We are currently investigating an issue affecting some services.", + "component_changes": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "component_name": "Web Console", + "status": "degraded" + } + ] }, { - "name": "query_range", - "description": "Run a PromQL range query." + "update_id": "01KNJX3KW873ZZSRZC14SGFYS3", + "at_seconds": 1775529742, + "status": "resolved", + "description": "The issue has been resolved, and all services are operating normally.", + "component_changes": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "component_name": "Web Console", + "status": "operational" + } + ] } ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 + "notify_subscribers": true } } } @@ -21426,9 +21966,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -21436,40 +21973,43 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MCPServerUpdateRequest" - }, - "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "description": "Query Prometheus metrics, alerts, and rules." - } - } + "parameters": [ + { + "name": "page_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Status page ID." + }, + { + "name": "change_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Event (change) ID." } - } + ] } }, - "/safari/mcp/server/delete": { - "post": { - "operationId": "mcp-write-server-delete", - "summary": "Delete MCP server", - "description": "Delete an MCP server by ID.", + "/status-page/change/list": { + "get": { + "operationId": "statusPageChangeList", + "summary": "List status page events", + "description": "List events (incidents and maintenances) for a status page.", "tags": [ - "AI SRE/MCP servers" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/status-pages/status-page-change-list", "metadata": { - "sidebarTitle": "Delete MCP server" + "sidebarTitle": "List status page events" } }, "responses": { @@ -21480,14 +22020,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/StatusPageChangeListResponse" } } } @@ -21495,7 +22034,59 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "items": [ + { + "change_id": 5821693893131, + "page_id": 5750613685214, + "type": "incident", + "title": "Web Console Degraded Performance", + "description": "The issue has been resolved, and all services are operating normally.", + "status": "resolved", + "affected_components": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", + "name": "Web Console", + "available_since_seconds": 1765349358, + "order_id": 1, + "status": "operational" + } + ], + "start_at_seconds": 1766736878, + "close_at_seconds": 1775529742, + "updates": [ + { + "update_id": "01KDCVJQ88SZPHWPTDV2Z2AZW8", + "at_seconds": 1766736876, + "status": "investigating", + "description": "We are currently investigating an issue affecting some services.", + "component_changes": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "component_name": "Web Console", + "status": "degraded" + } + ] + }, + { + "update_id": "01KNJX3KW873ZZSRZC14SGFYS3", + "at_seconds": 1775529742, + "status": "resolved", + "description": "The issue has been resolved, and all services are operating normally.", + "component_changes": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "component_name": "Web Console", + "status": "operational" + } + ] + } + ], + "notify_subscribers": true + } + ] + } } } } @@ -21506,9 +22097,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -21516,39 +22104,84 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MCPServerDeleteRequest" - }, - "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" - } - } + "parameters": [ + { + "name": "page_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Status page ID." + }, + { + "name": "start_at_seconds", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Filter events started at or after this unix timestamp (seconds)." + }, + { + "name": "end_at_seconds", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Filter events started at or before this unix timestamp (seconds)." + }, + { + "name": "type", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "incident", + "maintenance" + ] + }, + "description": "Event type filter. Required." + }, + { + "name": "status", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "investigating", + "identified", + "monitoring", + "resolved", + "scheduled", + "ongoing", + "completed" + ] + }, + "description": "Event status filter. Required. Must be a status valid for the given `type` (e.g. `investigating`/`identified`/`monitoring`/`resolved` for incidents; `scheduled`/`ongoing`/`completed` for maintenances)." } - } + ] } }, - "/safari/mcp/server/enable": { + "/status-page/change/timeline/create": { "post": { - "operationId": "mcp-write-server-enable", - "summary": "Enable MCP server", - "description": "Enable a disabled MCP server.", + "operationId": "statusPageChangeTimelineCreate", + "summary": "Create event timeline entry", + "description": "Add a timeline update to a status page event.", "tags": [ - "AI SRE/MCP servers" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-enable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Events Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-change-timeline-create", "metadata": { - "sidebarTitle": "Enable MCP server" + "sidebarTitle": "Create event timeline entry" } }, "responses": { @@ -21559,14 +22192,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/StatusPageChangeTimelineCreateResponse" } } } @@ -21574,7 +22206,9 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "update_id": "01KP0311872NVYFRRQ82FWXAP4" + } } } } @@ -21585,9 +22219,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -21600,34 +22231,39 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerStatusRequest" + "$ref": "#/components/schemas/CreateStatusPageChangeTimelineRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" + "page_id": 5750613685214, + "change_id": 5821693893131, + "status": "identified", + "description": "We have identified the root cause and are working on a fix.", + "at_seconds": 1712003600, + "component_changes": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "status": "partial_outage" + } + ] } } } } } }, - "/safari/mcp/server/disable": { + "/status-page/change/timeline/delete": { "post": { - "operationId": "mcp-write-server-disable", - "summary": "Disable MCP server", - "description": "Disable an enabled MCP server.", + "operationId": "statusPageChangeTimelineDelete", + "summary": "Delete event timeline entry", + "description": "Delete a timeline entry from a status page event.", "tags": [ - "AI SRE/MCP servers" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-disable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Events Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-change-timeline-delete", "metadata": { - "sidebarTitle": "Disable MCP server" + "sidebarTitle": "Delete event timeline entry" } }, "responses": { @@ -21638,14 +22274,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -21653,7 +22288,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": {} } } } @@ -21664,9 +22299,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -21679,34 +22311,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerStatusRequest" + "$ref": "#/components/schemas/DeleteStatusPageChangeTimelineRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" + "page_id": 5750613685214, + "change_id": 5821693893131, + "update_id": "01KP0311872NVYFRRQ82FWXAP4" } } } } } }, - "/safari/a2a-agent/create": { + "/status-page/change/timeline/update": { "post": { - "operationId": "remote-agent-write-create", - "summary": "Create A2A agent", - "description": "Register a new A2A remote agent from its agent-card URL.", + "operationId": "statusPageChangeTimelineUpdate", + "summary": "Update event timeline entry", + "description": "Update a timeline entry for a status page event.", "tags": [ - "AI SRE/A2A agents" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- `card_url` must resolve to a valid agent card; an unreachable or invalid card returns InvalidParameter.\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Events Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-change-timeline-update", "metadata": { - "sidebarTitle": "Create A2A agent" + "sidebarTitle": "Update event timeline entry" } }, "responses": { @@ -21717,13 +22346,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/A2AAgentCreateResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -21731,9 +22360,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" - } + "data": {} } } } @@ -21744,9 +22371,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -21759,39 +22383,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentCreateRequest" + "$ref": "#/components/schemas/UpdateStatusPageChangeTimelineRequest" }, "example": { - "agent_name": "deploy-bot", - "instructions": "Use when deployment pipelines need inspection or rollback advice.", - "card_url": "https://agents.example.com/deploy-bot/card", - "auth_type": "bearer", - "streaming": true, - "team_id": 0 + "page_id": 5750613685214, + "change_id": 5821693893131, + "update_id": "01KP0311872NVYFRRQ82FWXAP4", + "description": "Corrected description: root cause identified in database layer.", + "at_seconds": 1712003600 } } } } } }, - "/safari/a2a-agent/list": { + "/status-page/change/update": { "post": { - "operationId": "remote-agent-read-list", - "summary": "List A2A agents", - "description": "List A2A agents visible to the caller across account and team scopes, with pagination.", + "operationId": "statusPageChangeUpdate", + "summary": "Update status page event", + "description": "Update an existing status page event.", "tags": [ - "AI SRE/A2A agents" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Pagination uses `offset`/`limit` (not `p`/`limit`).\n", - "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Events Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-change-update", "metadata": { - "sidebarTitle": "List A2A agents" + "sidebarTitle": "Update status page event" } }, "responses": { @@ -21802,13 +22420,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/A2AAgentListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -21816,34 +22434,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "agent_name": "deploy-bot", - "card_url": "https://agents.example.com/deploy-bot/card", - "auth_type": "bearer", - "streaming": true, - "status": "enabled", - "agent_card_name": "Deploy Bot", - "agent_card_skills": [ - "rollback", - "diff" - ], - "card_resolve_timeout": 10, - "task_timeout": 120, - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "instructions": "Remote agent that inspects deployment pipelines." - } - ], - "total": 1 - } + "data": {} } } } @@ -21866,36 +22457,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentListRequest" + "$ref": "#/components/schemas/UpdateStatusPageChangeRequest" }, "example": { - "offset": 0, - "limit": 20, - "include_account": true + "page_id": 5750613685214, + "change_id": 5821693893131, + "title": "Web Console Degraded Performance (Updated)" } } } } } }, - "/safari/a2a-agent/get": { + "/status-page/component/delete": { "post": { - "operationId": "remote-agent-read-get", - "summary": "Get A2A agent detail", - "description": "Get one A2A agent by ID.", + "operationId": "statusPageComponentDelete", + "summary": "Delete status page component", + "description": "Delete a service component from a status page.", "tags": [ - "AI SRE/A2A agents" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", - "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-read-get", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-component-delete", "metadata": { - "sidebarTitle": "Get A2A agent detail" + "sidebarTitle": "Delete status page component" } }, "responses": { @@ -21906,13 +22492,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/A2AAgentItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -21920,29 +22506,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "agent_name": "deploy-bot", - "card_url": "https://agents.example.com/deploy-bot/card", - "auth_type": "bearer", - "streaming": true, - "status": "enabled", - "agent_card_name": "Deploy Bot", - "agent_card_skills": [ - "rollback", - "diff" - ], - "card_resolve_timeout": 10, - "task_timeout": 120, - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "instructions": "Remote agent that inspects deployment pipelines." - } + "data": {} } } } @@ -21965,34 +22529,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" + "$ref": "#/components/schemas/DeleteStatusPageComponentRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "page_id": 5750613685214, + "component_ids": [ + "01KP032KMN9YFBMPWANJMFZFG1" + ] } } } } } }, - "/safari/a2a-agent/update": { + "/status-page/component/upsert": { "post": { - "operationId": "remote-agent-write-update", - "summary": "Update A2A agent", - "description": "Apply a partial update to an A2A agent. Omit a field to leave it unchanged.", + "operationId": "statusPageComponentUpsert", + "summary": "Upsert status page component", + "description": "Create or update a service component on a status page.", "tags": [ - "AI SRE/A2A agents" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-component-upsert", "metadata": { - "sidebarTitle": "Update A2A agent" + "sidebarTitle": "Upsert status page component" } }, "responses": { @@ -22003,14 +22565,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/UpsertStatusPageComponentResponse" } } } @@ -22018,7 +22579,11 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "component_ids": [ + "01KP032KMN9YFBMPWANJMFZFG1" + ] + } } } } @@ -22029,9 +22594,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -22044,35 +22606,37 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentUpdateRequest" + "$ref": "#/components/schemas/UpsertStatusPageComponentRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", - "instructions": "Inspect deployment pipelines and propose rollback steps." + "page_id": 5750613685214, + "components": [ + { + "name": "Web Console", + "description": "Main web interface", + "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", + "order_id": 1 + } + ] } } } } } }, - "/safari/a2a-agent/enable": { + "/status-page/create": { "post": { - "operationId": "remote-agent-write-enable", - "summary": "Enable A2A agent", - "description": "Enable a disabled A2A agent.", + "operationId": "statusPageCreate", + "summary": "Create status page", + "description": "Create a new status page.", "tags": [ - "AI SRE/A2A agents" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-enable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-create", "metadata": { - "sidebarTitle": "Enable A2A agent" + "sidebarTitle": "Create status page" } }, "responses": { @@ -22083,14 +22647,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -22098,7 +22661,11 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "page_id": 6294565612043, + "page_name": "My Status Page", + "page_url_name": "my-status-page" + } } } } @@ -22109,9 +22676,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -22124,34 +22688,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" + "$ref": "#/components/schemas/EmptyRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "name": "My Status Page", + "url_name": "my-status-page", + "type": "public", + "page_header": "Welcome to our status page", + "contact_info": "mailto:support@example.com" } } } } } }, - "/safari/a2a-agent/disable": { + "/status-page/delete": { "post": { - "operationId": "remote-agent-write-disable", - "summary": "Disable A2A agent", - "description": "Disable an enabled A2A agent.", + "operationId": "statusPageDelete", + "summary": "Delete status page", + "description": "Delete a status page.", "tags": [ - "AI SRE/A2A agents" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-disable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-delete", "metadata": { - "sidebarTitle": "Disable A2A agent" + "sidebarTitle": "Delete status page" } }, "responses": { @@ -22162,14 +22725,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -22177,7 +22739,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": {} } } } @@ -22188,9 +22750,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -22203,34 +22762,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" + "$ref": "#/components/schemas/EmptyRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "page_id": 5750613685214 } } } } } }, - "/safari/a2a-agent/delete": { - "post": { - "operationId": "remote-agent-write-delete", - "summary": "Delete A2A agent", - "description": "Soft-delete an A2A agent by ID.", + "/status-page/info": { + "get": { + "operationId": "statusPageInfo", + "summary": "Get status page detail", + "description": "Retrieve detailed configuration for a specific status page.", "tags": [ - "AI SRE/A2A agents" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/status-pages/status-page-info", "metadata": { - "sidebarTitle": "Delete A2A agent" + "sidebarTitle": "Get status page detail" } }, "responses": { @@ -22241,22 +22795,64 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/EmptyResponse" } } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "page_id": 5750613685214, + "name": "Flashduty Status Page", + "url_name": "flashduty-statuspage", + "type": "public", + "custom_domain": "status.example.com", + "logo": "https://cdn.example.com/logo.png", + "favicon": "https://cdn.example.com/favicon.png", + "page_header": "Welcome to our status page", + "page_footer": "2025 Example Corp", + "date_view": "list", + "display_uptime_mode": "chart_and_percentage", + "custom_links": [ + { + "key": "Documentation", + "value": "https://docs.example.com" + } + ], + "contact_info": "mailto:support@example.com", + "components": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", + "name": "Web Console", + "available_since_seconds": 1765349358, + "order_id": 1 + } + ], + "sections": [ + { + "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", + "name": "Core Services", + "description": "Our core services", + "order_id": 1, + "hide_uptime": false, + "hide_all": false + } + ], + "subscription": { + "email": true, + "im": false + }, + "template_preference": "message" + } } } } @@ -22267,9 +22863,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -22277,39 +22870,32 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" - }, - "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" - } - } + "parameters": [ + { + "name": "page_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + }, + "description": "Status page ID" } - } + ] } }, - "/safari/session/list": { - "post": { - "operationId": "session-read-list", - "summary": "List sessions", - "description": "List agent sessions visible to the caller, filtered by app, surface, archive status, and team.", + "/status-page/list": { + "get": { + "operationId": "status-page-read-page-list", + "summary": "List status pages", + "description": "List all status pages owned by the account, including their components and sections.", "tags": [ - "AI SRE/Sessions" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Pagination uses `p`/`limit` (max 100); `scope` defaults to `all` (own + member-of-team rows).\n- `is_running` reflects the live run-set; `has_unread` is computed per calling user.\n", - "href": "/en/api-reference/ai-sre/sessions/session-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", + "href": "/en/api-reference/on-call/status-pages/status-page-read-page-list", "metadata": { - "sidebarTitle": "List sessions" + "sidebarTitle": "List status pages" } }, "responses": { @@ -22320,13 +22906,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SessionListResponse" + "$ref": "#/components/schemas/ListStatusPageResponse" } } } @@ -22335,34 +22921,49 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 988, - "sessions": [ + "items": [ { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "session_name": "Investigate cloud-assistant first heartbeat", - "app_name": "ai-sre", - "entry_kind": "web", - "person_id": "3790925372131", - "team_id": 0, - "is_mine": false, - "can_manage": true, - "status": "enabled", - "incognito": false, - "created_at": 1780367971228, - "updated_at": 1780367993457, - "token_usage": { - "input_tokens": 14948, - "cached_tokens": 11520, - "output_tokens": 888, - "reasoning_tokens": 351 - }, - "current_context_tokens": 14948, - "context_window": 0, - "archived_at": 0, - "pinned_at": 0, - "last_event_at": 1780367992649, - "is_running": false, - "has_unread": true + "page_id": 7001, + "name": "Acme Status", + "url_name": "acme", + "type": "public", + "custom_domain": "status.acme.com", + "logo_url": "https://acme.com", + "page_header": "Acme System Status", + "date_view": "calendar", + "display_uptime_mode": "chart_and_percentage", + "custom_links": [ + { + "name": "Home", + "url": "https://acme.com" + } + ], + "contact_info": "mailto:support@acme.com", + "components": [ + { + "component_id": "cmp_001", + "section_id": "sec_001", + "name": "API", + "description": "Core API service", + "available_since_seconds": 1716962400, + "order_id": 1, + "hide_uptime": false, + "hide_all": false + } + ], + "sections": [ + { + "section_id": "sec_001", + "name": "Core Services", + "order_id": 1, + "hide_uptime": false, + "hide_all": false + } + ], + "subscription": { + "email": true, + "im": false + } } ] } @@ -22382,43 +22983,22 @@ "500": { "$ref": "#/components/responses/ServerError" } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SessionListRequest" - }, - "example": { - "app_name": "ai-sre", - "limit": 2, - "orderby": "updated_at", - "scope": "all" - } - } - } } } }, - "/safari/session/get": { + "/status-page/migrate-email-subscribers": { "post": { - "operationId": "session-read-info", - "summary": "Get session detail", - "description": "Fetch one session plus a backward-paged window of its most recent events.", + "operationId": "statusPageMigrateEmailSubscribers", + "summary": "Migrate email subscribers", + "description": "Start a migration job that imports email subscribers from an Atlassian Statuspage into an existing Flashduty status page.", "tags": [ - "AI SRE/Sessions" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Page older history with `search_after_ctx` from the previous response.\n- `limit` (or legacy `num_recent_events`) caps the event page; default 100, max 1000.\n", - "href": "/en/api-reference/ai-sre/sessions/session-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-migrate-email-subscribers", "metadata": { - "sidebarTitle": "Get session detail" + "sidebarTitle": "Migrate email subscribers" } }, "responses": { @@ -22429,13 +23009,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SessionGetResponse" + "$ref": "#/components/schemas/StatusPageMigrationStartResponse" } } } @@ -22444,62 +23024,7 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "session": { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "session_name": "Investigate cloud-assistant first heartbeat", - "app_name": "ai-sre", - "entry_kind": "web", - "person_id": "3790925372131", - "team_id": 0, - "is_mine": false, - "can_manage": true, - "status": "enabled", - "incognito": false, - "created_at": 1780367971228, - "updated_at": 1780367993457, - "token_usage": { - "input_tokens": 14948, - "cached_tokens": 11520, - "output_tokens": 888, - "reasoning_tokens": 351 - }, - "current_context_tokens": 14948, - "context_window": 0, - "archived_at": 0, - "pinned_at": 0, - "last_event_at": 1780367992649, - "is_running": false, - "has_unread": true - }, - "events": [ - { - "event_id": "evt_3aZQ9p", - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "author": "user", - "partial": false, - "turn_complete": false, - "status": "normal", - "created_at": 1780367971241 - }, - { - "event_id": "evt_7bWk2r", - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "author": "ai-sre", - "content": { - "role": "model", - "parts": [ - { - "text": "..." - } - ] - }, - "partial": false, - "turn_complete": true, - "status": "normal", - "created_at": 1780367992649 - } - ], - "has_more_older": false + "job_id": "01KP0311872NVYFRRQ82FW0002" } } } @@ -22523,45 +23048,58 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SessionGetRequest" + "$ref": "#/components/schemas/MigrateStatusPageEmailSubscribersRequest" }, "example": { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "num_recent_events": 50 + "api_key": "sk-stsp-xxxxxxxxxxxxxxxxxxxx", + "source_page_id": "abcdefghij", + "target_page_id": 5750613685214 } } } } } }, - "/safari/session/export": { + "/status-page/migrate-structure": { "post": { - "operationId": "session-read-export", - "summary": "Export session transcript", - "description": "Stream a session's full event transcript as newline-delimited JSON.", + "operationId": "statusPageMigrateStructure", + "summary": "Migrate status page structure", + "description": "Start a migration job that imports the structure and historical events of an Atlassian Statuspage into a new Flashduty status page.", "tags": [ - "AI SRE/Sessions" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The response is `application/x-ndjson` — parse line-by-line and write to a file; do not buffer the whole body in memory.\n- The first line is always a `session_meta` envelope; `include_subagents=true` inlines each child session's stream after its dispatch line.\n", - "href": "/en/api-reference/ai-sre/sessions/session-read-export", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-migrate-structure", "metadata": { - "sidebarTitle": "Export session transcript" + "sidebarTitle": "Migrate status page structure" } }, "responses": { "200": { - "description": "Streaming NDJSON (application/x-ndjson). One JSON object per line, terminated by a newline. The first line is always a `session_meta` envelope; subsequent lines are session events.", + "description": "Success", "content": { - "application/x-ndjson": { + "application/json": { "schema": { - "type": "string", - "description": "Newline-delimited JSON stream. Parse line-by-line; do not buffer the whole body." + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/StatusPageMigrationStartResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "job_id": "01KP0311872NVYFRRQ82FW0001" + } } } } @@ -22584,35 +23122,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SessionExportRequest" + "$ref": "#/components/schemas/MigrateStatusPageStructureRequest" }, "example": { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "include_subagents": false + "api_key": "sk-stsp-xxxxxxxxxxxxxxxxxxxx", + "source_page_id": "abcdefghij" } } } } } }, - "/safari/session/delete": { + "/status-page/migration/cancel": { "post": { - "operationId": "session-write-delete", - "summary": "Delete session", - "description": "Delete a session by ID.", + "operationId": "statusPageMigrationCancel", + "summary": "Cancel status page migration", + "description": "Cancel an in-progress status page migration job. Only jobs currently in the `running` state can be cancelled.", "tags": [ - "AI SRE/Sessions" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Requires manage rights on the session (creator, account admin, or owning-team member).\n", - "href": "/en/api-reference/ai-sre/sessions/session-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-migration-cancel", "metadata": { - "sidebarTitle": "Delete session" + "sidebarTitle": "Cancel status page migration" } }, "responses": { @@ -22623,14 +23156,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -22638,7 +23170,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": {} } } } @@ -22661,29 +23193,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SessionDeleteRequest" + "$ref": "#/components/schemas/CancelStatusPageMigrationRequest" }, "example": { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u" + "job_id": "01KP0311872NVYFRRQ82FW0001" } } } } } }, - "/datasource/im/person/try-link": { - "post": { - "operationId": "datasourceImPersonTryLink", - "summary": "Attempt IM person linking", - "description": "Try to automatically link unbound members to their IM accounts for one integration.", + "/status-page/migration/status": { + "get": { + "operationId": "statusPageMigrationStatus", + "summary": "Get migration status", + "description": "Get the current status and progress of a status page migration job.", "tags": [ - "On-call/Integrations" + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Manage** (`on-call`) |\n\n## Usage\n\n- The server uses member email and phone values to find matching users in DingTalk, Feishu, or WeCom.\n- If no member can be linked, the response contains an empty `new_linked_person_ids` array.", - "href": "/en/api-reference/on-call/integrations/datasource-im-person-try-link", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/status-pages/status-page-migration-status", "metadata": { - "sidebarTitle": "Attempt IM person linking" + "sidebarTitle": "Get migration status" } }, "responses": { @@ -22700,7 +23232,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TryLinkPersonResponse" + "$ref": "#/components/schemas/StatusPageMigrationJob" } } } @@ -22709,9 +23241,25 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "new_linked_person_ids": [ - 5348648172131 - ] + "job_id": "01KP0311872NVYFRRQ82FW0001", + "account_id": 2451002751131, + "source_page_id": "abcdefghij", + "target_page_id": 5750613685214, + "phase": "history", + "status": "completed", + "progress": { + "total_steps": 5, + "completed_steps": 5, + "components_imported": 8, + "sections_imported": 3, + "incidents_imported": 12, + "maintenances_imported": 2, + "subscribers_imported": 0, + "templates_imported": 0, + "subscribers_skipped": 0 + }, + "created_at": 1766736878, + "updated_at": 1766740000 } } } @@ -22730,34 +23278,32 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TryLinkPersonRequest" - }, - "example": { - "integration_id": 6113996590131 - } - } + "parameters": [ + { + "name": "job_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + }, + "description": "Migration job ID returned by `migrate-structure` or `migrate-email-subscribers`." } - } + ] } }, - "/incident/post-mortem/init": { + "/status-page/section/delete": { "post": { - "operationId": "postmortem-write-init", - "summary": "Initialize post-mortem", - "description": "Create a post-mortem draft from one or more incidents and a template.", + "operationId": "statusPageSectionDelete", + "summary": "Delete status page section", + "description": "Delete a section from a status page.", "tags": [ - "On-call/Incidents" + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Links at most 10 incidents to one post-mortem report.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/incidents/postmortem-write-init", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-section-delete", "metadata": { - "sidebarTitle": "Initialize post-mortem" + "sidebarTitle": "Delete status page section" } }, "responses": { @@ -22774,7 +23320,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PostMortemItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -22782,45 +23328,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "meta": { - "account_id": 2451002751131, - "title": "Postmortem1", - "status": "published", - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", - "template_id": "post_mortem_default_tmpl_en-us", - "incident_ids": [ - "69bb9233331067560c718ecd" - ], - "media_count": 0, - "author_ids": [ - 2477273692131 - ], - "team_id": 2477033058131, - "channel_id": 3047621227131, - "is_private": false, - "channel_name": "Ops Channel", - "created_at_seconds": 1773900354, - "updated_at_seconds": 1773909012 - }, - "basics": { - "incidents_highest_severity": "Warning", - "incidents_earliest_start_seconds": 1761133512, - "incidents_latest_close_seconds": 1761133632, - "incidents_total_duration_seconds": 120, - "responders": [ - { - "person_id": 3790925372131, - "assigned_at": 1761133515, - "acknowledged_at": 0 - } - ] - }, - "content": { - "content": "{\"type\":\"doc\",\"content\":[]}" - }, - "follow_ups": "" - } + "data": {} } } } @@ -22843,32 +23351,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InitPostMortemRequest" + "$ref": "#/components/schemas/DeleteStatusPageSectionRequest" }, "example": { - "incident_ids": [ - "69bb9233331067560c718ecd" - ], - "template_id": "post_mortem_default_tmpl_en-us" + "page_id": 5750613685214, + "section_ids": [ + "01KP032J1FV2H8DDGN0QSJ1CAR" + ] } } } } } }, - "/incident/post-mortem/basics/reset": { + "/status-page/section/upsert": { "post": { - "operationId": "postmortem-write-reset-basics", - "summary": "Update post-mortem basics", - "description": "Replace the incident facts stored in a post-mortem report.", + "operationId": "statusPageSectionUpsert", + "summary": "Upsert status page section", + "description": "Create or update a section on a status page.", "tags": [ - "On-call/Incidents" + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/incidents/postmortem-write-reset-basics", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-section-upsert", "metadata": { - "sidebarTitle": "Update post-mortem basics" + "sidebarTitle": "Upsert status page section" } }, "responses": { @@ -22885,7 +23393,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/UpsertStatusPageSectionResponse" } } } @@ -22893,7 +23401,11 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "section_ids": [ + "01KP032J1FV2H8DDGN0QSJ1CAR" + ] + } } } } @@ -22916,16 +23428,16 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResetPostMortemBasicsRequest" + "$ref": "#/components/schemas/UpsertStatusPageSectionRequest" }, "example": { - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", - "incidents_highest_severity": "Warning", - "incidents_earliest_start_seconds": 1761133512, - "incidents_latest_close_seconds": 1761133632, - "incidents_total_duration_seconds": 120, - "responder_ids": [ - 3790925372131 + "page_id": 5750613685214, + "sections": [ + { + "name": "Core Services", + "description": "Our core services", + "order_id": 1 + } ] } } @@ -22933,19 +23445,19 @@ } } }, - "/incident/post-mortem/status/reset": { + "/status-page/subscriber/export": { "post": { - "operationId": "postmortem-write-reset-status", - "summary": "Update post-mortem status", - "description": "Set a post-mortem report to drafting or published.", + "operationId": "statusPageSubscriberExport", + "summary": "Export subscribers", + "description": "Export subscribers list for a status page as a CSV attachment. The response is a `text/csv` file with columns: Method, Recipient, Components, Subscribe All, Locale.", "tags": [ - "On-call/Incidents" + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/incidents/postmortem-write-reset-status", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **10 requests/minute**; **1 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-subscriber-export", "metadata": { - "sidebarTitle": "Update post-mortem status" + "sidebarTitle": "Export subscribers" } }, "responses": { @@ -22962,7 +23474,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/StatusPageSubscriberExportResponse" } } } @@ -22970,7 +23482,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": "Method,Recipient,Components,Subscribe All,Locale\nemail,alice@example.com,,true,zh-CN\nemail,bob@example.com,,true,en-US" } } } @@ -22993,30 +23505,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResetPostMortemStatusRequest" + "$ref": "#/components/schemas/ExportStatusPageSubscribersRequest" }, "example": { - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", - "status": "published" + "page_id": 5750613685214 } } } } } }, - "/incident/post-mortem/title/reset": { + "/status-page/subscriber/import": { "post": { - "operationId": "postmortem-write-reset-title", - "summary": "Update post-mortem title", - "description": "Replace the title of a post-mortem report.", + "operationId": "statusPageSubscriberImport", + "summary": "Import subscribers", + "description": "Bulk import subscribers for a status page.", "tags": [ - "On-call/Incidents" + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/incidents/postmortem-write-reset-title", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **20 requests/minute**; **2 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-subscriber-import", "metadata": { - "sidebarTitle": "Update post-mortem title" + "sidebarTitle": "Import subscribers" } }, "responses": { @@ -23064,30 +23575,45 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResetPostMortemTitleRequest" + "$ref": "#/components/schemas/ImportStatusPageSubscribersRequest" }, "example": { - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", - "title": "Production API latency incident" + "page_id": 5750613685214, + "method": "email", + "subscribers": [ + { + "recipient": "alice@example.com", + "all": true, + "locale": "en-US" + }, + { + "recipient": "bob@example.com", + "component_ids": [ + "01KC3GAZ6ZJE40H55GM31RPWZE" + ], + "all": false, + "locale": "zh-CN" + } + ] } } } } } }, - "/incident/post-mortem/follow-ups/reset": { - "post": { - "operationId": "postmortem-write-reset-follow-ups", - "summary": "Update post-mortem follow-ups", - "description": "Replace the follow-up action items on a post-mortem report.", + "/status-page/subscriber/list": { + "get": { + "operationId": "statusPageSubscriberList", + "summary": "List status page subscribers", + "description": "List subscribers who have signed up for status page notifications.", "tags": [ - "On-call/Incidents" + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/incidents/postmortem-write-reset-follow-ups", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/status-pages/status-page-subscriber-list", "metadata": { - "sidebarTitle": "Update post-mortem follow-ups" + "sidebarTitle": "List status page subscribers" } }, "responses": { @@ -23104,7 +23630,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/StatusPageSubscriberListResponse" } } } @@ -23112,7 +23638,26 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "total": 2, + "has_next_page": false, + "items": [ + { + "recipient": "alice@example.com", + "method": "email", + "components": [], + "all": true, + "locale": "zh-CN" + }, + { + "recipient": "bob@example.com", + "method": "email", + "components": [], + "all": true, + "locale": "en-US" + } + ] + } } } } @@ -23130,35 +23675,67 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResetPostMortemFollowUpsRequest" - }, - "example": { - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", - "follow_ups": "- Add database saturation alert\n- Review cache TTL rollout" - } - } + "parameters": [ + { + "name": "page_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Status page ID." + }, + { + "name": "component_ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "description": "Comma-separated component IDs to filter subscribers by." + }, + { + "name": "p", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "default": 1 + }, + "description": "Page number (1-based)." + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100, + "default": 10 + }, + "description": "Page size (1-100)." } - } + ] } }, - "/incident/post-mortem/template/upsert": { + "/status-page/template/delete": { "post": { - "operationId": "postmortem-write-upsert-template", - "summary": "Create or update post-mortem template", - "description": "Create a custom post-mortem template or update an existing one.", + "operationId": "statusPageTemplateDelete", + "summary": "Delete status page template", + "description": "Delete an event template from a status page.", "tags": [ - "On-call/Incidents" + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/incidents/postmortem-write-upsert-template", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-template-delete", "metadata": { - "sidebarTitle": "Create or update post-mortem template" + "sidebarTitle": "Delete status page template" } }, "responses": { @@ -23175,7 +23752,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PostMortemTemplate" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -23183,17 +23760,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "account_id": 2451002751131, - "template_id": "post_mortem_default_tmpl_en-us", - "name": "Default post-mortem report", - "description": "Default sections for post-mortem reports.", - "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", - "content_markdown": "## Summary\nDescribe what happened.", - "team_id": 2477033058131, - "created_at_seconds": 1773900000, - "updated_at_seconds": 1773903600 - } + "data": {} } } } @@ -23216,33 +23783,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpsertPostMortemTemplateRequest" + "$ref": "#/components/schemas/DeleteStatusPageTemplateRequest" }, "example": { - "team_id": 2477033058131, - "name": "Production incident template", - "description": "Template for production incident reviews.", - "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", - "content_markdown": "## Summary\nDescribe what happened." + "page_id": 5720156736380, + "type": "pre_defined", + "template_id": "01KP0339G5XDEPM4R86T2B23EP" } } } } } }, - "/incident/post-mortem/template/delete": { - "post": { - "operationId": "postmortem-write-delete-template", - "summary": "Delete post-mortem template", - "description": "Delete a custom post-mortem template.", + "/status-page/template/list": { + "get": { + "operationId": "statusPageTemplateList", + "summary": "List status page templates", + "description": "List all event templates for a status page.", "tags": [ - "On-call/Incidents" + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Manage** (`on-call`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/on-call/incidents/postmortem-write-delete-template", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/on-call/status-pages/status-page-template-list", "metadata": { - "sidebarTitle": "Delete post-mortem template" + "sidebarTitle": "List status page templates" } }, "responses": { @@ -23267,7 +23832,17 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "template_id": "01KC8KP6PHVPSCAB0BTKZBN2HR", + "title": "Service Disruption", + "type": "incident", + "status": "identified", + "description": "We have identified the root cause." + } + ] + } } } } @@ -23285,34 +23860,46 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeletePostMortemTemplateRequest" - }, - "example": { - "template_id": "post_mortem_custom_tmpl_01" - } - } + "parameters": [ + { + "name": "page_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Status page ID." + }, + { + "name": "type", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "pre_defined", + "message" + ] + }, + "description": "Template category. `pre_defined` returns predefined event templates; `message` returns message notification templates." } - } + ] } }, - "/incident/post-mortem/template/list": { + "/status-page/template/upsert": { "post": { - "operationId": "postmortem-read-list-templates", - "summary": "List post-mortem templates", - "description": "Return built-in and custom post-mortem templates for the account.", + "operationId": "statusPageTemplateUpsert", + "summary": "Upsert status page template", + "description": "Create or update an event template for a status page.", "tags": [ - "On-call/Incidents" + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/postmortem-read-list-templates", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-template-upsert", "metadata": { - "sidebarTitle": "List post-mortem templates" + "sidebarTitle": "Upsert status page template" } }, "responses": { @@ -23329,7 +23916,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListPostMortemTemplatesResponse" + "$ref": "#/components/schemas/UpsertStatusPageTemplateResponse" } } } @@ -23338,21 +23925,7 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 2, - "has_next_page": false, - "items": [ - { - "account_id": 2451002751131, - "template_id": "post_mortem_default_tmpl_en-us", - "name": "Default post-mortem report", - "description": "Default sections for post-mortem reports.", - "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", - "content_markdown": "## Summary\nDescribe what happened.", - "team_id": 2477033058131, - "created_at_seconds": 1773900000, - "updated_at_seconds": 1773903600 - } - ] + "template_id": "01KP0339G5XDEPM4R86T2B23EP" } } } @@ -23376,32 +23949,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListPostMortemTemplatesRequest" + "$ref": "#/components/schemas/UpsertStatusPageTemplateRequest" }, "example": { - "p": 1, - "limit": 20, - "order_by": "created_at_seconds", - "asc": false + "page_id": 5720156736380, + "type": "pre_defined", + "template": { + "title": "Service Disruption", + "event_type": "incident", + "status": "investigating", + "description": "We are investigating a service disruption affecting some users." + } } } } } } }, - "/incident/post-mortem/template/info": { - "get": { - "operationId": "postmortem-read-template-info", - "summary": "Get post-mortem template detail", - "description": "Return one post-mortem template by ID.", + "/status-page/update": { + "post": { + "operationId": "statusPageUpdate", + "summary": "Update status page", + "description": "Update an existing status page configuration.", "tags": [ - "On-call/Incidents" + "On-call/Status pages" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", - "href": "/en/api-reference/on-call/incidents/postmortem-read-template-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", + "href": "/en/api-reference/on-call/status-pages/status-page-update", "metadata": { - "sidebarTitle": "Get post-mortem template detail" + "sidebarTitle": "Update status page" } }, "responses": { @@ -23418,7 +23995,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PostMortemTemplate" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -23426,17 +24003,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "account_id": 2451002751131, - "template_id": "post_mortem_default_tmpl_en-us", - "name": "Default post-mortem report", - "description": "Default sections for post-mortem reports.", - "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", - "content_markdown": "## Summary\nDescribe what happened.", - "team_id": 2477033058131, - "created_at_seconds": 1773900000, - "updated_at_seconds": 1773903600 - } + "data": {} } } } @@ -23454,32 +24021,37 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "template_id", - "in": "query", - "required": true, - "schema": { - "type": "string" - }, - "description": "Template ID." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmptyRequest" + }, + "example": { + "page_id": 5750613685214, + "name": "Flashduty Status Page (Updated)", + "page_header": "Updated status page header", + "contact_info": "mailto:support@example.com" + } + } } - ] + } } }, - "/monit/preview/sync": { + "/team/delete": { "post": { - "operationId": "monit-preview-sync", - "summary": "Preview datasource query", - "description": "Execute a synchronous datasource query and return the raw result. Used to preview alert rule expressions before saving.", + "operationId": "team-write-delete", + "summary": "Delete a team", + "description": "Permanently delete a team by ID, name, or external reference ID.", "tags": [ - "Monitors/Monitor utilities" + "Platform/Teams" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **60 requests/minute**; **10 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `ds_type` must match the datasource type (e.g. `prometheus`, `loki`).\n- `ds_name` is the display name of the datasource as configured in the account.\n- `delay_seconds` shifts the query window backward by the specified number of seconds, useful for accommodating data ingestion latency.\n- The response body is the raw JSON returned by the datasource — its schema varies by datasource type.", - "href": "/en/api-reference/monitors/monitor-utilities/monit-preview-sync", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Teams Manage** (`organization`) |\n\n## Usage\n\n- At least one of `team_id`, `team_name`, or `ref_id` must be provided.\n- Fails with `400 ReferenceExist` if the team is still referenced by schedules, escalation rules, or other resources.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/platform/teams/team-write-delete", "metadata": { - "sidebarTitle": "Preview datasource query" + "sidebarTitle": "Delete a team" } }, "responses": { @@ -23496,7 +24068,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PreviewSyncResponse" + "$ref": "#/components/schemas/PlatformEmptyObject" } } } @@ -23504,13 +24076,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "status": "success", - "data": { - "resultType": "vector", - "result": [] - } - } + "data": {} } } } @@ -23521,6 +24087,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -23533,32 +24102,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PreviewSyncRequest" + "$ref": "#/components/schemas/TeamDeleteRequest" }, "example": { - "ds_type": "prometheus", - "ds_name": "Prometheus Prod", - "expr": "rate(http_requests_total[5m])", - "delay_seconds": 0 + "team_id": 1001 } } } } } }, - "/rum/application/webhook/test": { + "/team/info": { "post": { - "operationId": "rum-application-webhook-test", - "summary": "Test application webhook", - "description": "Send a sample RUM alert event to verify an application's webhook URL.", + "operationId": "team-read-info", + "summary": "Get team detail", + "description": "Return a single team by ID, name, or external reference ID.", "tags": [ - "RUM/Applications" + "Platform/Teams" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- The endpoint validates the URL before sending the sample event.\n- A failed delivery still returns HTTP 200 with `ok=false` and the delivery error in `message`.", - "href": "/en/api-reference/rum/applications/rum-application-webhook-test", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- At least one of `team_id`, `team_name`, or `ref_id` must be provided.", + "href": "/en/api-reference/platform/teams/team-read-info", "metadata": { - "sidebarTitle": "Test application webhook" + "sidebarTitle": "Get team detail" } }, "responses": { @@ -23575,7 +24141,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumWebhookTestResponse" + "$ref": "#/components/schemas/TeamItem" } } } @@ -23584,9 +24150,22 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "ok": true, - "status_code": 200, - "message": "ok" + "account_id": 10023, + "team_id": 1001, + "team_name": "Backend SRE", + "description": "Backend reliability engineering team", + "status": "enabled", + "updated_by_name": "alice", + "updated_by": 80011, + "creator_id": 80011, + "creator_name": "alice", + "created_at": 1710000000, + "updated_at": 1712000000, + "person_ids": [ + 80011, + 80012 + ], + "ref_id": "" } } } @@ -23610,30 +24189,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumWebhookTestRequest" + "$ref": "#/components/schemas/TeamInfoRequest" }, "example": { - "application_id": "rum-app-prod", - "webhook_url": "https://hooks.example.com/rum-alerts" + "team_id": 1001 } } } } } }, - "/status-page/info": { - "get": { - "operationId": "statusPageInfo", - "summary": "Get status page detail", - "description": "Retrieve detailed configuration for a specific status page.", + "/team/infos": { + "post": { + "operationId": "team-read-infos", + "summary": "Batch get teams", + "description": "Return basic info for multiple teams by their IDs in a single request.", "tags": [ - "On-call/Status pages" + "Platform/Teams" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/status-pages/status-page-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Up to 100 team IDs per request.", + "href": "/en/api-reference/platform/teams/team-read-infos", "metadata": { - "sidebarTitle": "Get status page detail" + "sidebarTitle": "Batch get teams" } }, "responses": { @@ -23650,7 +24228,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/TeamInfosResponse" } } } @@ -23659,48 +24237,23 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "page_id": 5750613685214, - "name": "Flashduty Status Page", - "url_name": "flashduty-statuspage", - "type": "public", - "custom_domain": "status.example.com", - "logo": "https://cdn.example.com/logo.png", - "favicon": "https://cdn.example.com/favicon.png", - "page_header": "Welcome to our status page", - "page_footer": "2025 Example Corp", - "date_view": "list", - "display_uptime_mode": "chart_and_percentage", - "custom_links": [ - { - "key": "Documentation", - "value": "https://docs.example.com" - } - ], - "contact_info": "mailto:support@example.com", - "components": [ + "items": [ { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", - "name": "Web Console", - "available_since_seconds": 1765349358, - "order_id": 1 - } - ], - "sections": [ + "team_id": 1001, + "team_name": "Backend SRE", + "person_ids": [ + 80011, + 80012 + ] + }, { - "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", - "name": "Core Services", - "description": "Our core services", - "order_id": 1, - "hide_uptime": false, - "hide_all": false + "team_id": 1002, + "team_name": "Frontend", + "person_ids": [ + 80013 + ] } - ], - "subscription": { - "email": true, - "im": false - }, - "template_preference": "message" + ] } } } @@ -23719,32 +24272,37 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "page_id", - "in": "query", - "required": true, - "schema": { - "type": "string" - }, - "description": "Status page ID" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TeamInfosRequest" + }, + "example": { + "team_ids": [ + 1001, + 1002 + ] + } + } } - ] + } } }, - "/status-page/create": { + "/team/list": { "post": { - "operationId": "statusPageCreate", - "summary": "Create status page", - "description": "Create a new status page.", + "operationId": "team-read-list", + "summary": "List teams", + "description": "Return a paginated list of teams in the current account.", "tags": [ - "On-call/Status pages" + "Platform/Teams" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Filter by `person_id` to return teams that a specific person belongs to.\n- Defaults: p=1, limit=20.", + "href": "/en/api-reference/platform/teams/team-read-list", "metadata": { - "sidebarTitle": "Create status page" + "sidebarTitle": "List teams" } }, "responses": { @@ -23761,7 +24319,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/TeamListResponse" } } } @@ -23770,9 +24328,28 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "page_id": 6294565612043, - "page_name": "My Status Page", - "page_url_name": "my-status-page" + "p": 1, + "limit": 20, + "total": 5, + "items": [ + { + "account_id": 10023, + "team_id": 1001, + "team_name": "Backend SRE", + "status": "enabled", + "creator_id": 80011, + "created_at": 1710000000, + "updated_at": 1712000000, + "person_ids": [ + 80011 + ], + "description": "", + "updated_by_name": "", + "updated_by": 0, + "creator_name": "alice", + "ref_id": "" + } + ] } } } @@ -23796,33 +24373,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmptyRequest" + "$ref": "#/components/schemas/TeamListRequest" }, "example": { - "name": "My Status Page", - "url_name": "my-status-page", - "type": "public", - "page_header": "Welcome to our status page", - "contact_info": "mailto:support@example.com" + "p": 1, + "limit": 20, + "orderby": "created_at", + "asc": false } } } } } }, - "/status-page/update": { + "/team/upsert": { "post": { - "operationId": "statusPageUpdate", - "summary": "Update status page", - "description": "Update an existing status page configuration.", + "operationId": "team-write-upsert", + "summary": "Create or update a team", + "description": "Create a new team or update an existing one. Pass `team_id` to update.", "tags": [ - "On-call/Status pages" + "Platform/Teams" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Teams Manage** (`organization`) |\n\n## Usage\n\n- Omit `team_id` (or set to 0) to create a new team; pass an existing ID to update.\n- `team_name` must be 1–39 characters and unique within the account.\n- Pass `person_ids` to set team membership; this replaces the entire member list.\n- Pass `emails` or `phones` to invite members who don't yet have accounts.\n- `ref_id` is an external identifier for integration with third-party HR systems.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/platform/teams/team-write-upsert", "metadata": { - "sidebarTitle": "Update status page" + "sidebarTitle": "Create or update a team" } }, "responses": { @@ -23839,7 +24415,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/TeamUpsertResponse" } } } @@ -23847,7 +24423,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "team_id": 1001, + "team_name": "Backend SRE" + } } } } @@ -23858,6 +24437,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -23870,32 +24452,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmptyRequest" + "$ref": "#/components/schemas/TeamUpsertRequest" }, "example": { - "page_id": 5750613685214, - "name": "Flashduty Status Page (Updated)", - "page_header": "Updated status page header", - "contact_info": "mailto:support@example.com" + "team_name": "Backend SRE", + "description": "Backend reliability engineering team", + "person_ids": [ + 80011, + 80012 + ] } } } } } }, - "/status-page/delete": { + "/template/create": { "post": { - "operationId": "statusPageDelete", - "summary": "Delete status page", - "description": "Delete a status page.", + "operationId": "template-write-create", + "summary": "Create a template", + "description": "Create a new notification template.", "tags": [ - "On-call/Status pages" + "On-call/Notification templates" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Templates Manage** (`on-call`) |\n\n## Usage\n\n- `template_name` must be unique within the account; duplicates return `InvalidParameter`.\n- The server validates every non-empty channel template by rendering it against a mock incident — a syntactic error in any channel fails the whole request with `InvalidParameter`.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/notification-templates/template-write-create", "metadata": { - "sidebarTitle": "Delete status page" + "sidebarTitle": "Create a template" } }, "responses": { @@ -23912,7 +24496,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/TemplateCreateResponse" } } } @@ -23920,7 +24504,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "template_id": "6605a1b2c3d4e5f6a7b8c9d0", + "template_name": "Prod incident default" + } } } } @@ -23943,29 +24530,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmptyRequest" + "$ref": "#/components/schemas/TemplateCreateRequest" }, "example": { - "page_id": 5750613685214 + "team_id": 0, + "template_name": "Prod incident default", + "description": "Default template for production incidents.", + "email": "Incident {{ .IncidentName }} on {{ .Severity }}", + "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}" } } } } } }, - "/status-page/component/upsert": { + "/template/delete": { "post": { - "operationId": "statusPageComponentUpsert", - "summary": "Upsert status page component", - "description": "Create or update a service component on a status page.", + "operationId": "template-write-delete", + "summary": "Delete a template", + "description": "Soft-delete a template by ID.", "tags": [ - "On-call/Status pages" + "On-call/Notification templates" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-component-upsert", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Templates Manage** (`on-call`) |\n\n## Usage\n\n- Fails with `400 ReferenceExist` if the template is still referenced by any channel, escalation rule, or notification subscription.\n- Deletion is soft — `deleted_at` is set. The record remains for audit, but the template stops appearing in listings.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/notification-templates/template-write-delete", "metadata": { - "sidebarTitle": "Upsert status page component" + "sidebarTitle": "Delete a template" } }, "responses": { @@ -23982,7 +24573,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/UpsertStatusPageComponentResponse" + "$ref": "#/components/schemas/EmptyObject" } } } @@ -23990,11 +24581,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "component_ids": [ - "01KP032KMN9YFBMPWANJMFZFG1" - ] - } + "data": {} } } } @@ -24005,6 +24592,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -24017,37 +24607,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpsertStatusPageComponentRequest" + "$ref": "#/components/schemas/TemplateIDRequest" }, "example": { - "page_id": 5750613685214, - "components": [ - { - "name": "Web Console", - "description": "Main web interface", - "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", - "order_id": 1 - } - ] + "template_id": "6605a1b2c3d4e5f6a7b8c9d0" } } } } } }, - "/status-page/component/delete": { + "/template/info": { "post": { - "operationId": "statusPageComponentDelete", - "summary": "Delete status page component", - "description": "Delete a service component from a status page.", + "operationId": "template-read-info", + "summary": "Get template detail", + "description": "Return a single notification template by ID.", "tags": [ - "On-call/Status pages" + "On-call/Notification templates" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-component-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Templates Read** (`on-call`) |\n\n## Usage\n\n- Pass `000000000000000000000001` as `template_id` to retrieve the built-in preset template for the caller's account locale.", + "href": "/en/api-reference/on-call/notification-templates/template-read-info", "metadata": { - "sidebarTitle": "Delete status page component" + "sidebarTitle": "Get template detail" } }, "responses": { @@ -24064,7 +24646,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/TemplateItem" } } } @@ -24072,7 +24654,32 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "account_id": 10023, + "team_id": 0, + "template_id": "6605a1b2c3d4e5f6a7b8c9d0", + "template_name": "Prod incident default", + "description": "Default template for production incidents.", + "email": "Incident {{ .IncidentName }} on {{ .Severity }}", + "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}", + "voice": "", + "dingtalk": "", + "wecom": "", + "feishu": "", + "feishu_app": "", + "dingtalk_app": "", + "wecom_app": "", + "slack_app": "", + "teams_app": "", + "telegram": "", + "slack": "", + "zoom": "", + "status": "enabled", + "creator_id": 80011, + "updated_by": 80011, + "created_at": 1712700000, + "updated_at": 1712702400 + } } } } @@ -24095,32 +24702,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteStatusPageComponentRequest" + "$ref": "#/components/schemas/TemplateIDRequest" }, "example": { - "page_id": 5750613685214, - "component_ids": [ - "01KP032KMN9YFBMPWANJMFZFG1" - ] + "template_id": "6605a1b2c3d4e5f6a7b8c9d0" } } } } } }, - "/status-page/section/upsert": { + "/template/list": { "post": { - "operationId": "statusPageSectionUpsert", - "summary": "Upsert status page section", - "description": "Create or update a section on a status page.", + "operationId": "template-read-list", + "summary": "List templates", + "description": "Return a paginated list of notification templates.", "tags": [ - "On-call/Status pages" + "On-call/Notification templates" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-section-upsert", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Templates Read** (`on-call`) or **Templates Manage** (`on-call`) |\n\n## Usage\n\n- Pagination defaults to page 1 with 20 rows. The response's `has_next_page` tells you whether another page exists without needing a separate count request.\n- When `is_my_team` is `true`, `team_ids` is ignored.", + "href": "/en/api-reference/on-call/notification-templates/template-read-list", "metadata": { - "sidebarTitle": "Upsert status page section" + "sidebarTitle": "List templates" } }, "responses": { @@ -24137,7 +24741,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/UpsertStatusPageSectionResponse" + "$ref": "#/components/schemas/TemplateListResponse" } } } @@ -24146,8 +24750,35 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "section_ids": [ - "01KP032J1FV2H8DDGN0QSJ1CAR" + "total": 47, + "has_next_page": true, + "items": [ + { + "account_id": 10023, + "team_id": 0, + "template_id": "6605a1b2c3d4e5f6a7b8c9d0", + "template_name": "Prod incident default", + "description": "Default template for production incidents.", + "email": "Incident {{ .IncidentName }} on {{ .Severity }}", + "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}", + "voice": "", + "dingtalk": "", + "wecom": "", + "feishu": "", + "feishu_app": "", + "dingtalk_app": "", + "wecom_app": "", + "slack_app": "", + "teams_app": "", + "telegram": "", + "slack": "", + "zoom": "", + "status": "enabled", + "creator_id": 80011, + "updated_by": 80011, + "created_at": 1712700000, + "updated_at": 1712702400 + } ] } } @@ -24172,36 +24803,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpsertStatusPageSectionRequest" + "$ref": "#/components/schemas/TemplateListRequest" }, "example": { - "page_id": 5750613685214, - "sections": [ - { - "name": "Core Services", - "description": "Our core services", - "order_id": 1 - } - ] + "p": 1, + "limit": 20, + "orderby": "updated_at", + "asc": false, + "is_my_team": false } } } } } }, - "/status-page/section/delete": { + "/template/preview": { "post": { - "operationId": "statusPageSectionDelete", - "summary": "Delete status page section", - "description": "Delete a section from a status page.", + "operationId": "template-read-preview", + "summary": "Preview template", + "description": "Render a notification template against incident data or mock data and return the output.", "tags": [ - "On-call/Status pages" + "On-call/Notification templates" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-section-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **60 requests/minute**; **10 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", + "href": "/en/api-reference/on-call/notification-templates/template-read-preview", "metadata": { - "sidebarTitle": "Delete status page section" + "sidebarTitle": "Preview template" } }, "responses": { @@ -24218,7 +24846,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/PreviewTemplateResponse" } } } @@ -24226,7 +24854,11 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "success": true, + "content": "Incident Database latency spike is Critical", + "message": "" + } } } } @@ -24249,32 +24881,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteStatusPageSectionRequest" + "$ref": "#/components/schemas/PreviewTemplateRequest" }, "example": { - "page_id": 5750613685214, - "section_ids": [ - "01KP032J1FV2H8DDGN0QSJ1CAR" - ] + "content": "Incident {{.Title}} is {{.Status}}", + "type": "feishu_app", + "incident_id": "664a1b2c3d4e5f6a7b8c9d0e" } } } } } }, - "/status-page/template/upsert": { + "/template/update": { "post": { - "operationId": "statusPageTemplateUpsert", - "summary": "Upsert status page template", - "description": "Create or update an event template for a status page.", + "operationId": "template-write-update", + "summary": "Update a template", + "description": "Replace the content of every channel on an existing template.", "tags": [ - "On-call/Status pages" + "On-call/Notification templates" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-template-upsert", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Templates Manage** (`on-call`) |\n\n## Usage\n\n- Every channel field in the request overwrites the stored value — send an empty string to clear a channel.\n- The caller needs data-permission on the template's team; otherwise the response is `AccessDenied`.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/on-call/notification-templates/template-write-update", "metadata": { - "sidebarTitle": "Upsert status page template" + "sidebarTitle": "Update a template" } }, "responses": { @@ -24291,7 +24922,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/UpsertStatusPageTemplateResponse" + "$ref": "#/components/schemas/EmptyObject" } } } @@ -24299,9 +24930,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "template_id": "01KP0339G5XDEPM4R86T2B23EP" - } + "data": {} } } } @@ -24312,6 +24941,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -24324,36 +24956,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpsertStatusPageTemplateRequest" + "$ref": "#/components/schemas/TemplateUpdateRequest" }, "example": { - "page_id": 5720156736380, - "type": "pre_defined", - "template": { - "title": "Service Disruption", - "event_type": "incident", - "status": "investigating", - "description": "We are investigating a service disruption affecting some users." - } + "template_id": "6605a1b2c3d4e5f6a7b8c9d0", + "template_name": "Prod incident default", + "description": "Updated description.", + "email": "Incident {{ .IncidentName }} on {{ .Severity }}", + "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}" } } } } } }, - "/status-page/template/delete": { + "/webhook/history/detail": { "post": { - "operationId": "statusPageTemplateDelete", - "summary": "Delete status page template", - "description": "Delete an event template from a status page.", + "operationId": "webhookHistoryDetail", + "summary": "Get webhook delivery detail", + "description": "Retrieve the detailed payload and response for a specific webhook delivery attempt.", "tags": [ - "On-call/Status pages" + "On-call/Integrations" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Status Pages Manage** (`on-call`) |", - "href": "/en/api-reference/on-call/status-pages/status-page-template-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) |", + "href": "/en/api-reference/on-call/integrations/webhook-history-detail", "metadata": { - "sidebarTitle": "Delete status page template" + "sidebarTitle": "Get webhook delivery detail" } }, "responses": { @@ -24370,7 +24999,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/WebhookHistoryDetail" } } } @@ -24378,7 +25007,26 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "integration_id": 5321026051131, + "event_id": "20260412Xatt9hrXsgmFkBR78WF655", + "webhook_type": "alert", + "event_type": "a_update", + "channel_id": 2551105804131, + "ref_id": "69da3f0ef77b1b51f40e83cc", + "request_headers": "{\"Content-Type\":\"application/json\"}", + "request_body": "{\"event_type\":\"a_update\",\"event_id\":\"d789d65951c0532ea9b6a1d99b707054\"}", + "endpoint": "https://example.com/webhook", + "attempt": 1, + "duration": 132, + "status": "success", + "status_code": 200, + "response_headers": "{\"Content-Type\":\"application/json\"}", + "response_body": "{\"ok\":true}", + "event_time": "2026-04-12T13:31:11.357472+08:00", + "ref_title": "High CPU Usage on host-01", + "channel_name": "Production Alerts" + } } } } @@ -24401,31 +25049,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteStatusPageTemplateRequest" + "$ref": "#/components/schemas/GetWebhookHistoryDetailRequest" }, "example": { - "page_id": 5720156736380, - "type": "pre_defined", - "template_id": "01KP0339G5XDEPM4R86T2B23EP" + "event_id": "20260412Xatt9hrXsgmFkBR78WF655", + "integration_id": 6113996590131 } } } } } }, - "/status-page/template/list": { - "get": { - "operationId": "statusPageTemplateList", - "summary": "List status page templates", - "description": "List all event templates for a status page.", + "/webhook/history/list": { + "post": { + "operationId": "webhookHistoryList", + "summary": "List webhook delivery history", + "description": "List the delivery history for outbound webhook notifications.", "tags": [ - "On-call/Status pages" + "On-call/Integrations" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/on-call/status-pages/status-page-template-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Integrations Read** (`on-call`) |", + "href": "/en/api-reference/on-call/integrations/webhook-history-list", "metadata": { - "sidebarTitle": "List status page templates" + "sidebarTitle": "List webhook delivery history" } }, "responses": { @@ -24442,7 +25089,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ListWebhookHistoryResponse" } } } @@ -24453,13 +25100,22 @@ "data": { "items": [ { - "template_id": "01KC8KP6PHVPSCAB0BTKZBN2HR", - "title": "Service Disruption", - "type": "incident", - "status": "identified", - "description": "We have identified the root cause." + "integration_id": 5321026051131, + "event_id": "20260412Xatt9hrXsgmFkBR78WF655", + "webhook_type": "alert", + "event_type": "a_update", + "channel_id": 2551105804131, + "ref_id": "69da3f0ef77b1b51f40e83cc", + "endpoint": "https://example.com/webhook", + "attempt": 1, + "duration": 132, + "status": "success", + "status_code": 200, + "event_time": "2026-04-12T13:31:11.357472+08:00" } - ] + ], + "search_after_ctx": "eyJldmVudF90aW1lIjoiMjAyNi0wNC0xMlQxMzoxNToyNi4zODI1NDcrMDg6MDAiLCJldmVudF9pZCI6IjIwMjYwNDEybUdzeFAzZHJwRmZzNFpDUWQycFNEcCJ9", + "total": 346 } } } @@ -24478,31 +25134,23 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "page_id", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Status page ID." - }, - { - "name": "type", - "in": "query", - "required": true, - "schema": { - "type": "string", - "enum": [ - "pre_defined", - "message" - ] - }, - "description": "Template category. `pre_defined` returns predefined event templates; `message` returns message notification templates." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListWebhookHistoryRequest" + }, + "example": { + "limit": 20, + "start_time": 1775116800000, + "end_time": 1775203200000, + "integration_id": 6113996590131, + "status": "success" + } + } } - ] + } } } }, @@ -44054,6 +44702,624 @@ "description": "ID of the created or updated template." } } + }, + "AutomationRuleCreateRequest": { + "type": "object", + "description": "Configuration for a new AI SRE automation rule.", + "properties": { + "name": { + "type": "string", + "description": "Rule name.", + "minLength": 1, + "maxLength": 255 + }, + "team_id": { + "type": "integer", + "format": "int64", + "description": "Scope owner. Use `0` for a personal rule or a team ID for a team rule.", + "minimum": 0 + }, + "enabled": { + "type": "boolean", + "description": "Whether the rule is enabled immediately after creation." + }, + "cron_expr": { + "type": "string", + "description": "Four-field cron expression in API format: hour, day-of-month, month, day-of-week." + }, + "schedule_trigger_enabled": { + "type": [ + "boolean", + "null" + ], + "description": "Override the schedule trigger state. Omit to keep the default enabled state." + }, + "prompt": { + "type": "string", + "description": "Task prompt executed on every automation run.", + "minLength": 1 + }, + "environment_kind": { + "type": "string", + "description": "Preferred execution environment. Omit to let the backend auto-pick.", + "enum": [ + "cloud", + "byoc" + ] + }, + "environment_id": { + "type": "string", + "description": "Concrete BYOC runner ID when `environment_kind` is `byoc`." + }, + "http_post_trigger_enabled": { + "type": "boolean", + "description": "Whether to provision the HTTP POST trigger alongside the schedule trigger." + } + }, + "required": [ + "name", + "cron_expr", + "prompt" + ] + }, + "AutomationRuleUpdateRequest": { + "type": "object", + "description": "Partial update of an AI SRE automation rule. Omit fields you do not want to change.", + "properties": { + "rule_id": { + "type": "string", + "description": "Target automation rule ID." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "New rule name.", + "maxLength": 255 + }, + "team_id": { + "type": [ + "integer", + "null" + ], + "format": "int64", + "description": "Move the rule to another scope. `0` = personal rule.", + "minimum": 0 + }, + "enabled": { + "type": [ + "boolean", + "null" + ], + "description": "Enable or disable the rule." + }, + "cron_expr": { + "type": [ + "string", + "null" + ], + "description": "Replacement four-field cron expression." + }, + "schedule_trigger_enabled": { + "type": [ + "boolean", + "null" + ], + "description": "Enable or disable the schedule trigger." + }, + "prompt": { + "type": [ + "string", + "null" + ], + "description": "Replacement task prompt." + }, + "environment_kind": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cloud", + "byoc" + ] + }, + { + "type": "null" + } + ], + "description": "Preferred execution environment. Set to `null` or omit to leave unchanged." + }, + "environment_id": { + "type": [ + "string", + "null" + ], + "description": "Replacement BYOC runner ID. Use an empty string to clear the binding when switching away from BYOC." + }, + "http_post_trigger_enabled": { + "type": [ + "boolean", + "null" + ], + "description": "Enable or disable the HTTP POST trigger." + }, + "rotate_http_post_trigger_token": { + "type": "boolean", + "description": "Rotate the HTTP trigger token. The previous token becomes invalid." + } + }, + "required": [ + "rule_id" + ] + }, + "AutomationRuleIDRequest": { + "type": "object", + "description": "Select one automation rule by ID.", + "properties": { + "rule_id": { + "type": "string", + "description": "Automation rule ID." + } + }, + "required": [ + "rule_id" + ] + }, + "AutomationRuleListRequest": { + "type": "object", + "description": "Pagination and visibility filters for listing automation rules.", + "properties": { + "p": { + "type": "integer", + "description": "Page number, 1-based.", + "default": 1, + "minimum": 1 + }, + "limit": { + "type": "integer", + "description": "Page size.", + "default": 20, + "minimum": 1 + }, + "scope": { + "type": "string", + "description": "Visibility bucket.", + "enum": [ + "all", + "personal", + "team" + ] + }, + "team_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "Optional team filter applied after scope resolution." + }, + "include_person": { + "type": [ + "boolean", + "null" + ], + "description": "Legacy scope switch. When `scope` is omitted and this is `false`, only team rules are returned." + }, + "enabled": { + "type": [ + "boolean", + "null" + ], + "description": "Filter by enabled state." + }, + "keyword": { + "type": "string", + "description": "Substring match against the rule name.", + "maxLength": 64 + } + } + }, + "AutomationRuleListResponse": { + "type": "object", + "description": "Page of automation rules visible to the caller.", + "properties": { + "total": { + "type": "integer", + "format": "int64", + "description": "Total matching rules." + }, + "rules": { + "type": "array", + "description": "Current page of rules.", + "items": { + "$ref": "#/components/schemas/AutomationRuleItem" + } + } + }, + "required": [ + "total", + "rules" + ] + }, + "AutomationTemplateListRequest": { + "type": "object", + "description": "Locale override for loading automation templates.", + "properties": { + "locale": { + "type": "string", + "description": "Requested locale such as `zh-CN` or `en-US`.", + "maxLength": 16 + } + } + }, + "AutomationTemplateListResponse": { + "type": "object", + "description": "Preset templates that prefill new automation rules.", + "properties": { + "templates": { + "type": "array", + "description": "Templates available to the caller.", + "items": { + "$ref": "#/components/schemas/AutomationTemplateItem" + } + } + }, + "required": [ + "templates" + ] + }, + "AutomationRunListRequest": { + "type": "object", + "description": "Filters for the run history of one automation rule.", + "properties": { + "rule_id": { + "type": "string", + "description": "Automation rule ID whose run history to query." + }, + "p": { + "type": "integer", + "description": "Page number, 1-based.", + "default": 1, + "minimum": 1 + }, + "limit": { + "type": "integer", + "description": "Page size.", + "default": 20, + "minimum": 1 + }, + "status": { + "type": "string", + "description": "Filter by run status.", + "enum": [ + "queued", + "running", + "retrying", + "succeeded", + "partial", + "failed", + "skipped", + "abandoned" + ] + }, + "trigger_kind": { + "type": "string", + "description": "Filter by trigger source.", + "enum": [ + "schedule", + "debug", + "http_post" + ] + }, + "started_after_ms": { + "type": "integer", + "format": "int64", + "description": "Only include runs whose start time is on or after this Unix timestamp in milliseconds.", + "minimum": 0 + }, + "started_before_ms": { + "type": "integer", + "format": "int64", + "description": "Only include runs whose start time is on or before this Unix timestamp in milliseconds.", + "minimum": 0 + } + }, + "required": [ + "rule_id" + ] + }, + "AutomationRunListResponse": { + "type": "object", + "description": "Page of automation execution history rows.", + "properties": { + "total": { + "type": "integer", + "format": "int64", + "description": "Total matching runs." + }, + "runs": { + "type": "array", + "description": "Current page of runs.", + "items": { + "$ref": "#/components/schemas/AutomationRunItem" + } + } + }, + "required": [ + "total", + "runs" + ] + }, + "AutomationRuleItem": { + "type": "object", + "description": "Public view of one AI SRE automation rule.", + "properties": { + "rule_id": { + "type": "string", + "description": "Automation rule ID." + }, + "account_id": { + "type": "integer", + "format": "int64", + "description": "Owning account ID." + }, + "team_id": { + "type": "integer", + "format": "int64", + "description": "Rule scope. `0` = personal rule; `>0` = team rule." + }, + "owner_id": { + "type": "integer", + "format": "int64", + "description": "Owner member ID." + }, + "name": { + "type": "string", + "description": "Rule name." + }, + "enabled": { + "type": "boolean", + "description": "Whether the rule itself is enabled." + }, + "run_scope": { + "type": "string", + "description": "Derived scope used at execution time.", + "enum": [ + "person", + "team" + ] + }, + "cron_expr": { + "type": "string", + "description": "Stored cron expression. The backend normalizes four-field API input to a five-field form with a leading minute `0`." + }, + "prompt": { + "type": "string", + "description": "Task prompt executed on every run." + }, + "environment_kind": { + "type": "string", + "description": "Preferred execution environment. Empty string means auto-select.", + "enum": [ + "", + "cloud", + "byoc" + ] + }, + "environment_id": { + "type": "string", + "description": "Selected BYOC runner ID, or an empty string when the backend auto-picks." + }, + "schedule_trigger_id": { + "type": "string", + "description": "Schedule trigger ID when the rule has a cron trigger." + }, + "schedule_trigger_enabled": { + "type": "boolean", + "description": "Whether the schedule trigger is enabled." + }, + "http_post_trigger_id": { + "type": "string", + "description": "HTTP POST trigger ID when the rule exposes an API trigger." + }, + "http_post_trigger_url": { + "type": "string", + "description": "Relative trigger URL. Send a `POST` with `Authorization: Bearer `." + }, + "http_post_trigger_enabled": { + "type": "boolean", + "description": "Whether the HTTP POST trigger is enabled." + }, + "http_post_token": { + "type": "string", + "description": "One-time plaintext HTTP trigger token. Only returned immediately after create or token rotation." + }, + "can_edit": { + "type": "boolean", + "description": "Whether the caller may edit this rule." + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds when the rule was created." + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds when the rule was last updated." + } + }, + "required": [ + "rule_id", + "account_id", + "team_id", + "owner_id", + "name", + "enabled", + "run_scope", + "cron_expr", + "prompt", + "environment_kind", + "environment_id", + "schedule_trigger_enabled", + "http_post_trigger_enabled", + "can_edit", + "created_at", + "updated_at" + ] + }, + "AutomationTemplateItem": { + "type": "object", + "description": "Preset automation-rule template returned by the backend.", + "properties": { + "name": { + "type": "string", + "description": "Template name." + }, + "description": { + "type": "string", + "description": "Short description of what the template does." + }, + "icon": { + "type": "string", + "description": "Mintlify / UI icon name." + }, + "enabled": { + "type": "boolean", + "description": "Whether the template is currently offered to end users." + }, + "prompt": { + "type": "string", + "description": "Prefilled task prompt." + } + }, + "required": [ + "name", + "description", + "icon", + "enabled", + "prompt" + ] + }, + "AutomationRunItem": { + "type": "object", + "description": "One execution row in an automation rule history table.", + "properties": { + "run_id": { + "type": "string", + "description": "Automation run ID." + }, + "kind": { + "type": "string", + "description": "Run ledger kind.", + "enum": [ + "automation_rule" + ] + }, + "account_id": { + "type": "integer", + "format": "int64", + "description": "Owning account ID." + }, + "rule_id": { + "type": "string", + "description": "Automation rule ID." + }, + "trigger_kind": { + "type": "string", + "description": "How this run was started.", + "enum": [ + "schedule", + "debug", + "manual", + "http_post", + "test" + ] + }, + "occurrence_key": { + "type": "string", + "description": "Idempotency key for the trigger occurrence." + }, + "status": { + "type": "string", + "description": "Current or final run status.", + "enum": [ + "queued", + "running", + "retrying", + "succeeded", + "partial", + "failed", + "skipped", + "abandoned" + ] + }, + "attempts": { + "type": "integer", + "description": "How many attempts have been made for this run." + }, + "started_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds when the run started." + }, + "completed_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds when the run completed. `0` means it is still running." + }, + "duration_ms": { + "type": "integer", + "format": "int64", + "description": "Run duration in milliseconds. `0` while a run is still in flight." + }, + "error_code": { + "type": "string", + "description": "Run-level error code, if any." + }, + "error_message": { + "type": "string", + "description": "Run-level error message, if any." + }, + "stats_json": { + "type": "object", + "additionalProperties": true, + "description": "Arbitrary JSON metrics captured for the run." + }, + "result_json": { + "type": "object", + "additionalProperties": true, + "description": "Arbitrary JSON result payload captured for the run." + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds when the run row was created." + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds when the run row was last updated." + } + }, + "required": [ + "run_id", + "kind", + "account_id", + "rule_id", + "trigger_kind", + "occurrence_key", + "status", + "attempts", + "started_at", + "completed_at", + "duration_ms", + "error_code", + "error_message", + "created_at", + "updated_at" + ] } } } diff --git a/api-reference/openapi.zh.json b/api-reference/openapi.zh.json index eec7d36..f25248d 100644 --- a/api-reference/openapi.zh.json +++ b/api-reference/openapi.zh.json @@ -18,244 +18,165 @@ ], "tags": [ { - "name": "On-call/故障管理", - "description": "" + "name": "AI SRE/会话" }, { - "name": "On-call/协作空间", - "description": "" + "name": "AI SRE/自动化" }, { - "name": "On-call/告警管理", - "description": "查询、查看和处理告警,管理卡片视图与告警处理规则。" + "name": "AI SRE/技能" }, { - "name": "On-call/集成中心", - "description": "" + "name": "AI SRE/MCP 服务器" }, { - "name": "On-call/IM 集成", - "description": "IM 集成相关查询,例如查看哪些集成开启了作战室。" + "name": "AI SRE/A2A 智能体" }, { - "name": "On-call/值班排班", - "description": "" + "name": "On-call/故障管理" }, { - "name": "On-call/日历管理", - "description": "" + "name": "On-call/协作空间" }, { - "name": "On-call/通知模板", - "description": "" + "name": "On-call/告警管理" }, { - "name": "On-call/标签增强", - "description": "自定义字段、富化规则及数据映射(映射规则、映射数据、映射 API)管理。" + "name": "On-call/集成中心" }, { - "name": "On-call/分析看板", - "description": "" + "name": "On-call/IM 集成" }, { - "name": "On-call/状态页", - "description": "" + "name": "On-call/值班排班" }, { - "name": "Monitors/告警规则", - "description": "创建、管理和导出监控告警规则,查询规则统计和审计历史。" + "name": "On-call/日历管理" }, { - "name": "Monitors/告警数据源", - "description": "管理监控告警规则用于查询指标的数据源。" + "name": "On-call/通知模板" }, { - "name": "Monitors/规则集", - "description": "管理 Monitors 规则仓库中的共享规则集,规则集可在账户内或公开共享。" + "name": "On-call/标签增强" }, { - "name": "RUM/应用管理", - "description": "管理前端性能监控(RUM)应用。" + "name": "On-call/分析看板" }, { - "name": "RUM/RUM 问题跟踪", - "description": "查询和管理 RUM 异常追踪 Issue 及预设严重性规则。" + "name": "On-call/状态页" }, { - "name": "RUM/RUM Sourcemap", - "description": "管理和查询用于 Browser、Android、iOS 错误符号化的 RUM Sourcemap 文件。" + "name": "Monitors/告警规则" }, { - "name": "平台/成员管理", - "description": "" + "name": "Monitors/告警数据源" }, { - "name": "平台/团队管理", - "description": "" + "name": "Monitors/规则集" }, { - "name": "平台/角色与权限", - "description": "" + "name": "RUM/应用管理" }, { - "name": "平台/审计日志", - "description": "检索和读取账户操作审计日志。" + "name": "RUM/RUM 问题跟踪" }, { - "name": "Monitors/诊断分析", - "description": "Flashduty AI SRE 使用的诊断与查询接口——数据源即席查询、日志/指标诊断,以及监控对象侧的工具调用。" + "name": "RUM/RUM Sourcemap" }, { - "name": "AI SRE/MCP 服务器", - "description": "MCP(Model Context Protocol)服务器管理。" + "name": "平台/成员管理" }, { - "name": "平台/账户设置", - "description": "账户(主体)信息与设置" + "name": "平台/团队管理" }, { - "name": "On-call/变更管理", - "description": "" + "name": "平台/角色与权限" }, { - "name": "AI SRE/A2A 智能体", - "description": "A2A(智能体到智能体)远程智能体管理。" + "name": "平台/审计日志" }, { - "name": "AI SRE/技能", - "description": "AI SRE 智能体技能管理。" + "name": "Monitors/诊断分析" }, { - "name": "AI SRE/会话", - "description": "AI SRE 智能体会话历史 —— 查询、查看与导出会话记录。" + "name": "平台/账户设置" }, { - "name": "Monitors/通用工具", - "description": "监控服务开通及数据预览工具。" + "name": "On-call/变更管理" + }, + { + "name": "Monitors/通用工具" } ], "paths": { - "/incident/list": { + "/account/info": { "post": { - "operationId": "incidentList", - "summary": "查询故障列表", - "description": "分页查询故障列表,支持按协作空间、严重程度、状态、处理人员和时间范围过滤。", + "summary": "查看主体信息", + "description": "返回当前主体(账户)的基本信息与设置。", + "operationId": "account-read-info", "tags": [ - "On-call/故障管理" + "平台/账户设置" ], - "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-list", - "metadata": { - "sidebarTitle": "查询故障列表" + "security": [ + { + "AppKeyAuth": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": {} + } } }, "responses": { "200": { - "description": "成功", + "description": "OK", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/IncidentListResponse" + "$ref": "#/components/schemas/AccountInfo" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "error_code": 0, "data": { - "total": 88, - "has_next_page": true, - "search_after_ctx": "69da451ef77b1b51f40e83eb", - "items": [ - { - "incident_id": "69da451ef77b1b51f40e83ee", - "account_id": 2451002751131, - "channel_id": 2551105804131, - "integration_id": 2490562293131, - "integration_ids": [ - 2490562293131 - ], - "integration_types": [ - "monit.alert" - ], - "dedup_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", - "equals_md5": "", - "start_time": 1775912219, - "end_time": 0, - "last_time": 1775969819, - "ack_time": 0, - "close_time": 0, - "creator_id": 0, - "closer_id": 0, - "owner_id": 0, - "incident_status": "Critical", - "incident_severity": "Critical", - "progress": "Triggered", - "title": "CPU usage high - web-server-01", - "description": "", - "ai_summary": "", - "impact": "", - "root_cause": "", - "resolution": "", - "num": "0E83EE", - "frequency": "frequent", - "created_at": 1775912222, - "updated_at": 1775972145, - "snoozed_before": 0, - "group_method": "n", - "ever_muted": false, - "labels": { - "check": "cpu_usage_high", - "resource": "web-server-01", - "env": "production" - }, - "fields": {}, - "assigned_to": { - "person_ids": [ - 2476444212131 - ], - "escalate_rule_id": "000000000000000000000000", - "layer_idx": 0, - "type": "assign", - "assigned_at": 1775972128, - "id": "MvQfH9Dc8eNS8k79jmrWn6", - "escalate_rule_name": "" - }, - "alert_cnt": 1, - "active_alert_cnt": 1, - "alert_event_cnt": 17, - "responders": [ - { - "person_id": 2476444212131, - "assigned_at": 1775972128, - "acknowledged_at": 0 - } - ], - "account_name": "", - "account_locale": "", - "account_time_zone": "", - "channel_name": "Ops Channel", - "channel_status": "enabled", - "detail_url": "https://app.flashcat.cloud/incident/detail/69da451ef77b1b51f40e83ee", - "silence_url": "https://app.flashcat.cloud/channel/detail/2551105804131?tab=alertSuppression&fromIncidentId=69da451ef77b1b51f40e83ee", - "integration_type": "monit.alert", - "post_mortem_id": "", - "images": null, - "manual_overrides": [ - "title" - ] - } - ] + "account_id": 1001, + "account_name": "acme", + "domain": "acme", + "extra_domains": [ + "acme-corp" + ], + "phone": "138****8000", + "country_code": "86", + "email": "ops@acme.example", + "avatar": "https://cdn.flashcat.cloud/avatar/acme.png", + "locale": "zh-CN", + "time_zone": "Asia/Shanghai", + "created_at": 1716960000, + "restrictions": { + "ips": [ + "203.0.113.0/24" + ], + "email_domains": [ + "acme.example" + ], + "allow_subdomain": true + } } } } @@ -271,45 +192,30 @@ "$ref": "#/components/responses/TooManyRequests" }, "500": { - "$ref": "#/components/responses/ServerError" + "$ref": "#/components/responses/InternalError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListIncidentsRequest" - }, - "example": { - "start_time": 1711900800, - "end_time": 1712000000, - "progress": "Triggered,Processing", - "incident_severity": "Critical,Warning", - "channel_ids": [ - 2551105804131 - ], - "limit": 20, - "p": 1 - } - } - } + "x-mint": { + "metadata": { + "sidebarTitle": "查看主体信息" + }, + "content": "| 权限 | 描述 |\n| --- | --- |\n| 无 | 无 — 任意有效的 app_key 均可调用此操作。 |\n\n在 [平台 API 参考](/zh/api-reference/platform/account/account-read-info) 中查看此操作。" } } }, - "/incident/info": { + "/alert-event/list": { "post": { - "operationId": "incidentInfo", - "summary": "获取故障详情", - "description": "获取单个故障的详细信息,包括时间线、关联告警、处理人员和自定义字段。", + "operationId": "alert-event-read-list", + "summary": "查询原始告警事件列表", + "description": "返回跨所有告警的原始告警事件分页列表,支持按集成、协作空间、时间范围和严重程度过滤。", "tags": [ - "On-call/故障管理" + "On-call/告警管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- 结果会根据调用方的协作空间数据访问权限进行过滤。\n- `severities` 为逗号分隔的字符串,如 `\"Critical,Warning\"`。", + "href": "/zh/api-reference/on-call/alerts/alert-event-read-list", "metadata": { - "sidebarTitle": "获取故障详情" + "sidebarTitle": "查询原始告警事件列表" } }, "responses": { @@ -326,7 +232,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/IncidentInfo" + "$ref": "#/components/schemas/AlertEventGlobalListResponse" } } } @@ -335,81 +241,16 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "incident_id": "69da451ef77b1b51f40e83ee", - "account_id": 2451002751131, - "channel_id": 2551105804131, - "integration_id": 2490562293131, - "integration_ids": [ - 2490562293131 - ], - "integration_types": [ - "monit.alert" - ], - "dedup_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", - "equals_md5": "", - "start_time": 1775912219, - "end_time": 0, - "last_time": 1775969819, - "ack_time": 0, - "close_time": 0, - "creator_id": 0, - "closer_id": 0, - "owner_id": 0, - "incident_status": "Critical", - "incident_severity": "Critical", - "progress": "Triggered", - "title": "CPU usage high - web-server-01", - "description": "", - "ai_summary": "", - "impact": "", - "root_cause": "", - "resolution": "", - "num": "0E83EE", - "frequency": "frequent", - "created_at": 1775912222, - "updated_at": 1775972145, - "snoozed_before": 0, - "group_method": "n", - "ever_muted": false, - "labels": { - "check": "cpu_usage_high", - "resource": "web-server-01", - "env": "production" - }, - "fields": {}, - "assigned_to": { - "person_ids": [ - 2476444212131 - ], - "escalate_rule_id": "000000000000000000000000", - "layer_idx": 0, - "type": "assign", - "assigned_at": 1775972128, - "id": "MvQfH9Dc8eNS8k79jmrWn6", - "escalate_rule_name": "" - }, - "alert_cnt": 1, - "active_alert_cnt": 1, - "alert_event_cnt": 17, - "responders": [ + "total": 1, + "has_next_page": false, + "items": [ { - "person_id": 2476444212131, - "assigned_at": 1775972128, - "acknowledged_at": 0 + "event_id": "663a1b2c3d4e5f6789abc001", + "alert_id": "663a1b2c3d4e5f6789abcdef", + "title": "CPU 使用率 > 90%", + "event_severity": "Critical", + "event_time": 1712650000 } - ], - "account_name": "", - "account_locale": "", - "account_time_zone": "", - "channel_name": "Ops Channel", - "channel_status": "enabled", - "detail_url": "https://app.flashcat.cloud/incident/detail/69da451ef77b1b51f40e83ee", - "silence_url": "https://app.flashcat.cloud/channel/detail/2551105804131?tab=alertSuppression&fromIncidentId=69da451ef77b1b51f40e83ee", - "integration_type": "monit.alert", - "post_mortem_id": "", - "images": null, - "manual_overrides": [ - "title" ] } } @@ -434,29 +275,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IncidentInfoRequest" + "$ref": "#/components/schemas/AlertEventGlobalListRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee" + "start_time": 1712620800, + "end_time": 1712707200, + "limit": 20, + "severities": "Critical" } } } } } }, - "/incident/list-by-ids": { + "/alert/event/list": { "post": { - "operationId": "incidentListByIds", - "summary": "批量查询故障", - "description": "通过故障 ID 列表批量获取故障信息。", + "operationId": "alert-read-event-list", + "summary": "查询告警事件列表", + "description": "返回特定告警收到的所有原始事件,按时间顺序排列。", "tags": [ - "On-call/故障管理" + "On-call/告警管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-list-by-ids", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- 每条告警会从集成持续接收原始事件,此接口展示指定告警的原始事件历史。", + "href": "/zh/api-reference/on-call/alerts/alert-read-event-list", "metadata": { - "sidebarTitle": "批量查询故障" + "sidebarTitle": "查询告警事件列表" } }, "responses": { @@ -473,7 +317,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/IncidentListResponse" + "$ref": "#/components/schemas/AlertEventListResponse" } } } @@ -482,71 +326,17 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 2, - "has_next_page": false, "items": [ { - "incident_id": "69da451ef77b1b51f40e83ee", - "account_id": 2451002751131, - "channel_id": 2551105804131, - "integration_id": 2490562293131, - "integration_ids": [ - 2490562293131 - ], - "integration_types": [ - "monit.alert" - ], - "dedup_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", - "equals_md5": "", - "start_time": 1775912219, - "end_time": 0, - "last_time": 1775969819, - "ack_time": 0, - "close_time": 0, - "creator_id": 0, - "closer_id": 0, - "owner_id": 0, - "incident_status": "Critical", - "incident_severity": "Critical", - "progress": "Triggered", - "title": "CPU usage high - web-server-01", - "description": "", - "ai_summary": "", - "impact": "", - "root_cause": "", - "resolution": "", - "num": "0E83EE", - "frequency": "frequent", - "created_at": 1775912222, - "updated_at": 1775972145, - "snoozed_before": 0, - "group_method": "n", - "ever_muted": false, - "labels": {}, - "fields": {}, - "assigned_to": { - "escalate_rule_id": "000000000000000000000000", - "layer_idx": 0, - "type": "", - "assigned_at": 0, - "id": "", - "escalate_rule_name": "" - }, - "alert_cnt": 1, - "active_alert_cnt": 1, - "alert_event_cnt": 17, - "responders": [], - "account_name": "", - "account_locale": "", - "account_time_zone": "", - "channel_name": "Ops Channel", - "channel_status": "enabled", - "detail_url": "https://app.flashcat.cloud/incident/detail/69da451ef77b1b51f40e83ee", - "silence_url": "https://app.flashcat.cloud/channel/detail/2551105804131?tab=alertSuppression&fromIncidentId=69da451ef77b1b51f40e83ee", - "integration_type": "monit.alert", - "post_mortem_id": "", - "images": null, - "manual_overrides": null + "event_id": "663a1b2c3d4e5f6789abc001", + "alert_id": "663a1b2c3d4e5f6789abcdef", + "title": "CPU 使用率 > 90%", + "event_severity": "Critical", + "event_status": "Critical", + "event_time": 1712650000, + "labels": { + "host": "web-01" + } } ] } @@ -572,32 +362,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListIncidentsByIdsRequest" + "$ref": "#/components/schemas/AlertEventListRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee", - "69da451ef77b1b51f40e83ef" - ] + "alert_id": "663a1b2c3d4e5f6789abcdef" } } } } } }, - "/incident/alert/list": { + "/alert/feed": { "post": { - "operationId": "incidentAlertList", - "summary": "查询故障关联告警", - "description": "查询合并到指定故障中的所有告警列表。", + "operationId": "alert-read-feed", + "summary": "查询告警动态", + "description": "返回单条告警的动态记录(评论、状态变更、合并、静默事件),支持分页查询。", "tags": [ - "On-call/故障管理" + "On-call/告警管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-alert-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- 使用 `p`(页码,从 1 开始)和 `limit`(最大 100,默认 20)进行分页。\n- 将 `asc` 设为 `true` 可按时间正序返回。\n- 使用 `types` 过滤特定动态类型(如 `alert_comment`、`alert_merge`)。", + "href": "/zh/api-reference/on-call/alerts/alert-read-feed", "metadata": { - "sidebarTitle": "查询故障关联告警" + "sidebarTitle": "查询告警动态" } }, "responses": { @@ -614,7 +401,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListIncidentAlertsResponse" + "$ref": "#/components/schemas/AlertFeedResponse" } } } @@ -623,47 +410,16 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 1, + "has_next_page": false, "items": [ { - "alert_id": "69da451df77b1b51f40e83de", - "integration_id": 2490562293131, - "data_source_id": 2490562293131, - "channel_id": 2551105804131, - "account_id": 2451002751131, - "description": "", - "title": "CPU usage high - web-server-01", - "title_rule": "", - "alert_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", - "alert_severity": "Critical", - "alert_status": "Critical", - "start_time": 1775912219, - "last_time": 1775969819, - "end_time": 0, - "labels": { - "check": "cpu_usage_high", - "resource": "web-server-01" - }, - "ever_muted": false, - "created_at": 1775912221, - "updated_at": 1775969821, - "integration_name": "FlashMonit", - "integration_type": "monit.alert", - "integration_ref_id": "a_2451002751131", - "channel_name": "Ops Channel", - "channel_status": "enabled", - "responder_name": "", - "responder_email": "", - "incident": { - "incident_id": "69da451ef77b1b51f40e83ee", - "title": "CPU usage high - web-server-01", - "progress": "Triggered" + "ref_id": "663a1b2c3d4e5f6789abcdef", + "type": "alert_comment", + "detail": { + "comment": "正在排查中。" }, - "event_cnt": 17, - "images": null, - "data_source_name": "FlashMonit", - "data_source_type": "monit.alert", - "data_source_ref_id": "a_2451002751131" + "creator_id": 80011, + "created_at": 1712651000 } ] } @@ -689,32 +445,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListIncidentAlertsRequest" + "$ref": "#/components/schemas/AlertFeedRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "is_active": true, - "limit": 100, - "p": 1 + "alert_id": "663a1b2c3d4e5f6789abcdef", + "limit": 20, + "asc": false } } } } } }, - "/incident/feed": { + "/alert/info": { "post": { - "operationId": "incidentFeed", - "summary": "获取故障时间线", - "description": "获取指定故障的时间线动态,包括状态变更、评论和系统事件。", + "operationId": "alert-read-info", + "summary": "查看告警详情", + "description": "通过告警 ID 返回单条告警的完整详情,包括关联故障和事件数量。", "tags": [ - "On-call/故障管理" + "On-call/告警管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-feed", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- `alert_id` 为 ObjectID 十六进制字符串,可从 `POST /alert/list` 或 `POST /alert-event/list` 获取。", + "href": "/zh/api-reference/on-call/alerts/alert-read-info", "metadata": { - "sidebarTitle": "获取故障时间线" + "sidebarTitle": "查看告警详情" } }, "responses": { @@ -731,7 +486,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListIncidentFeedResponse" + "$ref": "#/components/schemas/AlertItem" } } } @@ -740,42 +495,12 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "has_next_page": true, - "items": [ - { - "ref_id": "69da451ef77b1b51f40e83ee", - "type": "i_new", - "detail": { - "severity": "Critical", - "title": "CPU usage high - web-server-01" - }, - "account_id": 2451002751131, - "creator_id": 0, - "created_at": 1775912222661, - "updated_at": 1775912222661 - }, - { - "ref_id": "69da451ef77b1b51f40e83ee", - "type": "i_notify", - "detail": { - "rid": "5e9ccfabcd154b41a0005fd0f52b674b", - "msg_id": "naFudJYCawBWsChdV6ErPH", - "fire_type": "fire", - "escalate_rule_id": "000000000000000000000000", - "layer_idx": 0, - "by": "email", - "persons": [ - { - "person_id": 2476444212131 - } - ] - }, - "account_id": 2451002751131, - "creator_id": 0, - "created_at": 1775972130174, - "updated_at": 1775972130174 - } - ] + "alert_id": "663a1b2c3d4e5f6789abcdef", + "title": "CPU 使用率 > 90%", + "alert_severity": "Critical", + "alert_status": "Critical", + "start_time": 1712650000, + "event_cnt": 3 } } } @@ -799,31 +524,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListIncidentFeedRequest" + "$ref": "#/components/schemas/AlertInfoRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "p": 1, - "limit": 20 + "alert_id": "663a1b2c3d4e5f6789abcdef" } } } } } }, - "/incident/past/list": { + "/alert/list": { "post": { - "operationId": "incidentPastList", - "summary": "查询历史相似故障", - "description": "查询与当前故障相关的历史故障列表,用于参考排查。", + "operationId": "alert-read-list", + "summary": "查询告警列表", + "description": "返回满足过滤条件的告警列表,支持游标分页。", "tags": [ - "On-call/故障管理" + "On-call/告警管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **100 次/分钟**;**20 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-past-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- `start_time` 和 `end_time` 均为必填的 Unix 时间戳(秒),最大跨度 31 天。\n- 使用上次响应中的 `search_after_ctx` 获取下一页。\n- 结果会根据调用方的协作空间数据访问权限进行过滤。\n- 将 `is_active` 设为 `true` 可仅返回活跃(触发中)告警;设为 `false` 返回已恢复告警。", + "href": "/zh/api-reference/on-call/alerts/alert-read-list", "metadata": { - "sidebarTitle": "查询历史相似故障" + "sidebarTitle": "查询告警列表" } }, "responses": { @@ -840,7 +563,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListPastIncidentsResponse" + "$ref": "#/components/schemas/AlertListResponse" } } } @@ -849,7 +572,33 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [] + "total": 1, + "has_next_page": false, + "search_after_ctx": "", + "items": [ + { + "alert_id": "663a1b2c3d4e5f6789abcdef", + "integration_id": 10001, + "channel_id": 20001, + "account_id": 10023, + "title": "CPU 使用率 > 90%", + "alert_severity": "Critical", + "alert_status": "Critical", + "start_time": 1712650000, + "last_time": 1712655000, + "end_time": 0, + "labels": { + "host": "web-01" + }, + "ever_muted": false, + "created_at": 1712650000, + "updated_at": 1712655000, + "integration_name": "Prometheus", + "integration_type": "prometheus", + "channel_name": "生产", + "event_cnt": 3 + } + ] } } } @@ -873,30 +622,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListPastIncidentsRequest" + "$ref": "#/components/schemas/AlertListRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "limit": 5 + "start_time": 1712620800, + "end_time": 1712707200, + "limit": 20, + "is_active": true } } } } } }, - "/incident/create": { + "/alert/list-by-ids": { "post": { - "operationId": "incidentCreate", - "summary": "创建故障", - "description": "手动创建一个新故障并分派处理人员。", + "operationId": "alert-read-list-by-ids", + "summary": "批量查询告警", + "description": "通过多个告警 ID 一次性返回多条告警详情。", "tags": [ - "On-call/故障管理" + "On-call/告警管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- 所有 `alert_ids` 必须属于调用方账户,任何无效 ID 都会导致整个请求失败。", + "href": "/zh/api-reference/on-call/alerts/alert-read-list-by-ids", "metadata": { - "sidebarTitle": "创建故障" + "sidebarTitle": "批量查询告警" } }, "responses": { @@ -913,7 +664,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CreateIncidentResponse" + "$ref": "#/components/schemas/AlertListResponse" } } } @@ -922,8 +673,14 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "incident_id": "69db2ef1a0fe7db6448b14f1", - "title": "API test incident for docs" + "total": 1, + "has_next_page": false, + "items": [ + { + "alert_id": "663a1b2c3d4e5f6789abcdef", + "title": "CPU 使用率 > 90%" + } + ] } } } @@ -947,36 +704,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateIncidentRequest" + "$ref": "#/components/schemas/AlertListByIDsRequest" }, "example": { - "incident_severity": "Critical", - "title": "Database connection timeout on prod-db-01", - "channel_id": 2551105804131, - "assigned_to": { - "person_ids": [ - 2476444212131 - ] - } + "alert_ids": [ + "663a1b2c3d4e5f6789abcdef" + ] } } } } } }, - "/incident/ack": { + "/alert/merge": { "post": { - "operationId": "incidentAck", - "summary": "认领故障", - "description": "认领一个故障以表明正在积极处理。", + "operationId": "alert-write-merge", + "summary": "将告警合并到故障", + "description": "将一条或多条告警关联到已有故障。若来源告警之前属于其他故障,且合并后该故障中没有其他告警,则该故障将自动关闭。", "tags": [ - "On-call/故障管理" + "On-call/告警管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-ack", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- 所有 `alert_ids` 和 `incident_id` 必须属于调用方账户。\n- 可选填 `title` 和 `owner_id` 以同时更新目标故障。", + "href": "/zh/api-reference/on-call/alerts/alert-write-merge", "metadata": { - "sidebarTitle": "认领故障" + "sidebarTitle": "将告警合并到故障" } }, "responses": { @@ -1024,31 +776,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AckIncidentRequest" + "$ref": "#/components/schemas/AlertMergeRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ] + "alert_ids": [ + "663a1b2c3d4e5f6789abcdef" + ], + "incident_id": "663a000000000000deadbeef" } } } } } }, - "/incident/unack": { + "/alert/pipeline/info": { "post": { - "operationId": "incidentUnack", - "summary": "取消认领故障", - "description": "取消故障的认领状态。", + "operationId": "alert-read-pipeline-info", + "summary": "查看告警处理规则", + "description": "返回指定集成的告警处理规则配置。", "tags": [ - "On-call/故障管理" + "On-call/告警管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-unack", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) |\n\n## 使用说明\n\n- 若该集成尚未配置告警处理规则,则 data 为 `null`。\n- 调用方需有该集成的访问权限。", + "href": "/zh/api-reference/on-call/alerts/alert-read-pipeline-info", "metadata": { - "sidebarTitle": "取消认领故障" + "sidebarTitle": "查看告警处理规则" } }, "responses": { @@ -1065,7 +818,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/AlertPipelineItem" } } } @@ -1073,7 +826,23 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "integration_id": 10001, + "rules": [ + { + "kind": "severity_reset", + "if": null, + "settings": { + "severity": "Warning" + } + } + ], + "status": "enabled", + "creator_id": 80011, + "updated_by": 80011, + "created_at": 1710000000, + "updated_at": 1712000000 + } } } } @@ -1096,31 +865,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UnackIncidentRequest" + "$ref": "#/components/schemas/AlertPipelineInfoRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ] + "integration_id": 10001 } } } } } }, - "/incident/resolve": { + "/alert/pipeline/list": { "post": { - "operationId": "incidentResolve", - "summary": "恢复故障", - "description": "将故障标记为已恢复。", + "operationId": "alert-read-pipeline-list", + "summary": "批量查询告警处理规则", + "description": "返回多个集成的告警处理规则配置。", "tags": [ - "On-call/故障管理" + "On-call/告警管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-resolve", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) |\n\n## 使用说明\n\n- 所有 `integration_ids` 必须对调用方可访问。", + "href": "/zh/api-reference/on-call/alerts/alert-read-pipeline-list", "metadata": { - "sidebarTitle": "恢复故障" + "sidebarTitle": "批量查询告警处理规则" } }, "responses": { @@ -1137,7 +904,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/AlertPipelineListResponse" } } } @@ -1145,7 +912,19 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "integration_id": 10001, + "rules": [], + "status": "enabled", + "creator_id": 80011, + "updated_by": 80011, + "created_at": 1710000000, + "updated_at": 1712000000 + } + ] + } } } } @@ -1168,33 +947,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResolveIncidentRequest" + "$ref": "#/components/schemas/AlertPipelineListRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ], - "root_cause": "Memory leak in the connection pool caused by a missing cleanup call.", - "resolution": "Deployed hotfix v2.3.1 and restarted the affected service." + "integration_ids": [ + 10001, + 10002 + ] } } } } } }, - "/incident/reopen": { + "/alert/pipeline/upsert": { "post": { - "operationId": "incidentReopen", - "summary": "重开故障", - "description": "重新打开一个已恢复的故障。", + "operationId": "alert-write-pipeline-upsert", + "summary": "创建或更新告警处理规则", + "description": "为集成设置告警处理规则,将完全替换已有配置。", "tags": [ - "On-call/故障管理" + "On-call/告警管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-reopen", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心管理**(`on-call`) |\n\n## 使用说明\n\n- 每条处理规则最多 50 条规则。\n- 每条规则包含 `kind`(`title_reset`、`description_reset`、`severity_reset`、`alert_drop`、`alert_inhibit` 之一)、可选的 `if` 过滤器,以及与 kind 对应的 `settings`。\n- `alert_inhibit` 类型需要 Standard 及以上许可证。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/alerts/alert-write-pipeline-upsert", "metadata": { - "sidebarTitle": "重开故障" + "sidebarTitle": "创建或更新告警处理规则" } }, "responses": { @@ -1242,32 +1020,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReopenIncidentRequest" + "$ref": "#/components/schemas/AlertPipelineUpsertRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ], - "reason": "Monitoring detected the issue recurred after the initial fix." + "integration_id": 10001, + "rules": [ + { + "kind": "severity_reset", + "if": null, + "settings": { + "severity": "Warning" + } + } + ] } } } } } }, - "/incident/snooze": { + "/audit/operation/list": { "post": { - "operationId": "incidentSnooze", - "summary": "暂停故障通知", - "description": "暂时屏蔽故障通知直到指定时间。", + "operationId": "audit-read-operation-list", + "summary": "查看事件类型列表", + "description": "返回所有会记录到审计日志中的操作名称,可用于 `operations` 过滤参数。", "tags": [ - "On-call/故障管理" + "平台/审计日志" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-snooze", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **审计查看**(`organization`) |\n\n## 使用说明\n\n- 将本接口返回的 `name` 值作为 `POST /audit/search` 的 `operations` 过滤参数使用。\n- `name_cn` 是控制台展示的中文标签;`name` 是用于过滤的稳定字段值。", + "href": "/zh/api-reference/platform/audit-logs/audit-read-operation-list", "metadata": { - "sidebarTitle": "暂停故障通知" + "sidebarTitle": "查看事件类型列表" } }, "responses": { @@ -1284,7 +1068,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/AuditOperationListResponse" } } } @@ -1292,7 +1076,22 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "name": "template:write:create", + "name_cn": "创建模板" + }, + { + "name": "template:write:delete", + "name_cn": "删除模板" + }, + { + "name": "incident:write:acknowledge", + "name_cn": "认领故障" + } + ] + } } } } @@ -1315,32 +1114,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SnoozeIncidentRequest" + "$ref": "#/components/schemas/AuditOperationListRequest" }, - "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ], - "minutes": 60 - } + "example": {} } } } } }, - "/incident/wake": { + "/audit/search": { "post": { - "operationId": "incidentWake", - "summary": "恢复故障通知", - "description": "取消故障的暂停状态,恢复通知。", + "operationId": "audit-read-search", + "summary": "检索审计日志", + "description": "按时间范围返回游标分页的操作审计日志列表。", "tags": [ - "On-call/故障管理" + "平台/审计日志" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-wake", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **审计查看**(`organization`) |\n\n## 使用说明\n\n- 时间范围必填。最大跨度 90 天,`start_time` 和 `end_time` 均为 Unix 时间戳(**秒**)。\n- 使用上次响应中的 `search_after_ctx` 获取下一页。该 token 是不透明的,请勿手动构造。\n- 可查询的时间窗口受账户许可证限制,超出保留期的查询会静默返回空结果,而不是报错。\n- 默认每页 20 条,最大 99 条。", + "href": "/zh/api-reference/platform/audit-logs/audit-read-search", "metadata": { - "sidebarTitle": "恢复故障通知" + "sidebarTitle": "检索审计日志" } }, "responses": { @@ -1357,7 +1151,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/AuditSearchResponse" } } } @@ -1365,7 +1159,26 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "total": 2, + "search_after_ctx": "", + "docs": [ + { + "created_at": 1712700123456, + "account_id": 10023, + "member_id": 80011, + "member_name": "Alice", + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "ip": "203.0.113.42", + "operation": "template:write:create", + "operation_name": "创建模板", + "body": "{\"template_name\":\"生产默认模板\"}", + "params": [], + "is_dangerous": false, + "is_write": true + } + ] + } } } } @@ -1388,11 +1201,15 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WakeIncidentRequest" + "$ref": "#/components/schemas/AuditSearchRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" + "start_time": 1712620800, + "end_time": 1712707200, + "limit": 20, + "operations": [ + "template:write:create", + "template:write:delete" ] } } @@ -1400,19 +1217,19 @@ } } }, - "/incident/merge": { + "/calendar/create": { "post": { - "operationId": "incidentMerge", - "summary": "合并故障", - "description": "将一个或多个故障合并到目标故障中。", + "operationId": "calendarCreate", + "summary": "创建服务日历", + "description": "创建个人服务日历。每个账户默认最多 5 个日历,可通过 Flashcat-Break-Cal-Limit 请求头突破限制。", "tags": [ - "On-call/故障管理" + "On-call/日历管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-merge", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **服务日历管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/calendars/calendar-create", "metadata": { - "sidebarTitle": "合并故障" + "sidebarTitle": "创建服务日历" } }, "responses": { @@ -1429,7 +1246,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalendarCreateResponse" } } } @@ -1437,7 +1254,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "cal_name": "API Test Calendar" + } } } } @@ -1460,34 +1280,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MergeIncidentsRequest" + "$ref": "#/components/schemas/CalendarCreateRequest" }, "example": { - "source_incident_ids": [ - "69da451ef77b1b51f40e83ef", - "69da451ef77b1b51f40e83f0" - ], - "target_incident_id": "69da451ef77b1b51f40e83ee", - "comment": "Merging related database connectivity incidents into one." + "cal_name": "Production On-Call Calendar", + "description": "Calendar for production on-call team", + "timezone": "Asia/Shanghai", + "workdays": [ + 1, + 2, + 3, + 4, + 5 + ] } } } } } }, - "/incident/disable-merge": { + "/calendar/delete": { "post": { - "operationId": "incidentDisableMerge", - "summary": "禁止故障合并", - "description": "禁用指定故障的自动合并功能。", + "operationId": "calendarDelete", + "summary": "删除服务日历", + "description": "删除个人服务日历。当日历被分派或静默策略引用时删除会失败。", "tags": [ - "On-call/故障管理" + "On-call/日历管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-disable-merge", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **服务日历管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/calendars/calendar-delete", "metadata": { - "sidebarTitle": "禁止故障合并" + "sidebarTitle": "删除服务日历" } }, "responses": { @@ -1504,7 +1328,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalendarEmptyObject" } } } @@ -1535,31 +1359,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DisableIncidentMergeRequest" + "$ref": "#/components/schemas/CalendarIDRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ] + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM" } } } } } }, - "/incident/reset": { + "/calendar/event/delete": { "post": { - "operationId": "incidentReset", - "summary": "更新故障信息", - "description": "一次调用更新故障的多个可编辑字段,包括标题、描述、影响范围、根因、恢复方案和严重程度。至少需要提供一个字段。", + "operationId": "calEventDelete", + "summary": "删除日历事件", + "description": "根据日历 ID 与事件 ID 删除日历事件。", "tags": [ - "On-call/故障管理" + "On-call/日历管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-reset", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **服务日历管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/calendars/cal-event-delete", "metadata": { - "sidebarTitle": "更新故障信息" + "sidebarTitle": "删除日历事件" } }, "responses": { @@ -1576,7 +1398,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalendarEmptyObject" } } } @@ -1607,31 +1429,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateIncidentFieldsRequest" + "$ref": "#/components/schemas/CalEventIDRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "title": "Database connection timeout - prod-db-01 primary", - "incident_severity": "Critical" + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "event_id": "cale.KyG9XWTCU5CucbwukEVBQ4" } } } } } }, - "/incident/remove": { + "/calendar/event/list": { "post": { - "operationId": "incidentRemove", - "summary": "删除故障", - "description": "永久删除一个故障及其关联数据。", + "operationId": "calEventList", + "summary": "查询日历事件列表", + "description": "返回个人日历在指定年/月/日范围内的事件列表。未同时传入 month 和 day 时返回整年数据。", "tags": [ - "On-call/故障管理" + "On-call/日历管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-remove", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/calendars/cal-event-list", "metadata": { - "sidebarTitle": "删除故障" + "sidebarTitle": "查询日历事件列表" } }, "responses": { @@ -1648,7 +1469,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalEventListResponse" } } } @@ -1656,7 +1477,37 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "account_id": 2451002751131, + "creator_id": 2476444212131, + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "event_id": "cale.KyG9XWTCU5CucbwukEVBQ4", + "summary": "Test Holiday", + "description": "A test holiday event", + "start_at": "2026-05-01", + "end_at": "2026-05-02", + "is_off": true, + "created_at": 1775972034, + "updated_at": 1775972034 + }, + { + "account_id": 2451002751131, + "creator_id": 2451002751131, + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "event_id": "non_work.20260502", + "summary": "non-working day (Saturday)", + "description": "", + "start_at": "2026-05-02", + "end_at": "2026-05-03", + "is_off": true, + "created_at": 0, + "updated_at": 0 + } + ], + "total": 11 + } } } } @@ -1679,31 +1530,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RemoveIncidentRequest" + "$ref": "#/components/schemas/CalEventListRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ] + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "year": 2024, + "month": 5 } } } } } }, - "/incident/comment": { + "/calendar/event/upsert": { "post": { - "operationId": "incidentComment", - "summary": "评论故障", - "description": "在故障时间线上添加文字评论。", + "operationId": "calEventUpsert", + "summary": "创建或更新日历事件", + "description": "创建或更新日历事件(节假日或工作日覆盖)。不传 event_id 时会创建新事件。", "tags": [ - "On-call/故障管理" + "On-call/日历管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-comment", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **服务日历管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/calendars/cal-event-upsert", "metadata": { - "sidebarTitle": "评论故障" + "sidebarTitle": "创建或更新日历事件" } }, "responses": { @@ -1720,7 +1571,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalEventUpsertResponse" } } } @@ -1728,7 +1579,11 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "event_id": "cale.KyG9XWTCU5CucbwukEVBQ4", + "summary": "Test Holiday" + } } } } @@ -1751,32 +1606,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CommentIncidentRequest" + "$ref": "#/components/schemas/CalEventUpsertRequest" }, "example": { - "incident_ids": [ - "69da451ef77b1b51f40e83ee" - ], - "comment": "Identified the root cause. Rolling back the deployment now." - } - } - } - } - } + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "summary": "Labour Day", + "start_at": "2024-05-01", + "end_at": "2024-05-06", + "is_off": true, + "description": "International Workers Day holiday" + } + } + } + } + } }, - "/incident/assign": { + "/calendar/info": { "post": { - "operationId": "incidentAssign", - "summary": "分派故障", - "description": "将故障分派到指定的升级环节或处理人员。", + "operationId": "calendarInfo", + "summary": "获取服务日历详情", + "description": "返回服务日历的详细信息。", "tags": [ - "On-call/故障管理" + "On-call/日历管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-assign", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/calendars/calendar-info", "metadata": { - "sidebarTitle": "分派故障" + "sidebarTitle": "获取服务日历详情" } }, "responses": { @@ -1793,7 +1650,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalendarItem" } } } @@ -1801,7 +1658,29 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "account_id": 2451002751131, + "team_id": 2477033058131, + "cal_id": "cal.eh9gvPtWeH3xXgKeVSRxRg", + "cal_name": "Stock Exchange Calendar", + "description": "A stock market trading calendar example", + "timezone": "Asia/Shanghai", + "kind": "personal", + "workdays": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "created_at": 1702455630, + "updated_at": 1775529526, + "creator_id": 2476444212131, + "updated_by": 3790925372131, + "status": "enabled" + } } } } @@ -1824,35 +1703,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AssignIncidentRequest" + "$ref": "#/components/schemas/CalendarIDRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "assigned_to": { - "person_ids": [ - 2476444212131 - ], - "type": "assign" - } + "cal_id": "cal.eh9gvPtWeH3xXgKeVSRxRg" } } } } } }, - "/incident/responder/add": { + "/calendar/list": { "post": { - "operationId": "incidentResponderAdd", - "summary": "添加故障处理人员", - "description": "向已有故障添加处理人员。", + "operationId": "calendarList", + "summary": "查询服务日历列表", + "description": "返回当前账户可见的服务日历列表。", "tags": [ - "On-call/故障管理" + "On-call/日历管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-responder-add", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/calendars/calendar-list", "metadata": { - "sidebarTitle": "添加故障处理人员" + "sidebarTitle": "查询服务日历列表" } }, "responses": { @@ -1869,7 +1742,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalendarListResponse" } } } @@ -1877,7 +1750,51 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "account_id": 2451002751131, + "team_id": 2477033058131, + "cal_id": "cal.eh9gvPtWeH3xXgKeVSRxRg", + "cal_name": "Stock Exchange Calendar", + "description": "A stock market trading calendar example", + "timezone": "Asia/Shanghai", + "kind": "personal", + "workdays": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "created_at": 1702455630, + "updated_at": 1775529526, + "creator_id": 2476444212131, + "updated_by": 3790925372131, + "status": "enabled" + }, + { + "account_id": 2451002751131, + "team_id": 0, + "cal_id": "cal.VZYkchxJhGELSF4jzkUAud", + "cal_name": "HK Stock Exchange Calendar", + "description": "Hong Kong Stock Exchange trading days calendar", + "timezone": "Asia/Shanghai", + "kind": "personal", + "extra_cal_ids": [ + "zh-cn.china.official" + ], + "created_at": 1702968470, + "updated_at": 1775188967, + "creator_id": 2451002751131, + "updated_by": 3790925372131, + "status": "enabled" + } + ], + "total": 8 + } } } } @@ -1900,33 +1817,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AddIncidentResponderRequest" + "$ref": "#/components/schemas/CalendarListRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "person_ids": [ - 2476444212131, - 2476444212132 - ] + "kind": "personal" } } } } } }, - "/incident/field/reset": { + "/calendar/update": { "post": { - "operationId": "incidentFieldReset", - "summary": "更新故障自定义字段", - "description": "更新故障的自定义字段值。", + "operationId": "calendarUpdate", + "summary": "更新服务日历", + "description": "更新个人服务日历,仅更新传入的非空字段。", "tags": [ - "On-call/故障管理" + "On-call/日历管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-field-reset", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **服务日历管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/calendars/calendar-update", "metadata": { - "sidebarTitle": "更新故障自定义字段" + "sidebarTitle": "更新服务日历" } }, "responses": { @@ -1943,7 +1856,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/CalendarEmptyObject" } } } @@ -1974,36 +1887,43 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResetIncidentFieldRequest" + "$ref": "#/components/schemas/CalendarUpdateRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "field_name": "affected_service", - "field_value": "payment-service" + "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", + "cal_name": "Production On-Call Calendar (Updated)", + "timezone": "America/New_York", + "workdays": [ + 1, + 2, + 3, + 4, + 5 + ] } } } } } }, - "/incident/custom-action/do": { + "/change/list": { "post": { - "operationId": "incidentCustomActionDo", - "summary": "执行自定义操作", - "description": "执行为故障配置的自定义操作。", + "operationId": "change-read-list", + "summary": "查询变更列表", + "description": "在指定时间窗口内查询变更记录,支持过滤、搜索与分页。", "tags": [ - "On-call/故障管理" + "On-call/变更管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-custom-action-do", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", + "href": "/zh/api-reference/on-call/changes/change-read-list", "metadata": { - "sidebarTitle": "执行自定义操作" + "sidebarTitle": "查询变更列表" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { @@ -2015,7 +1935,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DoIncidentCustomActionResponse" + "$ref": "#/components/schemas/ListChangeResponse" } } } @@ -2024,7 +1944,31 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "message": "" + "total": 1, + "has_next_page": false, + "items": [ + { + "change_id": "664a1b2c3d4e5f6a7b8c9d0e", + "account_id": 10001, + "channel_id": 5001, + "channel_name": "Production", + "channel_status": "active", + "integration_id": 362, + "integration_name": "GitHub Deploy", + "title": "Deploy api-server v2.3.1", + "description": "Rolling deploy to production cluster", + "change_key": "deploy-api-server-2311", + "change_status": "Done", + "start_time": 1716962400, + "last_time": 1716962700, + "end_time": 1716963000, + "labels": { + "service": "api-server", + "env": "prod" + }, + "link": "https://github.com/acme/api-server/actions/runs/123" + } + ] } } } @@ -2048,30 +1992,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DoIncidentCustomActionRequest" + "$ref": "#/components/schemas/ListChangeRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "integration_id": 2490562293131 + "start_time": 1716960000, + "end_time": 1717046400, + "p": 1, + "limit": 10, + "integration_ids": [ + 362 + ], + "orderby": "start_time", + "asc": false, + "include_events": false } } } } } }, - "/incident/war-room/detail": { + "/channel/create": { "post": { - "operationId": "incidentWarRoomDetail", - "summary": "获取战情室详情", - "description": "获取故障的战情室配置和成员信息。", + "operationId": "channelCreate", + "summary": "创建协作空间", + "description": "创建一个新的协作空间用于故障管理。", "tags": [ - "On-call/故障管理" + "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-war-room-detail", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-create", "metadata": { - "sidebarTitle": "获取战情室详情" + "sidebarTitle": "创建协作空间" } }, "responses": { @@ -2088,7 +2040,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/WarRoom" + "$ref": "#/components/schemas/ChannelCreateResponse" } } } @@ -2097,9 +2049,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "chat_id": "oc_a0553eda9014c2de1b3a8f75b4e0c000", - "chat_name": "Incident #0E83EE war room", - "share_link": "" + "channel_id": 6294542005131, + "channel_name": "API Test Channel" } } } @@ -2123,30 +2074,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetWarRoomDetailRequest" + "$ref": "#/components/schemas/CreateChannelRequest" }, "example": { - "integration_id": 2490562293131, - "chat_id": "oc_a0553eda9014c2de1b3a8f75b4e0c000" + "team_id": 3521074710131, + "channel_name": "Production Alerts", + "description": "Handles all production environment alerts", + "group": { + "method": "p", + "time_window": 10, + "window_type": "tumbling" + }, + "auto_resolve_timeout": 86400, + "auto_resolve_mode": "trigger" } } } } } }, - "/incident/war-room/list": { + "/channel/delete": { "post": { - "operationId": "incidentWarRoomList", - "summary": "查询战情室列表", - "description": "查询故障关联的所有战情室。", + "operationId": "channelDelete", + "summary": "删除协作空间", + "description": "删除协作空间及其所有关联配置。", "tags": [ - "On-call/故障管理" + "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-war-room-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-delete", "metadata": { - "sidebarTitle": "查询战情室列表" + "sidebarTitle": "删除协作空间" } }, "responses": { @@ -2163,7 +2122,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListWarRoomsResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -2171,9 +2130,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [] - } + "data": {} } } } @@ -2196,29 +2153,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListWarRoomsRequest" + "$ref": "#/components/schemas/ChannelIDRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee" + "channel_id": 3521074710131 } } } } } }, - "/incident/war-room/create": { + "/channel/disable": { "post": { - "operationId": "incidentWarRoomCreate", - "summary": "创建战情室", - "description": "为故障协同响应创建战情室频道。", + "operationId": "channelDisable", + "summary": "禁用协作空间", + "description": "禁用协作空间以停止故障路由,而不删除该空间。", "tags": [ - "On-call/故障管理" + "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-war-room-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-disable", "metadata": { - "sidebarTitle": "创建战情室" + "sidebarTitle": "禁用协作空间" } }, "responses": { @@ -2235,7 +2192,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/WarRoom" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -2243,11 +2200,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "chat_id": "oc_a0553eda9014c2de1b3a8f75b4e0c000", - "chat_name": "Incident #0E83EE war room", - "share_link": "" - } + "data": {} } } } @@ -2270,31 +2223,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateWarRoomRequest" + "$ref": "#/components/schemas/ChannelIDRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "integration_id": 2490562293131, - "add_observers": true + "channel_id": 3521074710131 } } } } } }, - "/incident/war-room/delete": { + "/channel/enable": { "post": { - "operationId": "incidentWarRoomDelete", - "summary": "删除战情室", - "description": "删除指定的故障战情室。", + "operationId": "channelEnable", + "summary": "启用协作空间", + "description": "启用已禁用的协作空间以恢复故障路由。", "tags": [ - "On-call/故障管理" + "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-war-room-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-enable", "metadata": { - "sidebarTitle": "删除战情室" + "sidebarTitle": "启用协作空间" } }, "responses": { @@ -2342,30 +2293,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteWarRoomRequest" + "$ref": "#/components/schemas/ChannelIDRequest" }, "example": { - "incident_id": "69da451ef77b1b51f40e83ee", - "integration_id": 2490562293131 + "channel_id": 3521074710131 } } } } } }, - "/incident/post-mortem/info": { - "get": { - "operationId": "incidentPostMortemInfo", - "summary": "获取复盘报告", - "description": "通过 `post_mortem_id` 获取复盘报告。先用 `/incident/post-mortem/list` 列出报告(每行标明所属故障),再用其 id 在此获取完整报告。", + "/channel/escalate/rule/create": { + "post": { + "operationId": "channelEscalateRuleCreate", + "summary": "创建分派策略", + "description": "创建分派策略,定义故障发生时通知谁以及何时通知。", "tags": [ - "On-call/故障管理" + "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-post-mortem-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-escalate-rule-create", "metadata": { - "sidebarTitle": "获取复盘报告" + "sidebarTitle": "创建分派策略" } }, "responses": { @@ -2382,7 +2332,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PostMortemItem" + "$ref": "#/components/schemas/RuleCreateResponse" } } } @@ -2391,43 +2341,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "meta": { - "account_id": 2451002751131, - "title": "Postmortem1", - "status": "published", - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", - "template_id": "post_mortem_default_tmpl_en-us", - "incident_ids": [ - "69bb9233331067560c718ecd" - ], - "media_count": 0, - "author_ids": [ - 2477273692131 - ], - "team_id": 2477033058131, - "channel_id": 3047621227131, - "is_private": false, - "channel_name": "Ops Channel", - "created_at_seconds": 1773900354, - "updated_at_seconds": 1773909012 - }, - "basics": { - "incidents_highest_severity": "Warning", - "incidents_earliest_start_seconds": 1761133512, - "incidents_latest_close_seconds": 1761133632, - "incidents_total_duration_seconds": 120, - "responders": [ - { - "person_id": 3790925372131, - "assigned_at": 1761133515, - "acknowledged_at": 0 - } - ] - }, - "content": { - "content": "{\"type\":\"doc\",\"content\":[]}" - }, - "follow_ups": "" + "rule_id": "69db2f72a0fe7db6448b1506", + "rule_name": "Test escalation rule" } } } @@ -2446,32 +2361,53 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "post_mortem_id", - "in": "query", - "required": true, - "schema": { - "type": "string" - }, - "description": "Post-mortem ID. Deterministic hash derived from account ID and the set of linked incident IDs." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateEscalationRuleRequest" + }, + "example": { + "channel_id": 3521074710131, + "rule_name": "On-call escalation", + "template_id": "6321aad26c12104586a88916", + "description": "Notify primary on-call, then escalate to secondary after 30 minutes", + "layers": [ + { + "target": { + "person_ids": [ + 3790925372131 + ], + "by": { + "follow_preference": true + } + }, + "max_times": 3, + "notify_step": 10, + "escalate_window": 30, + "force_escalate": false + } + ] + } + } } - ] + } } }, - "/incident/post-mortem/list": { + "/channel/escalate/rule/delete": { "post": { - "operationId": "incidentPostMortemList", - "summary": "查询复盘报告列表", - "description": "分页查询复盘报告列表,支持过滤条件。", + "operationId": "channelEscalateRuleDelete", + "summary": "删除分派策略", + "description": "删除指定的分派策略。", "tags": [ - "On-call/故障管理" + "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-post-mortem-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-escalate-rule-delete", "metadata": { - "sidebarTitle": "查询复盘报告列表" + "sidebarTitle": "删除分派策略" } }, "responses": { @@ -2488,7 +2424,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListPostMortemsResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -2496,32 +2432,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 3, - "has_next_page": false, - "items": [ - { - "account_id": 2451002751131, - "title": "Postmortem1", - "status": "published", - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", - "template_id": "post_mortem_default_tmpl_en-us", - "incident_ids": [ - "69bb9233331067560c718ecd" - ], - "media_count": 0, - "author_ids": [ - 2477273692131 - ], - "team_id": 2477033058131, - "channel_id": 3047621227131, - "is_private": false, - "channel_name": "Ops Channel", - "created_at_seconds": 1773900354, - "updated_at_seconds": 1773909012 - } - ] - } + "data": {} } } } @@ -2544,31 +2455,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListPostMortemsRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { - "status": "published", - "p": 1, - "limit": 20 + "channel_id": 3521074710131, + "rule_id": "6621b23f4a2c5e0012ab34cd" } } } } } }, - "/incident/post-mortem/delete": { + "/channel/escalate/rule/disable": { "post": { - "operationId": "incidentPostMortemDelete", - "summary": "删除复盘报告", - "description": "删除指定的复盘报告。", + "operationId": "channelEscalateRuleDisable", + "summary": "禁用分派策略", + "description": "禁用分派策略而不删除。", "tags": [ - "On-call/故障管理" + "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/incident-post-mortem-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-escalate-rule-disable", "metadata": { - "sidebarTitle": "删除复盘报告" + "sidebarTitle": "禁用分派策略" } }, "responses": { @@ -2616,29 +2526,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeletePostMortemRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e" + "channel_id": 3521074710131, + "rule_id": "6621b23f4a2c5e0012ab34cd" } } } } } }, - "/channel/info": { + "/channel/escalate/rule/enable": { "post": { - "operationId": "channelInfo", - "summary": "获取协作空间详情", - "description": "获取指定协作空间的详细信息。", + "operationId": "channelEscalateRuleEnable", + "summary": "启用分派策略", + "description": "启用已禁用的分派策略。", "tags": [ "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/channels/channel-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-escalate-rule-enable", "metadata": { - "sidebarTitle": "获取协作空间详情" + "sidebarTitle": "启用分派策略" } }, "responses": { @@ -2655,7 +2566,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ChannelItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -2663,12 +2574,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "channel_id": 1001, - "channel_name": "Production Alerts", - "status": "enabled", - "team_id": 10 - } + "data": {} } } } @@ -2691,29 +2597,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelInfoRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { - "channel_id": 1001 + "channel_id": 3521074710131, + "rule_id": "6621b23f4a2c5e0012ab34cd" } } } } } }, - "/channel/list": { + "/channel/escalate/rule/info": { "post": { - "operationId": "channelList", - "summary": "查询协作空间列表", - "description": "查询当前用户可访问的协作空间列表,支持过滤条件。", + "operationId": "channelEscalateRuleInfo", + "summary": "获取分派策略详情", + "description": "获取指定分派策略的详细信息。", "tags": [ "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/channels/channel-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-escalate-rule-info", "metadata": { - "sidebarTitle": "查询协作空间列表" + "sidebarTitle": "获取分派策略详情" } }, "responses": { @@ -2730,7 +2637,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListChannelsResponse" + "$ref": "#/components/schemas/EscalateRuleItem" } } } @@ -2739,15 +2646,37 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 42, - "has_next_page": true, - "items": [ + "account_id": 2451002751131, + "channel_id": 6193426913131, + "priority": 0, + "aggr_window": 0, + "rule_name": "Default", + "description": "", + "layers": [ { - "channel_id": 1001, - "channel_name": "Production Alerts", - "status": "enabled" + "max_times": 1, + "notify_step": 10, + "target": { + "person_ids": [ + 3790925372131 + ], + "by": { + "follow_preference": true + }, + "webhooks": null + }, + "escalate_window": 30, + "force_escalate": false } - ] + ], + "time_filters": [], + "filters": [], + "status": "enabled", + "template_id": "6321aad26c12104586a88916", + "rule_id": "69bd0ce95a238693176c1d66", + "updated_by": 3790925372131, + "created_at": 1773997289, + "updated_at": 1773997289 } } } @@ -2771,32 +2700,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListChannelsRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { - "p": 1, - "limit": 20, - "orderby": "created_at", - "asc": false + "channel_id": 1001, + "rule_id": "6621b23f4a2c5e0012ab34d0" } } } } } }, - "/channel/infos": { + "/channel/escalate/rule/list": { "post": { - "operationId": "channelInfos", - "summary": "批量获取协作空间", - "description": "通过 ID 列表批量获取协作空间信息。", + "operationId": "channelEscalateRuleList", + "summary": "查询分派策略列表", + "description": "查询协作空间下的所有分派策略。", "tags": [ "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/channels/channel-infos", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-escalate-rule-list", "metadata": { - "sidebarTitle": "批量获取协作空间" + "sidebarTitle": "查询分派策略列表" } }, "responses": { @@ -2813,7 +2740,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ChannelInfosResponse" + "$ref": "#/components/schemas/ListEscalationRulesResponse" } } } @@ -2824,9 +2751,37 @@ "data": { "items": [ { - "channel_id": 1001, - "channel_name": "Production Alerts", - "status": "enabled" + "account_id": 2451002751131, + "channel_id": 6193426913131, + "priority": 0, + "aggr_window": 0, + "rule_name": "Default", + "description": "", + "layers": [ + { + "max_times": 1, + "notify_step": 10, + "target": { + "person_ids": [ + 3790925372131 + ], + "by": { + "follow_preference": true + }, + "webhooks": null + }, + "escalate_window": 30, + "force_escalate": false + } + ], + "time_filters": [], + "filters": [], + "status": "enabled", + "template_id": "6321aad26c12104586a88916", + "rule_id": "69bd0ce95a238693176c1d66", + "updated_by": 3790925372131, + "created_at": 1773997289, + "updated_at": 1773997289 } ] } @@ -2852,32 +2807,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelInfosRequest" + "$ref": "#/components/schemas/ChannelScopedListRequest" }, "example": { - "channel_ids": [ - 1001, - 1002 - ] + "channel_id": 1001 } } } } } }, - "/channel/create": { + "/channel/escalate/rule/update": { "post": { - "operationId": "channelCreate", - "summary": "创建协作空间", - "description": "创建一个新的协作空间用于故障管理。", + "operationId": "channelEscalateRuleUpdate", + "summary": "更新分派策略", + "description": "更新已有分派策略的配置。", "tags": [ "On-call/协作空间" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-create", + "href": "/zh/api-reference/on-call/channels/channel-escalate-rule-update", "metadata": { - "sidebarTitle": "创建协作空间" + "sidebarTitle": "更新分派策略" } }, "responses": { @@ -2894,7 +2846,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ChannelCreateResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -2902,10 +2854,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "channel_id": 6294542005131, - "channel_name": "API Test Channel" - } + "data": {} } } } @@ -2928,38 +2877,49 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateChannelRequest" + "$ref": "#/components/schemas/UpdateEscalationRuleRequest" }, "example": { - "team_id": 3521074710131, - "channel_name": "Production Alerts", - "description": "Handles all production environment alerts", - "group": { - "method": "p", - "time_window": 10, - "window_type": "tumbling" - }, - "auto_resolve_timeout": 86400, - "auto_resolve_mode": "trigger" + "channel_id": 1001, + "rule_id": "6621b23f4a2c5e0012ab34d0", + "template_id": "6621b23f4a2c5e0012ab34d1", + "rule_name": "Default escalation", + "layers": [ + { + "target": { + "person_ids": [ + 42 + ], + "by": { + "critical": [ + "voice" + ], + "warning": [ + "sms" + ] + } + } + } + ] } } } } } }, - "/channel/update": { + "/channel/escalate/webhook/robot/list": { "post": { - "operationId": "channelUpdate", - "summary": "更新协作空间", - "description": "更新已有协作空间的配置和设置。", + "operationId": "channelEscalateWebhookRobotList", + "summary": "查询分派策略中的群聊机器人列表", + "description": "查询当前账户下所有分派策略中配置的群聊机器人(Webhook),返回去重后的机器人列表及其被哪些协作空间/分派策略引用。", "tags": [ "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n该接口用于查询当前账户下所有分派策略中配置的 IM 群聊机器人。系统会遍历所有分派策略的所有环节,提取其中配置的 Webhook 机器人(排除应用类型 `_app` 后缀的),按 `type + token` 去重后返回。\n\n每个机器人附带 `referenced_by` 列表,标明该机器人被哪些协作空间和分派策略引用,便于进行机器人的统一管理和影响范围评估。\n\n支持通过 `type` 筛选特定类型的机器人(如 `feishu`、`dingtalk`、`wecom`、`slack`、`teams` 等),也支持通过 `query` 对机器人的别名或 token 进行模糊搜索。", + "href": "/zh/api-reference/on-call/channels/channel-escalate-webhook-robot-list", "metadata": { - "sidebarTitle": "更新协作空间" + "sidebarTitle": "查询群聊机器人列表" } }, "responses": { @@ -2976,7 +2936,53 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/UpdateChannelResponse" + "type": "object", + "properties": { + "list": { + "type": "array", + "description": "去重后的群聊机器人列表。", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "机器人类型,如 `feishu`、`dingtalk`、`wecom`、`slack`、`teams` 等。" + }, + "settings": { + "type": "object", + "description": "机器人配置,包含 `token`(Webhook 地址或密钥)和 `alias`(机器人别名)等字段。", + "additionalProperties": true + }, + "referenced_by": { + "type": "array", + "description": "引用该机器人的协作空间和分派策略列表。", + "items": { + "type": "object", + "properties": { + "channel_id": { + "type": "integer", + "format": "int64", + "description": "协作空间 ID。" + }, + "channel_name": { + "type": "string", + "description": "协作空间名称。" + }, + "escalate_rule_id": { + "type": "string", + "description": "分派策略 ID(MongoDB ObjectID)。" + }, + "escalate_rule_name": { + "type": "string", + "description": "分派策略名称。" + } + } + } + } + } + } + } + } } } } @@ -2985,7 +2991,44 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "external_report_token": "" + "list": [ + { + "type": "feishu", + "settings": { + "token": "https://open.feishu.cn/open-apis/bot/v2/hook/xxx", + "alias": "运维告警群" + }, + "referenced_by": [ + { + "channel_id": 6193426913131, + "channel_name": "订单系统", + "escalate_rule_id": "69bd0ce95a238693176c1d66", + "escalate_rule_name": "默认分派策略" + }, + { + "channel_id": 6193426913132, + "channel_name": "支付系统", + "escalate_rule_id": "69bd0ce95a238693176c1d67", + "escalate_rule_name": "核心告警" + } + ] + }, + { + "type": "dingtalk", + "settings": { + "token": "https://oapi.dingtalk.com/robot/send?access_token=xxx", + "alias": "DBA 群" + }, + "referenced_by": [ + { + "channel_id": 6193426913131, + "channel_name": "订单系统", + "escalate_rule_id": "69bd0ce95a238693176c1d66", + "escalate_rule_name": "默认分派策略" + } + ] + } + ] } } } @@ -3009,31 +3052,40 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateChannelRequest" + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "搜索关键词,按机器人别名(alias)或 token 模糊匹配,不区分大小写。" + }, + "type": { + "type": "string", + "description": "按机器人类型过滤,如 `feishu`、`dingtalk`、`wecom`、`slack`、`teams` 等。不传则返回所有类型。" + } + } }, "example": { - "channel_id": 1001, - "channel_name": "生产告警(v2)", - "description": "更新后的描述" + "query": "运维", + "type": "feishu" } } } } } }, - "/channel/delete": { + "/channel/info": { "post": { - "operationId": "channelDelete", - "summary": "删除协作空间", - "description": "删除协作空间及其所有关联配置。", + "operationId": "channelInfo", + "summary": "获取协作空间详情", + "description": "获取指定协作空间的详细信息。", "tags": [ "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/channels/channel-info", "metadata": { - "sidebarTitle": "删除协作空间" + "sidebarTitle": "获取协作空间详情" } }, "responses": { @@ -3050,7 +3102,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ChannelItem" } } } @@ -3058,7 +3110,12 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "channel_id": 1001, + "channel_name": "Production Alerts", + "status": "enabled", + "team_id": 10 + } } } } @@ -3081,29 +3138,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelIDRequest" + "$ref": "#/components/schemas/ChannelInfoRequest" }, "example": { - "channel_id": 3521074710131 + "channel_id": 1001 } } } } } }, - "/channel/enable": { + "/channel/infos": { "post": { - "operationId": "channelEnable", - "summary": "启用协作空间", - "description": "启用已禁用的协作空间以恢复故障路由。", + "operationId": "channelInfos", + "summary": "批量获取协作空间", + "description": "通过 ID 列表批量获取协作空间信息。", "tags": [ "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-enable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/channels/channel-infos", "metadata": { - "sidebarTitle": "启用协作空间" + "sidebarTitle": "批量获取协作空间" } }, "responses": { @@ -3120,7 +3177,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ChannelInfosResponse" } } } @@ -3128,7 +3185,15 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "channel_id": 1001, + "channel_name": "Production Alerts", + "status": "enabled" + } + ] + } } } } @@ -3151,29 +3216,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelIDRequest" + "$ref": "#/components/schemas/ChannelInfosRequest" }, "example": { - "channel_id": 3521074710131 + "channel_ids": [ + 1001, + 1002 + ] } } } } } }, - "/channel/disable": { + "/channel/inhibit/rule/create": { "post": { - "operationId": "channelDisable", - "summary": "禁用协作空间", - "description": "禁用协作空间以停止故障路由,而不删除该空间。", + "operationId": "channelInhibitRuleCreate", + "summary": "创建抑制策略", + "description": "创建一条抑制策略,当高优先级告警触发时抑制低优先级告警。", "tags": [ "On-call/协作空间" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-disable", + "href": "/zh/api-reference/on-call/channels/channel-inhibit-rule-create", "metadata": { - "sidebarTitle": "禁用协作空间" + "sidebarTitle": "创建抑制策略" } }, "responses": { @@ -3190,7 +3258,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/RuleCreateResponse" } } } @@ -3198,7 +3266,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "rule_id": "69db2f69a0fe7db6448b1504", + "rule_name": "Test inhibit rule" + } } } } @@ -3221,29 +3292,58 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelIDRequest" + "$ref": "#/components/schemas/CreateInhibitRuleRequest" }, "example": { - "channel_id": 3521074710131 + "channel_id": 3521074710131, + "rule_name": "Suppress Info when Critical fires", + "description": "When a Critical alert fires, suppress matching Info alerts", + "equals": [ + "labels.cluster", + "labels.service" + ], + "source_filters": [ + [ + { + "key": "severity", + "oper": "IN", + "vals": [ + "Critical" + ] + } + ] + ], + "target_filters": [ + [ + { + "key": "severity", + "oper": "IN", + "vals": [ + "Info" + ] + } + ] + ], + "is_directly_discard": false } } } } } }, - "/channel/silence/rule/list": { + "/channel/inhibit/rule/delete": { "post": { - "operationId": "channelSilenceRuleList", - "summary": "查询静默策略列表", - "description": "查询为指定协作空间配置的所有静默策略。", + "operationId": "channelInhibitRuleDelete", + "summary": "删除抑制策略", + "description": "删除指定的抑制策略。", "tags": [ "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-silence-rule-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-inhibit-rule-delete", "metadata": { - "sidebarTitle": "查询静默策略列表" + "sidebarTitle": "删除抑制策略" } }, "responses": { @@ -3260,7 +3360,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListSilenceRulesResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -3268,41 +3368,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "account_id": 2451002751131, - "channel_id": 5967964835131, - "priority": 0, - "rule_name": "Silence Info alerts", - "description": "", - "from_incident_id": "000000000000000000000000", - "time_filters": [], - "time_filter": { - "start_time": 1773388800, - "end_time": 1773414000 - }, - "filters": [ - [ - { - "key": "severity", - "oper": "IN", - "vals": [ - "Info" - ] - } - ] - ], - "is_directly_discard": true, - "status": "enabled", - "rule_id": "69b3c426b4a6f5abf1f54873", - "updated_by": 3790925372131, - "created_at": 1773388838, - "updated_at": 1773388838, - "is_effective": false - } - ] - } + "data": {} } } } @@ -3325,29 +3391,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelScopedListRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { - "channel_id": 1001 + "channel_id": 3521074710131, + "rule_id": "6621b23f4a2c5e0012ab34cd" } } } } } }, - "/channel/silence/rule/create": { + "/channel/inhibit/rule/disable": { "post": { - "operationId": "channelSilenceRuleCreate", - "summary": "创建静默策略", - "description": "创建一条静默策略,用于抑制满足特定条件的通知。", + "operationId": "channelInhibitRuleDisable", + "summary": "禁用抑制策略", + "description": "禁用抑制策略而不删除。", "tags": [ "On-call/协作空间" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-silence-rule-create", + "href": "/zh/api-reference/on-call/channels/channel-inhibit-rule-disable", "metadata": { - "sidebarTitle": "创建静默策略" + "sidebarTitle": "禁用抑制策略" } }, "responses": { @@ -3364,7 +3431,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleCreateResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -3372,10 +3439,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "rule_id": "69db2f66a0fe7db6448b1503", - "rule_name": "Test silence rule" - } + "data": {} } } } @@ -3398,134 +3462,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateSilenceRuleRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { "channel_id": 3521074710131, - "rule_name": "Maintenance window silence", - "description": "Silence all Info alerts during planned maintenance", - "time_filter": { - "start_time": 1773388800, - "end_time": 1773414000 - }, - "filters": [ - [ - { - "key": "severity", - "oper": "IN", - "vals": [ - "Info" - ] - } - ] - ], - "is_directly_discard": false - } - } - } - } - } - }, - "/channel/silence/rule/update": { - "post": { - "operationId": "channelSilenceRuleUpdate", - "summary": "更新静默策略", - "description": "更新已有静默策略的配置。", - "tags": [ - "On-call/协作空间" - ], - "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-silence-rule-update", - "metadata": { - "sidebarTitle": "更新静默策略" - } - }, - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateSilenceRuleRequest" - }, - "example": { - "channel_id": 1001, - "rule_id": "6621b23f4a2c5e0012ab34cd", - "rule_name": "Mute during maintenance", - "time_filter": { - "start_time": 1710000000, - "end_time": 1710086400 - }, - "filters": [ - [ - { - "key": "labels.service", - "oper": "IN", - "vals": [ - "billing" - ] - } - ] - ] + "rule_id": "6621b23f4a2c5e0012ab34cd" } } } } } }, - "/channel/silence/rule/delete": { + "/channel/inhibit/rule/enable": { "post": { - "operationId": "channelSilenceRuleDelete", - "summary": "删除静默策略", - "description": "删除指定的静默策略。", + "operationId": "channelInhibitRuleEnable", + "summary": "启用抑制策略", + "description": "启用已禁用的抑制策略。", "tags": [ "On-call/协作空间" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-silence-rule-delete", + "href": "/zh/api-reference/on-call/channels/channel-inhibit-rule-enable", "metadata": { - "sidebarTitle": "删除静默策略" + "sidebarTitle": "启用抑制策略" } }, "responses": { @@ -3584,19 +3544,19 @@ } } }, - "/channel/silence/rule/enable": { + "/channel/inhibit/rule/list": { "post": { - "operationId": "channelSilenceRuleEnable", - "summary": "启用静默策略", - "description": "启用已禁用的静默策略。", + "operationId": "channelInhibitRuleList", + "summary": "查询抑制策略列表", + "description": "查询为指定协作空间配置的所有抑制策略。", "tags": [ "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-silence-rule-enable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-inhibit-rule-list", "metadata": { - "sidebarTitle": "启用静默策略" + "sidebarTitle": "查询抑制策略列表" } }, "responses": { @@ -3613,7 +3573,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ListInhibitRulesResponse" } } } @@ -3621,7 +3581,49 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "account_id": 2451002751131, + "channel_id": 5967964835131, + "priority": 0, + "rule_name": "Suppress downstream alerts", + "description": "", + "source_filters": [ + [ + { + "key": "severity", + "oper": "IN", + "vals": [ + "Info" + ] + } + ] + ], + "target_filters": [ + [ + { + "key": "severity", + "oper": "IN", + "vals": [ + "Info" + ] + } + ] + ], + "equals": [ + "data_source_id", + "labels._account_id" + ], + "is_directly_discard": false, + "status": "enabled", + "rule_id": "69bcc630b9e63df36603e425", + "updated_by": 3790925372131, + "created_at": 1773979184, + "updated_at": 1773979184 + } + ] + } } } } @@ -3644,30 +3646,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/ChannelScopedListRequest" }, "example": { - "channel_id": 3521074710131, - "rule_id": "6621b23f4a2c5e0012ab34cd" + "channel_id": 1001 } } } } } }, - "/channel/silence/rule/disable": { + "/channel/inhibit/rule/update": { "post": { - "operationId": "channelSilenceRuleDisable", - "summary": "禁用静默策略", - "description": "禁用静默策略而不删除。", + "operationId": "channelInhibitRuleUpdate", + "summary": "更新抑制策略", + "description": "更新已有抑制策略的配置。", "tags": [ "On-call/协作空间" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-silence-rule-disable", + "href": "/zh/api-reference/on-call/channels/channel-inhibit-rule-update", "metadata": { - "sidebarTitle": "禁用静默策略" + "sidebarTitle": "更新抑制策略" } }, "responses": { @@ -3715,30 +3716,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/UpdateInhibitRuleRequest" }, "example": { - "channel_id": 3521074710131, - "rule_id": "6621b23f4a2c5e0012ab34cd" + "channel_id": 1001, + "rule_id": "6621b23f4a2c5e0012ab34ce", + "rule_name": "Suppress downstream", + "equals": [ + "labels.cluster" + ] } } } } } }, - "/channel/inhibit/rule/list": { + "/channel/list": { "post": { - "operationId": "channelInhibitRuleList", - "summary": "查询抑制策略列表", - "description": "查询为指定协作空间配置的所有抑制策略。", + "operationId": "channelList", + "summary": "查询协作空间列表", + "description": "查询当前用户可访问的协作空间列表,支持过滤条件。", "tags": [ "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-inhibit-rule-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/channels/channel-list", "metadata": { - "sidebarTitle": "查询抑制策略列表" + "sidebarTitle": "查询协作空间列表" } }, "responses": { @@ -3755,7 +3760,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListInhibitRulesResponse" + "$ref": "#/components/schemas/ListChannelsResponse" } } } @@ -3764,45 +3769,13 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "total": 42, + "has_next_page": true, "items": [ { - "account_id": 2451002751131, - "channel_id": 5967964835131, - "priority": 0, - "rule_name": "Suppress downstream alerts", - "description": "", - "source_filters": [ - [ - { - "key": "severity", - "oper": "IN", - "vals": [ - "Info" - ] - } - ] - ], - "target_filters": [ - [ - { - "key": "severity", - "oper": "IN", - "vals": [ - "Info" - ] - } - ] - ], - "equals": [ - "data_source_id", - "labels._account_id" - ], - "is_directly_discard": false, - "status": "enabled", - "rule_id": "69bcc630b9e63df36603e425", - "updated_by": 3790925372131, - "created_at": 1773979184, - "updated_at": 1773979184 + "channel_id": 1001, + "channel_name": "Production Alerts", + "status": "enabled" } ] } @@ -3828,29 +3801,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelScopedListRequest" + "$ref": "#/components/schemas/ListChannelsRequest" }, "example": { - "channel_id": 1001 + "p": 1, + "limit": 20, + "orderby": "created_at", + "asc": false } } } } } }, - "/channel/inhibit/rule/create": { + "/channel/silence/rule/create": { "post": { - "operationId": "channelInhibitRuleCreate", - "summary": "创建抑制策略", - "description": "创建一条抑制策略,当高优先级告警触发时抑制低优先级告警。", + "operationId": "channelSilenceRuleCreate", + "summary": "创建静默策略", + "description": "创建一条静默策略,用于抑制满足特定条件的通知。", "tags": [ "On-call/协作空间" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-inhibit-rule-create", + "href": "/zh/api-reference/on-call/channels/channel-silence-rule-create", "metadata": { - "sidebarTitle": "创建抑制策略" + "sidebarTitle": "创建静默策略" } }, "responses": { @@ -3876,8 +3852,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "rule_id": "69db2f69a0fe7db6448b1504", - "rule_name": "Test inhibit rule" + "rule_id": "69db2f66a0fe7db6448b1503", + "rule_name": "Test silence rule" } } } @@ -3901,28 +3877,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateInhibitRuleRequest" + "$ref": "#/components/schemas/CreateSilenceRuleRequest" }, "example": { "channel_id": 3521074710131, - "rule_name": "Suppress Info when Critical fires", - "description": "When a Critical alert fires, suppress matching Info alerts", - "equals": [ - "labels.cluster", - "labels.service" - ], - "source_filters": [ - [ - { - "key": "severity", - "oper": "IN", - "vals": [ - "Critical" - ] - } - ] - ], - "target_filters": [ + "rule_name": "Maintenance window silence", + "description": "Silence all Info alerts during planned maintenance", + "time_filter": { + "start_time": 1773388800, + "end_time": 1773414000 + }, + "filters": [ [ { "key": "severity", @@ -3940,19 +3905,19 @@ } } }, - "/channel/inhibit/rule/update": { + "/channel/silence/rule/delete": { "post": { - "operationId": "channelInhibitRuleUpdate", - "summary": "更新抑制策略", - "description": "更新已有抑制策略的配置。", + "operationId": "channelSilenceRuleDelete", + "summary": "删除静默策略", + "description": "删除指定的静默策略。", "tags": [ "On-call/协作空间" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-inhibit-rule-update", + "href": "/zh/api-reference/on-call/channels/channel-silence-rule-delete", "metadata": { - "sidebarTitle": "更新抑制策略" + "sidebarTitle": "删除静默策略" } }, "responses": { @@ -4000,34 +3965,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateInhibitRuleRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { - "channel_id": 1001, - "rule_id": "6621b23f4a2c5e0012ab34ce", - "rule_name": "Suppress downstream", - "equals": [ - "labels.cluster" - ] + "channel_id": 3521074710131, + "rule_id": "6621b23f4a2c5e0012ab34cd" } } } } } }, - "/channel/inhibit/rule/delete": { + "/channel/silence/rule/disable": { "post": { - "operationId": "channelInhibitRuleDelete", - "summary": "删除抑制策略", - "description": "删除指定的抑制策略。", + "operationId": "channelSilenceRuleDisable", + "summary": "禁用静默策略", + "description": "禁用静默策略而不删除。", "tags": [ "On-call/协作空间" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-inhibit-rule-delete", + "href": "/zh/api-reference/on-call/channels/channel-silence-rule-disable", "metadata": { - "sidebarTitle": "删除抑制策略" + "sidebarTitle": "禁用静默策略" } }, "responses": { @@ -4086,19 +4047,19 @@ } } }, - "/channel/inhibit/rule/enable": { + "/channel/silence/rule/enable": { "post": { - "operationId": "channelInhibitRuleEnable", - "summary": "启用抑制策略", - "description": "启用已禁用的抑制策略。", + "operationId": "channelSilenceRuleEnable", + "summary": "启用静默策略", + "description": "启用已禁用的静默策略。", "tags": [ "On-call/协作空间" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-inhibit-rule-enable", + "href": "/zh/api-reference/on-call/channels/channel-silence-rule-enable", "metadata": { - "sidebarTitle": "启用抑制策略" + "sidebarTitle": "启用静默策略" } }, "responses": { @@ -4157,19 +4118,19 @@ } } }, - "/channel/inhibit/rule/disable": { + "/channel/silence/rule/list": { "post": { - "operationId": "channelInhibitRuleDisable", - "summary": "禁用抑制策略", - "description": "禁用抑制策略而不删除。", + "operationId": "channelSilenceRuleList", + "summary": "查询静默策略列表", + "description": "查询为指定协作空间配置的所有静默策略。", "tags": [ "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-inhibit-rule-disable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-silence-rule-list", "metadata": { - "sidebarTitle": "禁用抑制策略" + "sidebarTitle": "查询静默策略列表" } }, "responses": { @@ -4186,7 +4147,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ListSilenceRulesResponse" } } } @@ -4194,7 +4155,41 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "account_id": 2451002751131, + "channel_id": 5967964835131, + "priority": 0, + "rule_name": "Silence Info alerts", + "description": "", + "from_incident_id": "000000000000000000000000", + "time_filters": [], + "time_filter": { + "start_time": 1773388800, + "end_time": 1773414000 + }, + "filters": [ + [ + { + "key": "severity", + "oper": "IN", + "vals": [ + "Info" + ] + } + ] + ], + "is_directly_discard": true, + "status": "enabled", + "rule_id": "69b3c426b4a6f5abf1f54873", + "updated_by": 3790925372131, + "created_at": 1773388838, + "updated_at": 1773388838, + "is_effective": false + } + ] + } } } } @@ -4217,30 +4212,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/ChannelScopedListRequest" }, "example": { - "channel_id": 3521074710131, - "rule_id": "6621b23f4a2c5e0012ab34cd" + "channel_id": 1001 } } } } } }, - "/channel/unsubscribe/rule/list": { + "/channel/silence/rule/update": { "post": { - "operationId": "channelUnsubscribeRuleList", - "summary": "查询排除规则列表", - "description": "查询协作空间的排除规则列表。", + "operationId": "channelSilenceRuleUpdate", + "summary": "更新静默策略", + "description": "更新已有静默策略的配置。", "tags": [ "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/channels/channel-unsubscribe-rule-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-silence-rule-update", "metadata": { - "sidebarTitle": "查询排除规则列表" + "sidebarTitle": "更新静默策略" } }, "responses": { @@ -4257,7 +4251,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListDropRulesResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -4265,33 +4259,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "account_id": 2451002751131, - "channel_id": 5967964835131, - "priority": 0, - "rule_name": "Drop test alerts", - "description": "", - "filters": [ - [ - { - "key": "data_source_id", - "oper": "IN", - "vals": [ - "6113996590131" - ] - } - ] - ], - "status": "enabled", - "rule_id": "69bcc530b9e63df36603e421", - "updated_by": 3790925372131, - "created_at": 1773978928, - "updated_at": 1773978928 - } - ] - } + "data": {} } } } @@ -4314,10 +4282,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelScopedListRequest" + "$ref": "#/components/schemas/UpdateSilenceRuleRequest" }, "example": { - "channel_id": 1001 + "channel_id": 1001, + "rule_id": "6621b23f4a2c5e0012ab34cd", + "rule_name": "Mute during maintenance", + "time_filter": { + "start_time": 1710000000, + "end_time": 1710086400 + }, + "filters": [ + [ + { + "key": "labels.service", + "oper": "IN", + "vals": [ + "billing" + ] + } + ] + ] } } } @@ -4411,19 +4396,19 @@ } } }, - "/channel/unsubscribe/rule/update": { + "/channel/unsubscribe/rule/delete": { "post": { - "operationId": "channelUnsubscribeRuleUpdate", - "summary": "更新排除规则", - "description": "更新已有排除规则的配置。", + "operationId": "channelUnsubscribeRuleDelete", + "summary": "删除排除规则", + "description": "删除指定的排除规则。", "tags": [ "On-call/协作空间" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/channels/channel-unsubscribe-rule-update", + "href": "/zh/api-reference/on-call/channels/channel-unsubscribe-rule-delete", "metadata": { - "sidebarTitle": "更新排除规则" + "sidebarTitle": "删除排除规则" } }, "responses": { @@ -4471,42 +4456,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateDropRuleRequest" + "$ref": "#/components/schemas/ChannelRuleIDRequest" }, "example": { - "channel_id": 1001, - "rule_id": "6621b23f4a2c5e0012ab34cf", - "rule_name": "Drop test alerts", - "filters": [ - [ - { - "key": "labels.env", - "oper": "IN", - "vals": [ - "test" - ] - } - ] - ] + "channel_id": 3521074710131, + "rule_id": "6621b23f4a2c5e0012ab34cd" } } } } } }, - "/channel/unsubscribe/rule/delete": { + "/channel/unsubscribe/rule/disable": { "post": { - "operationId": "channelUnsubscribeRuleDelete", - "summary": "删除排除规则", - "description": "删除指定的排除规则。", + "operationId": "channelUnsubscribeRuleDisable", + "summary": "禁用排除规则", + "description": "禁用排除规则而不删除。", "tags": [ "On-call/协作空间" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/channels/channel-unsubscribe-rule-delete", + "href": "/zh/api-reference/on-call/channels/channel-unsubscribe-rule-disable", "metadata": { - "sidebarTitle": "删除排除规则" + "sidebarTitle": "禁用排除规则" } }, "responses": { @@ -4636,19 +4609,19 @@ } } }, - "/channel/unsubscribe/rule/disable": { + "/channel/unsubscribe/rule/list": { "post": { - "operationId": "channelUnsubscribeRuleDisable", - "summary": "禁用排除规则", - "description": "禁用排除规则而不删除。", + "operationId": "channelUnsubscribeRuleList", + "summary": "查询排除规则列表", + "description": "查询协作空间的排除规则列表。", "tags": [ "On-call/协作空间" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/channels/channel-unsubscribe-rule-disable", + "href": "/zh/api-reference/on-call/channels/channel-unsubscribe-rule-list", "metadata": { - "sidebarTitle": "禁用排除规则" + "sidebarTitle": "查询排除规则列表" } }, "responses": { @@ -4665,7 +4638,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ListDropRulesResponse" } } } @@ -4673,7 +4646,33 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "account_id": 2451002751131, + "channel_id": 5967964835131, + "priority": 0, + "rule_name": "Drop test alerts", + "description": "", + "filters": [ + [ + { + "key": "data_source_id", + "oper": "IN", + "vals": [ + "6113996590131" + ] + } + ] + ], + "status": "enabled", + "rule_id": "69bcc530b9e63df36603e421", + "updated_by": 3790925372131, + "created_at": 1773978928, + "updated_at": 1773978928 + } + ] + } } } } @@ -4696,30 +4695,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/ChannelScopedListRequest" }, "example": { - "channel_id": 3521074710131, - "rule_id": "6621b23f4a2c5e0012ab34cd" + "channel_id": 1001 } } } } } }, - "/channel/escalate/rule/info": { + "/channel/unsubscribe/rule/update": { "post": { - "operationId": "channelEscalateRuleInfo", - "summary": "获取分派策略详情", - "description": "获取指定分派策略的详细信息。", + "operationId": "channelUnsubscribeRuleUpdate", + "summary": "更新排除规则", + "description": "更新已有排除规则的配置。", "tags": [ "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-escalate-rule-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/channels/channel-unsubscribe-rule-update", "metadata": { - "sidebarTitle": "获取分派策略详情" + "sidebarTitle": "更新排除规则" } }, "responses": { @@ -4736,7 +4734,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EscalateRuleItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -4744,39 +4742,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "account_id": 2451002751131, - "channel_id": 6193426913131, - "priority": 0, - "aggr_window": 0, - "rule_name": "Default", - "description": "", - "layers": [ - { - "max_times": 1, - "notify_step": 10, - "target": { - "person_ids": [ - 3790925372131 - ], - "by": { - "follow_preference": true - }, - "webhooks": null - }, - "escalate_window": 30, - "force_escalate": false - } - ], - "time_filters": [], - "filters": [], - "status": "enabled", - "template_id": "6321aad26c12104586a88916", - "rule_id": "69bd0ce95a238693176c1d66", - "updated_by": 3790925372131, - "created_at": 1773997289, - "updated_at": 1773997289 - } + "data": {} } } } @@ -4799,30 +4765,42 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/UpdateDropRuleRequest" }, "example": { "channel_id": 1001, - "rule_id": "6621b23f4a2c5e0012ab34d0" + "rule_id": "6621b23f4a2c5e0012ab34cf", + "rule_name": "Drop test alerts", + "filters": [ + [ + { + "key": "labels.env", + "oper": "IN", + "vals": [ + "test" + ] + } + ] + ] } } } } } }, - "/channel/escalate/webhook/robot/list": { + "/channel/update": { "post": { - "operationId": "channelEscalateWebhookRobotList", - "summary": "查询分派策略中的群聊机器人列表", - "description": "查询当前账户下所有分派策略中配置的群聊机器人(Webhook),返回去重后的机器人列表及其被哪些协作空间/分派策略引用。", + "operationId": "channelUpdate", + "summary": "更新协作空间", + "description": "更新已有协作空间的配置和设置。", "tags": [ "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n该接口用于查询当前账户下所有分派策略中配置的 IM 群聊机器人。系统会遍历所有分派策略的所有环节,提取其中配置的 Webhook 机器人(排除应用类型 `_app` 后缀的),按 `type + token` 去重后返回。\n\n每个机器人附带 `referenced_by` 列表,标明该机器人被哪些协作空间和分派策略引用,便于进行机器人的统一管理和影响范围评估。\n\n支持通过 `type` 筛选特定类型的机器人(如 `feishu`、`dingtalk`、`wecom`、`slack`、`teams` 等),也支持通过 `query` 对机器人的别名或 token 进行模糊搜索。", - "href": "/zh/api-reference/on-call/channels/channel-escalate-webhook-robot-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/channel-update", "metadata": { - "sidebarTitle": "查询群聊机器人列表" + "sidebarTitle": "更新协作空间" } }, "responses": { @@ -4839,53 +4817,7 @@ "type": "object", "properties": { "data": { - "type": "object", - "properties": { - "list": { - "type": "array", - "description": "去重后的群聊机器人列表。", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "机器人类型,如 `feishu`、`dingtalk`、`wecom`、`slack`、`teams` 等。" - }, - "settings": { - "type": "object", - "description": "机器人配置,包含 `token`(Webhook 地址或密钥)和 `alias`(机器人别名)等字段。", - "additionalProperties": true - }, - "referenced_by": { - "type": "array", - "description": "引用该机器人的协作空间和分派策略列表。", - "items": { - "type": "object", - "properties": { - "channel_id": { - "type": "integer", - "format": "int64", - "description": "协作空间 ID。" - }, - "channel_name": { - "type": "string", - "description": "协作空间名称。" - }, - "escalate_rule_id": { - "type": "string", - "description": "分派策略 ID(MongoDB ObjectID)。" - }, - "escalate_rule_name": { - "type": "string", - "description": "分派策略名称。" - } - } - } - } - } - } - } - } + "$ref": "#/components/schemas/UpdateChannelResponse" } } } @@ -4894,44 +4826,7 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "list": [ - { - "type": "feishu", - "settings": { - "token": "https://open.feishu.cn/open-apis/bot/v2/hook/xxx", - "alias": "运维告警群" - }, - "referenced_by": [ - { - "channel_id": 6193426913131, - "channel_name": "订单系统", - "escalate_rule_id": "69bd0ce95a238693176c1d66", - "escalate_rule_name": "默认分派策略" - }, - { - "channel_id": 6193426913132, - "channel_name": "支付系统", - "escalate_rule_id": "69bd0ce95a238693176c1d67", - "escalate_rule_name": "核心告警" - } - ] - }, - { - "type": "dingtalk", - "settings": { - "token": "https://oapi.dingtalk.com/robot/send?access_token=xxx", - "alias": "DBA 群" - }, - "referenced_by": [ - { - "channel_id": 6193426913131, - "channel_name": "订单系统", - "escalate_rule_id": "69bd0ce95a238693176c1d66", - "escalate_rule_name": "默认分派策略" - } - ] - } - ] + "external_report_token": "" } } } @@ -4955,40 +4850,31 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "query": { - "type": "string", - "description": "搜索关键词,按机器人别名(alias)或 token 模糊匹配,不区分大小写。" - }, - "type": { - "type": "string", - "description": "按机器人类型过滤,如 `feishu`、`dingtalk`、`wecom`、`slack`、`teams` 等。不传则返回所有类型。" - } - } + "$ref": "#/components/schemas/UpdateChannelRequest" }, "example": { - "query": "运维", - "type": "feishu" + "channel_id": 1001, + "channel_name": "生产告警(v2)", + "description": "更新后的描述" } } } } } }, - "/channel/escalate/rule/list": { + "/datasource/im/person/try-link": { "post": { - "operationId": "channelEscalateRuleList", - "summary": "查询分派策略列表", - "description": "查询协作空间下的所有分派策略。", + "operationId": "datasourceImPersonTryLink", + "summary": "尝试关联 IM 人员", + "description": "为指定集成尝试将未绑定成员自动关联到对应的 IM 账号。", "tags": [ - "On-call/协作空间" + "On-call/集成中心" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-escalate-rule-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心管理**(`on-call`) |\n\n## 使用说明\n\n- 服务端使用成员邮箱和手机号在钉钉、飞书或企业微信中查找匹配用户。\n- 如果没有成员可关联,响应中的 `new_linked_person_ids` 为空数组。", + "href": "/zh/api-reference/on-call/integrations/datasource-im-person-try-link", "metadata": { - "sidebarTitle": "查询分派策略列表" + "sidebarTitle": "尝试关联 IM 人员" } }, "responses": { @@ -5005,7 +4891,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListEscalationRulesResponse" + "$ref": "#/components/schemas/TryLinkPersonResponse" } } } @@ -5014,40 +4900,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ - { - "account_id": 2451002751131, - "channel_id": 6193426913131, - "priority": 0, - "aggr_window": 0, - "rule_name": "Default", - "description": "", - "layers": [ - { - "max_times": 1, - "notify_step": 10, - "target": { - "person_ids": [ - 3790925372131 - ], - "by": { - "follow_preference": true - }, - "webhooks": null - }, - "escalate_window": 30, - "force_escalate": false - } - ], - "time_filters": [], - "filters": [], - "status": "enabled", - "template_id": "6321aad26c12104586a88916", - "rule_id": "69bd0ce95a238693176c1d66", - "updated_by": 3790925372131, - "created_at": 1773997289, - "updated_at": 1773997289 - } + "new_linked_person_ids": [ + 5348648172131 ] } } @@ -5072,34 +4926,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelScopedListRequest" + "$ref": "#/components/schemas/TryLinkPersonRequest" }, "example": { - "channel_id": 1001 + "integration_id": 6113996590131 } } } } } }, - "/channel/escalate/rule/create": { + "/datasource/im/war-room-enabled/list": { "post": { - "operationId": "channelEscalateRuleCreate", - "summary": "创建分派策略", - "description": "创建分派策略,定义故障发生时通知谁以及何时通知。", + "operationId": "im-war-room-enabled-list", + "summary": "查看开启作战室功能的集成", + "description": "查询账户下已开启作战室功能的 IM 集成。", "tags": [ - "On-call/协作空间" + "On-call/IM 集成" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-escalate-rule-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", + "href": "/zh/api-reference/on-call/integrations/im-war-room-enabled-list", "metadata": { - "sidebarTitle": "创建分派策略" + "sidebarTitle": "查看开启作战室功能的集成" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { @@ -5111,7 +4965,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleCreateResponse" + "$ref": "#/components/schemas/ListWarRoomEnabledResponse" } } } @@ -5120,8 +4974,33 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "rule_id": "69db2f72a0fe7db6448b1506", - "rule_name": "Test escalation rule" + "items": [ + { + "data_source_id": 362, + "account_id": 10001, + "team_id": 0, + "plugin_id": 101, + "name": "Feishu Ops", + "status": "enabled", + "category": "im", + "plugin_type": "feishu", + "plugin_type_name": "Feishu", + "description": "Feishu war-room integration", + "integration_key": "ik_8f3a2b1c9d0e", + "ref_id": "", + "settings": { + "war_room_enabled": true + }, + "no_editable": false, + "creator_id": 20001, + "updated_by": 20001, + "created_at": 1716962400, + "updated_at": 1716962700, + "last_time": 1716963000, + "exclusive_data_source_id": 0, + "integration_id": 362 + } + ] } } } @@ -5145,48 +5024,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateEscalationRuleRequest" + "type": "object" }, - "example": { - "channel_id": 3521074710131, - "rule_name": "On-call escalation", - "template_id": "6321aad26c12104586a88916", - "description": "Notify primary on-call, then escalate to secondary after 30 minutes", - "layers": [ - { - "target": { - "person_ids": [ - 3790925372131 - ], - "by": { - "follow_preference": true - } - }, - "max_times": 3, - "notify_step": 10, - "escalate_window": 30, - "force_escalate": false - } - ] - } + "example": {} } } } } }, - "/channel/escalate/rule/update": { + "/enrichment/info": { "post": { - "operationId": "channelEscalateRuleUpdate", - "summary": "更新分派策略", - "description": "更新已有分派策略的配置。", + "operationId": "enrichment-read-info", + "summary": "查看富化规则", + "description": "返回指定集成配置的告警富化规则集。", "tags": [ - "On-call/协作空间" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-escalate-rule-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) 或 **协作空间管理**(`on-call`) 或 **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) |\n\n## 使用说明\n\n- 若该集成尚未配置富化规则,返回 `null`。", + "href": "/zh/api-reference/on-call/alert-enrichment/enrichment-read-info", "metadata": { - "sidebarTitle": "更新分派策略" + "sidebarTitle": "查看富化规则" } }, "responses": { @@ -5203,7 +5061,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/EnrichmentItem" } } } @@ -5211,7 +5069,25 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "integration_id": 5001, + "rules": [ + { + "kind": "extraction", + "settings": { + "source_field": "labels.env", + "result_label": "environment", + "pattern": "^(prod|staging|dev).*$", + "override": true + } + } + ], + "status": "enabled", + "updated_by": 80011, + "creator_id": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 + } } } } @@ -5234,49 +5110,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateEscalationRuleRequest" + "$ref": "#/components/schemas/EnrichmentInfoRequest" }, "example": { - "channel_id": 1001, - "rule_id": "6621b23f4a2c5e0012ab34d0", - "template_id": "6621b23f4a2c5e0012ab34d1", - "rule_name": "Default escalation", - "layers": [ - { - "target": { - "person_ids": [ - 42 - ], - "by": { - "critical": [ - "voice" - ], - "warning": [ - "sms" - ] - } - } - } - ] + "integration_id": 5001 } } } } } }, - "/channel/escalate/rule/delete": { + "/enrichment/list": { "post": { - "operationId": "channelEscalateRuleDelete", - "summary": "删除分派策略", - "description": "删除指定的分派策略。", + "operationId": "enrichment-read-list", + "summary": "批量查询富化规则", + "description": "批量返回指定集成 ID 列表的告警富化规则集。", "tags": [ - "On-call/协作空间" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-escalate-rule-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/alert-enrichment/enrichment-read-list", "metadata": { - "sidebarTitle": "删除分派策略" + "sidebarTitle": "批量查询富化规则" } }, "responses": { @@ -5293,7 +5149,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/EnrichmentListResponse" } } } @@ -5301,7 +5157,19 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "integration_id": 5001, + "rules": [], + "status": "enabled", + "updated_by": 80011, + "creator_id": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 + } + ] + } } } } @@ -5324,30 +5192,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/EnrichmentListRequest" }, "example": { - "channel_id": 3521074710131, - "rule_id": "6621b23f4a2c5e0012ab34cd" + "integration_ids": [ + 5001, + 5002 + ] } } } } } }, - "/channel/escalate/rule/enable": { + "/enrichment/mapping/api/create": { "post": { - "operationId": "channelEscalateRuleEnable", - "summary": "启用分派策略", - "description": "启用已禁用的分派策略。", + "operationId": "mapping-api-write-create", + "summary": "创建映射 API", + "description": "创建新的外部 HTTP API 端点,用于通过 HTTP 查询富化告警。", "tags": [ - "On-call/协作空间" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-escalate-rule-enable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- `url` 须以 `http://` 或 `https://` 开头,SaaS 模式下不得解析为内网 IP。\n- `timeout` 为 HTTP 读取超时秒数(1–3,默认 2)。\n- `retry_count` 为失败重试次数(0–1,默认 0)。\n- SaaS 模式下,含敏感名称的请求头(如 `authorization`、`cookie`)将被拒绝。\n- 账户最多可创建 50 个映射 API。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-api-write-create", "metadata": { - "sidebarTitle": "启用分派策略" + "sidebarTitle": "创建映射 API" } }, "responses": { @@ -5364,7 +5234,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/MappingAPICreateResponse" } } } @@ -5372,7 +5242,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "api_id": "665f1a2b3c4d5e6f7a8b9c02", + "api_name": "CMDB API" + } } } } @@ -5395,30 +5268,37 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/MappingAPICreateRequest" }, "example": { - "channel_id": 3521074710131, - "rule_id": "6621b23f4a2c5e0012ab34cd" + "api_name": "CMDB API", + "description": "查询 CMDB 主机元数据", + "url": "https://cmdb.example.com/api/lookup", + "headers": { + "X-Token": "mytoken" + }, + "timeout": 2, + "retry_count": 1, + "insecure_skip_verify": false } } } } } }, - "/channel/escalate/rule/disable": { + "/enrichment/mapping/api/delete": { "post": { - "operationId": "channelEscalateRuleDisable", - "summary": "禁用分派策略", - "description": "禁用分派策略而不删除。", + "operationId": "mapping-api-write-delete", + "summary": "删除映射 API", + "description": "删除映射 API。若该 API 被富化规则引用,则拒绝删除。", "tags": [ - "On-call/协作空间" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/channel-escalate-rule-disable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 若 API 仍被引用,响应返回 HTTP 400,`refs` 字段列出所有阻止删除的引用。\n- 仅 API 创建者、账户管理员或所属团队成员可删除。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-api-write-delete", "metadata": { - "sidebarTitle": "禁用分派策略" + "sidebarTitle": "删除映射 API" } }, "responses": { @@ -5466,30 +5346,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChannelRuleIDRequest" + "$ref": "#/components/schemas/MappingAPIIDRequest" }, "example": { - "channel_id": 3521074710131, - "rule_id": "6621b23f4a2c5e0012ab34cd" + "api_id": "665f1a2b3c4d5e6f7a8b9c02" } } } } } }, - "/route/info": { + "/enrichment/mapping/api/info": { "post": { - "operationId": "routeInfo", - "summary": "获取路由规则详情", - "description": "获取指定集成的路由规则配置。当集成尚未配置路由规则时返回 null。", + "operationId": "mapping-api-read-info", + "summary": "查看映射 API 详情", + "description": "根据映射 API ID 返回单个映射 API 的详细信息。", "tags": [ - "On-call/协作空间" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/route-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 映射 API 不存在时返回 `null`。", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-api-read-info", "metadata": { - "sidebarTitle": "获取路由规则详情" + "sidebarTitle": "查看映射 API 详情" } }, "responses": { @@ -5506,7 +5385,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RouteItem" + "$ref": "#/components/schemas/MappingAPIItem" } } } @@ -5515,51 +5394,16 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "integration_id": 6113996590131, - "cases": [ - { - "if": [ - { - "key": "labels.check", - "oper": "IN", - "vals": [ - "cpu.idle<20%" - ] - } - ], - "channel_ids": [ - 2533748993131 - ], - "fallthrough": false, - "routing_mode": "standard" - }, - { - "if": [ - { - "key": "severity", - "oper": "IN", - "vals": [ - "Warning" - ] - } - ], - "channel_ids": null, - "fallthrough": false, - "routing_mode": "name_mapping", - "name_mapping_label": "labels.service" - } - ], - "default": { - "channel_ids": [ - 3521074710131 - ] - }, + "api_id": "665f1a2b3c4d5e6f7a8b9c02", + "api_name": "CMDB API", + "url": "https://cmdb.example.com/api/lookup", + "timeout": 2, + "retry_count": 1, + "insecure_skip_verify": false, "status": "enabled", - "version": 6, - "updated_by": 3790925372131, - "creator_id": 3790925372131, - "created_at": 1774606136, - "updated_at": 1774606136 + "creator_id": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 } } } @@ -5583,29 +5427,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RouteInfoRequest" + "$ref": "#/components/schemas/MappingAPIIDRequest" }, "example": { - "integration_id": 6113996590131 + "api_id": "665f1a2b3c4d5e6f7a8b9c02" } } } } } }, - "/route/list": { + "/enrichment/mapping/api/list": { "post": { - "operationId": "routeList", - "summary": "查询路由规则列表", - "description": "返回指定集成的路由规则列表。未配置路由规则的集成将不出现在响应中。", + "operationId": "mapping-api-read-list", + "summary": "查询映射 API 列表", + "description": "返回账户下所有配置的映射 API。", "tags": [ - "On-call/协作空间" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/route-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据查看**(`on-call`) 或 **映射数据管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-api-read-list", "metadata": { - "sidebarTitle": "查询路由规则列表" + "sidebarTitle": "查询映射 API 列表" } }, "responses": { @@ -5622,7 +5466,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListRoutesResponse" + "$ref": "#/components/schemas/MappingAPIListResponse" } } } @@ -5631,38 +5475,24 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "total": 1, "items": [ { - "integration_id": 6113996590131, - "cases": [ - { - "if": [ - { - "key": "labels.check", - "oper": "IN", - "vals": [ - "cpu.idle<20%" - ] - } - ], - "channel_ids": [ - 2533748993131 - ], - "fallthrough": false, - "routing_mode": "standard" - } - ], - "default": { - "channel_ids": [ - 3521074710131 - ] + "api_id": "665f1a2b3c4d5e6f7a8b9c02", + "api_name": "CMDB API", + "description": "查询 CMDB 主机元数据", + "url": "https://cmdb.example.com/api/lookup", + "headers": { + "X-Token": "***" }, + "timeout": 2, + "retry_count": 1, + "insecure_skip_verify": false, "status": "enabled", - "version": 6, - "updated_by": 3790925372131, - "creator_id": 3790925372131, - "created_at": 1774606136, - "updated_at": 1774606136 + "team_id": 0, + "creator_id": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 } ] } @@ -5688,32 +5518,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListRoutesRequest" + "$ref": "#/components/schemas/EmptyRequest" }, - "example": { - "integration_ids": [ - 6113996590131, - 6113996590132 - ] - } + "example": {} } } } } }, - "/route/upsert": { + "/enrichment/mapping/api/update": { "post": { - "operationId": "routeUpsert", - "summary": "创建或更新路由规则", - "description": "创建或更新集成的路由规则,将告警导向特定协作空间。`cases` 与 `default` 至少需要提供其一。", + "operationId": "mapping-api-write-update", + "summary": "更新映射 API", + "description": "更新现有映射 API 的配置。", "tags": [ - "On-call/协作空间" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/channels/route-upsert", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 仅 API 创建者、账户管理员或所属团队成员可更新。\n- 所有可更新字段均为可选,仅更新提供的字段。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-api-write-update", "metadata": { - "sidebarTitle": "创建或更新路由规则" + "sidebarTitle": "更新映射 API" } }, "responses": { @@ -5761,52 +5586,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpsertRouteRequest" + "$ref": "#/components/schemas/MappingAPIUpdateRequest" }, "example": { - "integration_id": 6113996590131, - "cases": [ - { - "if": [ - { - "key": "severity", - "oper": "IN", - "vals": [ - "Critical" - ] - } - ], - "channel_ids": [ - 3521074710131 - ], - "fallthrough": false, - "routing_mode": "standard" - } - ], - "default": { - "channel_ids": [ - 3521074710131 - ] - } + "api_id": "665f1a2b3c4d5e6f7a8b9c02", + "timeout": 3, + "retry_count": 1 } } } } } }, - "/alert/list": { + "/enrichment/mapping/data/delete": { "post": { - "operationId": "alert-read-list", - "summary": "查询告警列表", - "description": "返回满足过滤条件的告警列表,支持游标分页。", + "operationId": "mapping-data-write-delete", + "summary": "删除映射数据", + "description": "按键名批量删除最多 100 条映射数据行。", "tags": [ - "On-call/告警管理" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- `start_time` 和 `end_time` 均为必填的 Unix 时间戳(秒),最大跨度 31 天。\n- 使用上次响应中的 `search_after_ctx` 获取下一页。\n- 结果会根据调用方的协作空间数据访问权限进行过滤。\n- 将 `is_active` 设为 `true` 可仅返回活跃(触发中)告警;设为 `false` 返回已恢复告警。", - "href": "/zh/api-reference/on-call/alerts/alert-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-data-write-delete", "metadata": { - "sidebarTitle": "查询告警列表" + "sidebarTitle": "删除映射数据" } }, "responses": { @@ -5823,7 +5627,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -5831,35 +5635,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 1, - "has_next_page": false, - "search_after_ctx": "", - "items": [ - { - "alert_id": "663a1b2c3d4e5f6789abcdef", - "integration_id": 10001, - "channel_id": 20001, - "account_id": 10023, - "title": "CPU 使用率 > 90%", - "alert_severity": "Critical", - "alert_status": "Critical", - "start_time": 1712650000, - "last_time": 1712655000, - "end_time": 0, - "labels": { - "host": "web-01" - }, - "ever_muted": false, - "created_at": 1712650000, - "updated_at": 1712655000, - "integration_name": "Prometheus", - "integration_type": "prometheus", - "channel_name": "生产", - "event_cnt": 3 - } - ] - } + "data": {} } } } @@ -5882,32 +5658,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertListRequest" + "$ref": "#/components/schemas/MappingDataDeleteRequest" }, "example": { - "start_time": 1712620800, - "end_time": 1712707200, - "limit": 20, - "is_active": true + "schema_id": "665f1a2b3c4d5e6f7a8b9c01", + "keys": [ + "server01", + "server02" + ] } } } } } }, - "/alert/info": { + "/enrichment/mapping/data/download": { "post": { - "operationId": "alert-read-info", - "summary": "查看告警详情", - "description": "通过告警 ID 返回单条告警的完整详情,包括关联故障和事件数量。", + "operationId": "mapping-data-read-download", + "summary": "下载映射数据 CSV", + "description": "将映射规则的所有数据行导出为 CSV 文件。", "tags": [ - "On-call/告警管理" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- `alert_id` 为 ObjectID 十六进制字符串,可从 `POST /alert/list` 或 `POST /alert-event/list` 获取。", - "href": "/zh/api-reference/on-call/alerts/alert-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) 或 **映射数据查看**(`on-call`) 或 **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 响应为 CSV 文件,包含 `Content-Disposition: attachment` 响应头。\n- CSV 标题行按顺序对应映射规则的来源标签和结果标签。", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-data-read-download", "metadata": { - "sidebarTitle": "查看告警详情" + "sidebarTitle": "下载映射数据 CSV" } }, "responses": { @@ -5924,7 +5701,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertItem" + "$ref": "#/components/schemas/CsvFileResponse" } } } @@ -5932,14 +5709,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "alert_id": "663a1b2c3d4e5f6789abcdef", - "title": "CPU 使用率 > 90%", - "alert_severity": "Critical", - "alert_status": "Critical", - "start_time": 1712650000, - "event_cnt": 3 - } + "data": "host,owner,team,service\nserver01,alice,sre,api\n" } } } @@ -5962,29 +5732,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertInfoRequest" + "$ref": "#/components/schemas/MappingSchemaIDRequest" }, "example": { - "alert_id": "663a1b2c3d4e5f6789abcdef" + "schema_id": "665f1a2b3c4d5e6f7a8b9c01" } } } } } }, - "/alert/list-by-ids": { + "/enrichment/mapping/data/list": { "post": { - "operationId": "alert-read-list-by-ids", - "summary": "批量查询告警", - "description": "通过多个告警 ID 一次性返回多条告警详情。", + "operationId": "mapping-data-read-list", + "summary": "查询映射数据列表", + "description": "分页返回指定映射规则的数据行,可按来源标签值进行精确过滤。", "tags": [ - "On-call/告警管理" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- 所有 `alert_ids` 必须属于调用方账户,任何无效 ID 都会导致整个请求失败。", - "href": "/zh/api-reference/on-call/alerts/alert-read-list-by-ids", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) 或 **映射数据查看**(`on-call`) 或 **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 若提供 `query`,须包含全部来源标签——不支持部分来源标签查询。\n- 支持游标分页(`search_after_ctx`)或页码分页(`p`、`limit`)。`limit` 默认 20,最大 100。\n- 响应中的 `search_after_ctx` 可用于获取下一页。", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-data-read-list", "metadata": { - "sidebarTitle": "批量查询告警" + "sidebarTitle": "查询映射数据列表" } }, "responses": { @@ -6001,7 +5771,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertListResponse" + "$ref": "#/components/schemas/MappingDataListResponse" } } } @@ -6010,14 +5780,21 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 1, - "has_next_page": false, "items": [ { - "alert_id": "663a1b2c3d4e5f6789abcdef", - "title": "CPU 使用率 > 90%" + "key": "server01", + "fields": { + "host": "server01", + "owner": "alice", + "team": "sre", + "service": "api" + }, + "created_at": 1710000000, + "updated_at": 1710000000 } - ] + ], + "total": 1, + "has_next_page": false } } } @@ -6041,31 +5818,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertListByIDsRequest" + "$ref": "#/components/schemas/MappingDataListRequest" }, "example": { - "alert_ids": [ - "663a1b2c3d4e5f6789abcdef" - ] + "schema_id": "665f1a2b3c4d5e6f7a8b9c01", + "orderby": "updated_at", + "asc": false, + "p": 1, + "limit": 20 } } } } } }, - "/alert/event/list": { + "/enrichment/mapping/data/truncate": { "post": { - "operationId": "alert-read-event-list", - "summary": "查询告警事件列表", - "description": "返回特定告警收到的所有原始事件,按时间顺序排列。", + "operationId": "mapping-data-write-truncate", + "summary": "清空映射数据", + "description": "删除指定映射规则的全部数据行。", "tags": [ - "On-call/告警管理" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- 每条告警会从集成持续接收原始事件,此接口展示指定告警的原始事件历史。", - "href": "/zh/api-reference/on-call/alerts/alert-read-event-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 此操作不可逆,将删除映射规则中的所有数据。\n- 本接口为高危操作。控制台 JWT 调用需二次验证码;`app_key` 调用跳过 MFA 但仍会被完整记录,请妥善保管 app_key。", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-data-write-truncate", "metadata": { - "sidebarTitle": "查询告警事件列表" + "sidebarTitle": "清空映射数据" } }, "responses": { @@ -6082,7 +5861,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertEventListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -6090,21 +5869,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "event_id": "663a1b2c3d4e5f6789abc001", - "alert_id": "663a1b2c3d4e5f6789abcdef", - "title": "CPU 使用率 > 90%", - "event_severity": "Critical", - "event_status": "Critical", - "event_time": 1712650000, - "labels": { - "host": "web-01" - } - } - ] - } + "data": {} } } } @@ -6127,29 +5892,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertEventListRequest" + "$ref": "#/components/schemas/MappingSchemaIDRequest" }, "example": { - "alert_id": "663a1b2c3d4e5f6789abcdef" + "schema_id": "665f1a2b3c4d5e6f7a8b9c01" } } } } } }, - "/alert/feed": { + "/enrichment/mapping/data/upload": { "post": { - "operationId": "alert-read-feed", - "summary": "查询告警动态", - "description": "返回单条告警的动态记录(评论、状态变更、合并、静默事件),支持分页查询。", + "operationId": "mapping-data-write-upload", + "summary": "通过 CSV 上传映射数据", + "description": "上传 CSV 文件批量导入映射数据。默认情况下,导入前先清空现有数据。", "tags": [ - "On-call/告警管理" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- 使用 `p`(页码,从 1 开始)和 `limit`(最大 100,默认 20)进行分页。\n- 将 `asc` 设为 `true` 可按时间正序返回。\n- 使用 `types` 过滤特定动态类型(如 `alert_comment`、`alert_merge`)。", - "href": "/zh/api-reference/on-call/alerts/alert-read-feed", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **20 次/分钟**;**2 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 请求须使用 `Content-Type: multipart/form-data`,文件字段名为 `file`,`schema_id` 通过查询参数传入。\n- CSV 标题行须包含所有来源标签和结果标签名称。\n- 文件大小上限:100 MB。\n- 默认情况下,导入前先清空现有数据;传入查询参数 `do_not_truncate_first=TRUE` 可改为追加模式。\n- CSV 中存在重复来源标签组合时返回 400 错误。", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-data-write-upload", "metadata": { - "sidebarTitle": "查询告警动态" + "sidebarTitle": "通过 CSV 上传映射数据" } }, "responses": { @@ -6166,7 +5931,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertFeedResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -6174,20 +5939,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "has_next_page": false, - "items": [ - { - "ref_id": "663a1b2c3d4e5f6789abcdef", - "type": "alert_comment", - "detail": { - "comment": "正在排查中。" - }, - "creator_id": 80011, - "created_at": 1712651000 - } - ] - } + "data": {} } } } @@ -6210,31 +5962,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertFeedRequest" + "$ref": "#/components/schemas/MappingDataUploadRequest" }, "example": { - "alert_id": "663a1b2c3d4e5f6789abcdef", - "limit": 20, - "asc": false + "schema_id": "665f1a2b3c4d5e6f7a8b9c01" } } } } } }, - "/alert/merge": { + "/enrichment/mapping/data/upsert": { "post": { - "operationId": "alert-write-merge", - "summary": "将告警合并到故障", - "description": "将一条或多条告警关联到已有故障。若来源告警之前属于其他故障,且合并后该故障中没有其他告警,则该故障将自动关闭。", + "operationId": "mapping-data-write-upsert", + "summary": "写入映射数据", + "description": "向映射规则中插入或更新最多 1000 条数据行,每行须包含所有来源标签和结果标签。", "tags": [ - "On-call/告警管理" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- 所有 `alert_ids` 和 `incident_id` 必须属于调用方账户。\n- 可选填 `title` 和 `owner_id` 以同时更新目标故障。", - "href": "/zh/api-reference/on-call/alerts/alert-write-merge", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 每条数据须包含映射规则中定义的所有来源标签和结果标签的值。\n- 未知标签的值将被静默忽略。\n- 每个值最多 2048 个字符。\n- Upsert 以来源标签组合为键,来源键相同的行将被更新。\n- 单个映射规则默认最多存储 10,000 条数据。\n- 每个映射规则的写入操作有锁保护,并发 Upsert 可能返回 `ErrRequestTooFrequently`。", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-data-write-upsert", "metadata": { - "sidebarTitle": "将告警合并到故障" + "sidebarTitle": "写入映射数据" } }, "responses": { @@ -6251,7 +6001,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/MappingDataUpsertResponse" } } } @@ -6259,7 +6009,12 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "keys": [ + "server01", + "server02" + ] + } } } } @@ -6282,32 +6037,43 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertMergeRequest" + "$ref": "#/components/schemas/MappingDataUpsertRequest" }, "example": { - "alert_ids": [ - "663a1b2c3d4e5f6789abcdef" - ], - "incident_id": "663a000000000000deadbeef" + "schema_id": "665f1a2b3c4d5e6f7a8b9c01", + "docs": [ + { + "host": "server01", + "owner": "alice", + "team": "sre", + "service": "api" + }, + { + "host": "server02", + "owner": "bob", + "team": "平台", + "service": "gateway" + } + ] } } } } } }, - "/alert/pipeline/info": { + "/enrichment/mapping/schema/create": { "post": { - "operationId": "alert-read-pipeline-info", - "summary": "查看告警处理规则", - "description": "返回指定集成的告警处理规则配置。", + "operationId": "mapping-schema-write-create", + "summary": "创建映射规则", + "description": "创建新的映射规则,定义查找来源标签和待填充的结果标签。需要 Pro 计划。", "tags": [ - "On-call/告警管理" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) |\n\n## 使用说明\n\n- 若该集成尚未配置告警处理规则,则 data 为 `null`。\n- 调用方需有该集成的访问权限。", - "href": "/zh/api-reference/on-call/alerts/alert-read-pipeline-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 映射规则名称在账户内唯一。\n- `source_labels`(1–3 个)为查找键,`result_labels`(1–10 个)为匹配后写入的标签。\n- 标签名须符合 `^[a-z][a-z0-9_]{0,39}$`(小写)。\n- `source_labels` 与 `result_labels` 不得重叠。\n- 账户最多可创建 20 个映射规则。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-schema-write-create", "metadata": { - "sidebarTitle": "查看告警处理规则" + "sidebarTitle": "创建映射规则" } }, "responses": { @@ -6324,7 +6090,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertPipelineItem" + "$ref": "#/components/schemas/MappingSchemaCreateResponse" } } } @@ -6333,21 +6099,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "integration_id": 10001, - "rules": [ - { - "kind": "severity_reset", - "if": null, - "settings": { - "severity": "Warning" - } - } - ], - "status": "enabled", - "creator_id": 80011, - "updated_by": 80011, - "created_at": 1710000000, - "updated_at": 1712000000 + "schema_id": "665f1a2b3c4d5e6f7a8b9c01", + "schema_name": "CMDB 查询" } } } @@ -6371,29 +6124,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertPipelineInfoRequest" + "$ref": "#/components/schemas/MappingSchemaCreateRequest" }, "example": { - "integration_id": 10001 + "schema_name": "CMDB 查询", + "description": "用 CMDB 数据富化告警", + "source_labels": [ + "host" + ], + "result_labels": [ + "owner", + "team", + "service" + ] } } } } } }, - "/alert/pipeline/list": { + "/enrichment/mapping/schema/delete": { "post": { - "operationId": "alert-read-pipeline-list", - "summary": "批量查询告警处理规则", - "description": "返回多个集成的告警处理规则配置。", + "operationId": "mapping-schema-write-delete", + "summary": "删除映射规则", + "description": "删除映射规则及其所有关联数据。若该规则被富化规则或 Webhook 引用,则拒绝删除。", "tags": [ - "On-call/告警管理" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) |\n\n## 使用说明\n\n- 所有 `integration_ids` 必须对调用方可访问。", - "href": "/zh/api-reference/on-call/alerts/alert-read-pipeline-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 若映射规则仍被引用,响应返回 HTTP 400,`refs` 字段列出所有阻止删除的引用。\n- 仅映射规则创建者、账户管理员或所属团队成员可删除。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。\n- 本接口为高危操作。控制台 JWT 调用需二次验证码;`app_key` 调用跳过 MFA 但仍会被完整记录,请妥善保管 app_key。", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-schema-write-delete", "metadata": { - "sidebarTitle": "批量查询告警处理规则" + "sidebarTitle": "删除映射规则" } }, "responses": { @@ -6410,7 +6172,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertPipelineListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -6418,19 +6180,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "integration_id": 10001, - "rules": [], - "status": "enabled", - "creator_id": 80011, - "updated_by": 80011, - "created_at": 1710000000, - "updated_at": 1712000000 - } - ] - } + "data": {} } } } @@ -6453,32 +6203,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertPipelineListRequest" + "$ref": "#/components/schemas/MappingSchemaIDRequest" }, "example": { - "integration_ids": [ - 10001, - 10002 - ] + "schema_id": "665f1a2b3c4d5e6f7a8b9c01" } } } } } }, - "/alert/pipeline/upsert": { + "/enrichment/mapping/schema/info": { "post": { - "operationId": "alert-write-pipeline-upsert", - "summary": "创建或更新告警处理规则", - "description": "为集成设置告警处理规则,将完全替换已有配置。", + "operationId": "mapping-schema-read-info", + "summary": "查看映射规则详情", + "description": "根据映射规则 ID 返回单个映射规则的详细信息。", "tags": [ - "On-call/告警管理" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心管理**(`on-call`) |\n\n## 使用说明\n\n- 每条处理规则最多 50 条规则。\n- 每条规则包含 `kind`(`title_reset`、`description_reset`、`severity_reset`、`alert_drop`、`alert_inhibit` 之一)、可选的 `if` 过滤器,以及与 kind 对应的 `settings`。\n- `alert_inhibit` 类型需要 Standard 及以上许可证。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/alerts/alert-write-pipeline-upsert", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) 或 **映射数据查看**(`on-call`) 或 **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 映射规则不存在时返回 `null`。", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-schema-read-info", "metadata": { - "sidebarTitle": "创建或更新告警处理规则" + "sidebarTitle": "查看映射规则详情" } }, "responses": { @@ -6495,7 +6242,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/MappingSchemaItem" } } } @@ -6503,7 +6250,24 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "schema_id": "665f1a2b3c4d5e6f7a8b9c01", + "schema_name": "CMDB 查询", + "description": "用 CMDB 数据富化告警", + "source_labels": [ + "host" + ], + "result_labels": [ + "owner", + "team", + "service" + ], + "status": "enabled", + "team_id": 0, + "creator_id": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 + } } } } @@ -6526,38 +6290,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertPipelineUpsertRequest" + "$ref": "#/components/schemas/MappingSchemaIDRequest" }, "example": { - "integration_id": 10001, - "rules": [ - { - "kind": "severity_reset", - "if": null, - "settings": { - "severity": "Warning" - } - } - ] + "schema_id": "665f1a2b3c4d5e6f7a8b9c01" } } } } } }, - "/alert-event/list": { + "/enrichment/mapping/schema/list": { "post": { - "operationId": "alert-event-read-list", - "summary": "查询原始告警事件列表", - "description": "返回跨所有告警的原始告警事件分页列表,支持按集成、协作空间、时间范围和严重程度过滤。", + "operationId": "mapping-schema-read-list", + "summary": "查询映射规则列表", + "description": "返回账户下所有映射规则,按创建时间升序排列。", "tags": [ - "On-call/告警管理" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- 结果会根据调用方的协作空间数据访问权限进行过滤。\n- `severities` 为逗号分隔的字符串,如 `\"Critical,Warning\"`。", - "href": "/zh/api-reference/on-call/alerts/alert-event-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) 或 **协作空间管理**(`on-call`) 或 **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) 或 **映射数据查看**(`on-call`) 或 **映射数据管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-schema-read-list", "metadata": { - "sidebarTitle": "查询原始告警事件列表" + "sidebarTitle": "查询映射规则列表" } }, "responses": { @@ -6574,7 +6329,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertEventGlobalListResponse" + "$ref": "#/components/schemas/MappingSchemaListResponse" } } } @@ -6584,14 +6339,24 @@ "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { "total": 1, - "has_next_page": false, "items": [ { - "event_id": "663a1b2c3d4e5f6789abc001", - "alert_id": "663a1b2c3d4e5f6789abcdef", - "title": "CPU 使用率 > 90%", - "event_severity": "Critical", - "event_time": 1712650000 + "schema_id": "665f1a2b3c4d5e6f7a8b9c01", + "schema_name": "CMDB 查询", + "description": "用 CMDB 数据富化告警", + "source_labels": [ + "host" + ], + "result_labels": [ + "owner", + "team", + "service" + ], + "status": "enabled", + "team_id": 0, + "creator_id": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 } ] } @@ -6617,32 +6382,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlertEventGlobalListRequest" + "$ref": "#/components/schemas/EmptyRequest" }, - "example": { - "start_time": 1712620800, - "end_time": 1712707200, - "limit": 20, - "severities": "Critical" - } + "example": {} } } } } }, - "/webhook/history/list": { + "/enrichment/mapping/schema/update": { "post": { - "operationId": "webhookHistoryList", - "summary": "查询 Webhook 推送历史", - "description": "查询出站 Webhook 通知的推送历史记录。", + "operationId": "mapping-schema-write-update", + "summary": "更新映射规则", + "description": "更新映射规则的名称、描述或所属团队。来源标签和结果标签创建后不可更改。", "tags": [ - "On-call/集成中心" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/integrations/webhook-history-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 仅映射规则创建者、账户管理员或所属团队成员可更新。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/alert-enrichment/mapping-schema-write-update", "metadata": { - "sidebarTitle": "查询 Webhook 推送历史" + "sidebarTitle": "更新映射规则" } }, "responses": { @@ -6659,7 +6419,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListWebhookHistoryResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -6667,26 +6427,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "integration_id": 5321026051131, - "event_id": "20260412Xatt9hrXsgmFkBR78WF655", - "webhook_type": "alert", - "event_type": "a_update", - "channel_id": 2551105804131, - "ref_id": "69da3f0ef77b1b51f40e83cc", - "endpoint": "https://example.com/webhook", - "attempt": 1, - "duration": 132, - "status": "success", - "status_code": 200, - "event_time": "2026-04-12T13:31:11.357472+08:00" - } - ], - "search_after_ctx": "eyJldmVudF90aW1lIjoiMjAyNi0wNC0xMlQxMzoxNToyNi4zODI1NDcrMDg6MDAiLCJldmVudF9pZCI6IjIwMjYwNDEybUdzeFAzZHJwRmZzNFpDUWQycFNEcCJ9", - "total": 346 - } + "data": {} } } } @@ -6709,33 +6450,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListWebhookHistoryRequest" + "$ref": "#/components/schemas/MappingSchemaUpdateRequest" }, "example": { - "limit": 20, - "start_time": 1775116800000, - "end_time": 1775203200000, - "integration_id": 6113996590131, - "status": "success" + "schema_id": "665f1a2b3c4d5e6f7a8b9c01", + "schema_name": "CMDB 查询 v2", + "description": "更新后的描述" } } } } } }, - "/webhook/history/detail": { + "/enrichment/upsert": { "post": { - "operationId": "webhookHistoryDetail", - "summary": "获取 Webhook 推送详情", - "description": "获取指定 Webhook 推送尝试的详细请求体和响应信息。", + "operationId": "enrichment-write-upsert", + "summary": "创建或替换富化规则", + "description": "创建或全量替换指定集成的告警富化规则集,`rules` 数组将被原子替换。", "tags": [ - "On-call/集成中心" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/integrations/webhook-history-detail", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) 或 **集成中心管理**(`on-call`) |\n\n## 使用说明\n\n- 富化规则按顺序依次执行。\n- 每条规则有一个 `kind`:`extraction`(正则/gjson 提取)、`composition`(模板组合标签)、`mapping`(通过映射规则或 API 查找)、`drop`(删除标签)。\n- 可选的 `if` 字段为 `AndFilters` 条件,不匹配时跳过该规则。\n- `kind: extraction`:`source_field` 须为 `title`、`description` 或 `labels.*` 前缀的键;`pattern`(正则,须包含命名分组 `result`)和 `g_json`(GJson 路径)二选一。\n- `kind: composition`:`template` 使用 Go text/template 语法,可引用 `labels.*` 键。\n- `kind: mapping`:`mapping_type` 为 `schema`(默认)或 `api`;分别提供 `schema_id` 或 `api_id`。\n- `kind: drop`:`drop_labels` 列出要删除的标签键名。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/alert-enrichment/enrichment-write-upsert", "metadata": { - "sidebarTitle": "获取 Webhook 推送详情" + "sidebarTitle": "创建或替换富化规则" } }, "responses": { @@ -6752,7 +6491,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/WebhookHistoryDetail" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -6760,26 +6499,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "integration_id": 5321026051131, - "event_id": "20260412Xatt9hrXsgmFkBR78WF655", - "webhook_type": "alert", - "event_type": "a_update", - "channel_id": 2551105804131, - "ref_id": "69da3f0ef77b1b51f40e83cc", - "request_headers": "{\"Content-Type\":\"application/json\"}", - "request_body": "{\"event_type\":\"a_update\",\"event_id\":\"d789d65951c0532ea9b6a1d99b707054\"}", - "endpoint": "https://example.com/webhook", - "attempt": 1, - "duration": 132, - "status": "success", - "status_code": 200, - "response_headers": "{\"Content-Type\":\"application/json\"}", - "response_body": "{\"ok\":true}", - "event_time": "2026-04-12T13:31:11.357472+08:00", - "ref_title": "High CPU Usage on host-01", - "channel_name": "Production Alerts" - } + "data": {} } } } @@ -6802,30 +6522,40 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetWebhookHistoryDetailRequest" + "$ref": "#/components/schemas/EnrichmentUpsertRequest" }, "example": { - "event_id": "20260412Xatt9hrXsgmFkBR78WF655", - "integration_id": 6113996590131 + "integration_id": 5001, + "rules": [ + { + "kind": "extraction", + "settings": { + "source_field": "labels.env", + "result_label": "environment", + "pattern": "(?Pprod|staging|dev)", + "override": true + } + } + ] } } } } } }, - "/schedule/create": { + "/field/create": { "post": { - "operationId": "scheduleCreate", - "summary": "创建值班表", - "description": "创建新的值班表(分派策略值班表)。", + "operationId": "field-write-create", + "summary": "创建自定义字段", + "description": "为账号新建一个故障自定义字段。", "tags": [ - "On-call/值班排班" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **值班管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/schedules/schedule-create", + "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | 每账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限 | **故障可管理** (`on-call`) |\n\n## 使用说明\n\n- 每个账号最多 **15** 个自定义字段。\n- `field_name` 必须匹配 `^[a-zA-Z_][a-zA-Z0-9_]{0,39}$`,创建后不可更改;`display_name` 在账号内须唯一。\n- 类型规则:`checkbox` 仅支持 `value_type=bool` 且无 `options`;`single_select`/`multi_select` 要求 `value_type=string` 且 `options` 非空且元素唯一;`text` 仅支持 `value_type=string` 且无 `options`。\n- 响应仅包含 `field_id` 与 `field_name`,如需完整对象请调用 `/field/info`。\n- 该接口会被审计日志记录。", + "href": "/zh/api-reference/on-call/alert-enrichment/field-write-create", "metadata": { - "sidebarTitle": "创建值班表" + "sidebarTitle": "创建自定义字段" } }, "responses": { @@ -6842,7 +6572,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleIDResponse" + "$ref": "#/components/schemas/CreateFieldResponse" } } } @@ -6851,7 +6581,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "schedule_id": 6294534917601 + "field_id": "66e9d3a4f7c2b04a1c8a91b3", + "field_name": "severity_class" } } } @@ -6875,100 +6606,40 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleUpsertRequest" + "$ref": "#/components/schemas/CreateFieldRequest" }, "example": { - "schedule_name": "Production On-Call", - "description": "Primary on-call rotation for the production team", - "team_id": 4291079133131, - "layers": [ - { - "layer_name": "Layer 1", - "name": "Layer 1", - "mode": 0, - "weight": 0, - "hidden": 0, - "groups": [ - { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2451002751131 - ] - } - ], - "start": 0, - "end": 0 - }, - { - "group_name": "B", - "name": "B", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2476123212131 - ] - } - ], - "start": 0, - "end": 0 - } - ], - "rotation_unit": "day", - "rotation_value": 1, - "rotation_duration": 86400, - "handoff_time": 0, - "enable_time": 1712000000, - "expire_time": 0, - "restrict_mode": 0, - "restrict_start": 0, - "restrict_end": 0, - "restrict_periods": [], - "day_mask": { - "repeat": [ - 1, - 2, - 3, - 4, - 5 - ] - }, - "fair_rotation": false, - "mask_continuous_enabled": false - } + "field_name": "severity_class", + "display_name": "Severity Class", + "description": "Business severity tier.", + "field_type": "single_select", + "value_type": "string", + "options": [ + "Critical", + "High", + "Medium", + "Low" ], - "notify": { - "advance_in_time": 300, - "fixed_time": null, - "by": { - "follow_preference": true, - "personal_channels": null - }, - "webhooks": null - } + "default_value": "Medium" } } } } } }, - "/schedule/update": { + "/field/delete": { "post": { - "operationId": "scheduleUpdate", - "summary": "更新值班表", - "description": "更新已有的值班表,需要通过 schedule_id 指定值班表。", + "operationId": "field-write-delete", + "summary": "删除自定义字段", + "description": "删除自定义字段,并异步清理历史故障中的同名字段值。", "tags": [ - "On-call/值班排班" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **值班管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/schedules/schedule-update", + "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | 每账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限 | **故障可管理** (`on-call`) |\n\n## 使用说明\n\n- 字段会立即标记为已删除;从历史故障中剥离对应值的清理过程在后台执行,数据量大时可能较慢。\n- 仅当 `field_type` 与 `value_type` 完全一致时,才允许复用已删除字段的 `field_name`。\n- 该接口会被审计日志记录。", + "href": "/zh/api-reference/on-call/alert-enrichment/field-write-delete", "metadata": { - "sidebarTitle": "更新值班表" + "sidebarTitle": "删除自定义字段" } }, "responses": { @@ -6985,7 +6656,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleEmptyObject" + "type": "object" } } } @@ -7016,32 +6687,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleUpsertRequest" + "$ref": "#/components/schemas/DeleteFieldRequest" }, "example": { - "schedule_id": 2001, - "schedule_name": "Production On-Call (Updated)", - "description": "Updated primary on-call rotation", - "team_id": 4291079133131 + "field_id": "66e9d3a4f7c2b04a1c8a91b3" } } } } } }, - "/schedule/preview": { + "/field/info": { "post": { - "operationId": "schedulePreview", - "summary": "预览值班表", - "description": "预览值班表配置生成的排班结果,不会持久化。请求体与创建/更新相同,并需要指定 start 和 end 时间窗口(最多 45 天)。", + "operationId": "field-read-info", + "summary": "查看自定义字段", + "description": "按 ID 查询单个故障自定义字段的配置。", "tags": [ - "On-call/值班排班" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **60 次/分钟**;**10 次/秒** |\n| 权限要求 | **值班查看**(`on-call`) 或 **值班管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/schedules/schedule-preview", + "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | 每账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限 | **故障可读** (`on-call`) 或 **故障可管理** (`on-call`) |\n\n## 使用说明\n\n- 仅返回非删除状态的字段;`field_id` 已删除或不存在时会返回 400。\n- `options` 与 `default_value` 的形态随 `field_type` 变化,详见 `FieldItem`。", + "href": "/zh/api-reference/on-call/alert-enrichment/field-read-info", "metadata": { - "sidebarTitle": "预览值班表" + "sidebarTitle": "查看自定义字段" } }, "responses": { @@ -7058,7 +6726,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleItem" + "$ref": "#/components/schemas/FieldItem" } } } @@ -7067,167 +6735,25 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "id": null, - "name": null, - "account_id": 0, - "group_id": null, - "disabled": null, - "create_at": 0, - "create_by": 0, - "update_at": 0, - "update_by": 0, - "layers": [ - { - "account_id": 0, - "name": "Layer 1", - "schedule_id": 0, - "hidden": 0, - "mode": 0, - "weight": 0, - "groups": [ - { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2451002751131 - ] - } - ], - "start": 0, - "end": 0 - }, - { - "group_name": "B", - "name": "B", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2476123212131 - ] - } - ], - "start": 0, - "end": 0 - } - ], - "rotation_duration": 86400, - "handoff_time": 0, - "enable_time": 1775980800, - "expire_time": 0, - "restrict_mode": 0, - "restrict_start": 0, - "restrict_end": 0, - "restrict_periods": [], - "day_mask": { - "repeat": [ - 1, - 2, - 3, - 4, - 5 - ] - }, - "create_at": 0, - "create_by": 0, - "update_at": 0, - "update_by": 0, - "layer_name": "Layer 1", - "fair_rotation": false, - "layer_start": 1775980800, - "layer_end": null, - "rotation_unit": "day", - "rotation_value": 1, - "mask_continuous_enabled": false - } + "account_id": 80001, + "field_id": "66e9d3a4f7c2b04a1c8a91b3", + "field_name": "severity_class", + "display_name": "Severity Class", + "description": "Business severity tier.", + "field_type": "single_select", + "value_type": "string", + "options": [ + "Critical", + "High", + "Medium", + "Low" ], - "schedule_layers": [ - { - "layer_name": "Layer 1", - "name": "Layer 1", - "mode": 0, - "schedules": [ - { - "start": 1776009600, - "end": 1776096000, - "group": { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2451002751131 - ] - } - ], - "start": 1776009600, - "end": 1776096000 - }, - "index": 0 - }, - { - "start": 1776096000, - "end": 1776182400, - "group": { - "group_name": "B", - "name": "B", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2476123212131 - ] - } - ], - "start": 1776096000, - "end": 1776182400 - }, - "index": 0 - } - ] - } - ], - "final_schedule": { - "layer_name": "", - "name": "", - "mode": 0, - "schedules": [ - { - "start": 1776009600, - "end": 1776096000, - "group": { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2451002751131 - ] - } - ], - "start": 1776009600, - "end": 1776096000 - }, - "index": 0 - } - ] - }, - "start": 1775980800, - "end": 1776240000, - "notify": null, - "schedule_id": 0, - "schedule_name": null, - "team_id": null, - "description": null, - "layer_schedules": null, - "status": null, - "cur_oncall": null, - "next_oncall": null + "default_value": "Medium", + "status": "enabled", + "creator_id": 80011, + "updated_by": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 } } } @@ -7251,77 +6777,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleUpsertRequest" + "$ref": "#/components/schemas/FieldInfoRequest" }, "example": { - "schedule_name": "Preview Schedule", - "start": 1712000000, - "end": 1712086400, - "layers": [ - { - "layer_name": "Layer 1", - "name": "Layer 1", - "mode": 0, - "weight": 0, - "hidden": 0, - "groups": [ - { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2451002751131 - ] - } - ], - "start": 0, - "end": 0 - } - ], - "rotation_unit": "day", - "rotation_value": 1, - "rotation_duration": 86400, - "handoff_time": 0, - "enable_time": 1712000000, - "expire_time": 0, - "restrict_mode": 0, - "restrict_start": 0, - "restrict_end": 0, - "restrict_periods": [], - "day_mask": { - "repeat": [ - 1, - 2, - 3, - 4, - 5 - ] - }, - "fair_rotation": false, - "mask_continuous_enabled": false - } - ] + "field_id": "66e9d3a4f7c2b04a1c8a91b3" } } } } } }, - "/schedule/delete": { + "/field/list": { "post": { - "operationId": "scheduleDelete", - "summary": "删除值班表", - "description": "根据 ID 删除一个或多个值班表。", + "operationId": "field-read-list", + "summary": "查看自定义字段列表", + "description": "返回账号下所有的故障自定义字段。", "tags": [ - "On-call/值班排班" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **值班管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/schedules/schedule-delete", + "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | 每账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限 | **故障可读** (`on-call`) 或 **故障可管理** (`on-call`) |\n\n## 使用说明\n\n- 一次性返回全部未删除字段,无分页与 `total`。\n- `query` 同时匹配 `field_name` 与 `display_name`;非法正则会自动转义为字面量子串匹配。", + "href": "/zh/api-reference/on-call/alert-enrichment/field-read-list", "metadata": { - "sidebarTitle": "删除值班表" + "sidebarTitle": "查看自定义字段列表" } }, "responses": { @@ -7338,7 +6816,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleEmptyObject" + "$ref": "#/components/schemas/FieldListResponse" } } } @@ -7346,7 +6824,31 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "account_id": 80001, + "field_id": "66e9d3a4f7c2b04a1c8a91b3", + "field_name": "severity_class", + "display_name": "Severity Class", + "description": "Business severity tier.", + "field_type": "single_select", + "value_type": "string", + "options": [ + "Critical", + "High", + "Medium", + "Low" + ], + "default_value": "Medium", + "status": "enabled", + "creator_id": 80011, + "updated_by": 80011, + "created_at": 1710000000, + "updated_at": 1710000000 + } + ] + } } } } @@ -7369,31 +6871,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleIDsBodyRequest" + "$ref": "#/components/schemas/FieldListRequest" }, "example": { - "schedule_ids": [ - 2001 - ] + "orderby": "updated_at", + "asc": false, + "query": "severity" } } } } } }, - "/schedule/info": { + "/field/update": { "post": { - "operationId": "scheduleInfo", - "summary": "获取值班表详情", - "description": "返回值班表的详细信息,并按照指定时间窗口(最多 45 天)返回计算出的值班分层。", + "operationId": "field-write-update", + "summary": "变更自定义字段", + "description": "修改已有自定义字段的可变属性。", "tags": [ - "On-call/值班排班" + "On-call/标签增强" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **值班查看**(`on-call`) 或 **值班管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/schedules/schedule-info", + "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | 每账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限 | **故障可管理** (`on-call`) |\n\n## 使用说明\n\n- 仅可修改 `display_name`、`description`、`options`、`default_value`;`field_name`、`field_type`、`value_type` 不可更改。\n- `options` 与 `default_value` 需保持与字段当前类型一致,规则同创建接口。\n- 该接口会被审计日志记录。", + "href": "/zh/api-reference/on-call/alert-enrichment/field-write-update", "metadata": { - "sidebarTitle": "获取值班表详情" + "sidebarTitle": "变更自定义字段" } }, "responses": { @@ -7410,7 +6912,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleItem" + "type": "object" } } } @@ -7418,258 +6920,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "id": 5789640530410, - "name": "test-000001", - "account_id": 2451002751131, - "group_id": 4291079133131, - "disabled": 0, - "create_at": 1766110836, - "create_by": 2476123212131, - "update_at": 1775205795, - "update_by": 2476123212131, - "layers": [ - { - "account_id": 2451002751131, - "name": "Layer 1", - "schedule_id": 5789640530410, - "hidden": 0, - "mode": 0, - "weight": 0, - "groups": [ - { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 3122470302131 - ] - } - ], - "start": 0, - "end": 0 - }, - { - "group_name": "B", - "name": "B", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2659460982131 - ] - } - ], - "start": 0, - "end": 0 - } - ], - "rotation_duration": 86400, - "handoff_time": 0, - "enable_time": 1767542400, - "expire_time": 0, - "restrict_mode": 0, - "restrict_start": 0, - "restrict_end": 0, - "restrict_periods": [], - "day_mask": { - "repeat": [ - 1, - 2, - 3, - 4, - 5 - ] - }, - "create_at": 1775205795, - "create_by": 2476123212131, - "update_at": 1775205795, - "update_by": 2476123212131, - "layer_name": "Layer 1", - "fair_rotation": false, - "layer_start": 1767542400, - "layer_end": null, - "rotation_unit": "day", - "rotation_value": 1, - "mask_continuous_enabled": false - } - ], - "schedule_layers": [ - { - "layer_name": "Layer 1", - "name": "Layer 1", - "mode": 0, - "schedules": [ - { - "start": 1776009600, - "end": 1776096000, - "group": { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 3122470302131 - ] - } - ], - "start": 1776009600, - "end": 1776096000 - }, - "index": 0 - }, - { - "start": 1776096000, - "end": 1776182400, - "group": { - "group_name": "B", - "name": "B", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2659460982131 - ] - } - ], - "start": 1776096000, - "end": 1776182400 - }, - "index": 0 - } - ] - } - ], - "final_schedule": { - "layer_name": "", - "name": "", - "mode": 0, - "schedules": [ - { - "start": 1776009600, - "end": 1776096000, - "group": { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 3122470302131 - ] - } - ], - "start": 1776009600, - "end": 1776096000 - }, - "index": 0 - } - ] - }, - "notify": { - "advance_in_time": 300, - "fixed_time": null, - "by": { - "follow_preference": false, - "personal_channels": [ - "email" - ] - }, - "webhooks": [ - { - "type": "feishu_app", - "settings": { - "token": "", - "alias": "", - "data_source_id": 5427276014131, - "chat_ids": [ - "oc_60a6dc4c6e4e5cbc4934ef08aa7ff76d" - ], - "verify_token": "", - "sign_secret": "" - } - } - ] - }, - "schedule_id": 5789640530410, - "schedule_name": "test-000001", - "team_id": 4291079133131, - "description": "abc", - "layer_schedules": [ - { - "layer_name": "Layer 1", - "name": "Layer 1", - "mode": 0, - "schedules": [ - { - "start": 1776009600, - "end": 1776096000, - "group": { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 3122470302131 - ] - } - ], - "start": 1776009600, - "end": 1776096000 - }, - "index": 0 - } - ] - } - ], - "status": 0, - "cur_oncall": { - "start": 1775972040, - "end": 1776009600, - "group": { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2451002751131 - ] - } - ], - "start": 1775972040, - "end": 1776009600 - }, - "update_at": 0, - "weight": 0, - "index": 0 - }, - "next_oncall": { - "start": 1776009600, - "end": 1776096000, - "group": { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 3122470302131 - ] - } - ], - "start": 1776009600, - "end": 1776096000 - }, - "update_at": 0, - "weight": 0, - "index": 0 - } - } + "data": {} } } } @@ -7692,31 +6943,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleInfoRequest" + "$ref": "#/components/schemas/UpdateFieldRequest" }, "example": { - "schedule_id": 2001, - "start": 1712000000, - "end": 1712086400 + "field_id": "66e9d3a4f7c2b04a1c8a91b3", + "display_name": "Severity Class", + "description": "Business severity tier.", + "options": [ + "Critical", + "High", + "Medium", + "Low" + ], + "default_value": "Medium" } } } } } }, - "/schedule/list": { + "/incident/ack": { "post": { - "operationId": "scheduleList", - "summary": "查询值班表列表", - "description": "返回值班表的分页列表。若同时传入 start 与 end(间隔不超过 45 天),响应会包含计算后的排班分层。", + "operationId": "incidentAck", + "summary": "认领故障", + "description": "认领一个故障以表明正在积极处理。", "tags": [ - "On-call/值班排班" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/schedules/schedule-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-ack", "metadata": { - "sidebarTitle": "查询值班表列表" + "sidebarTitle": "认领故障" } }, "responses": { @@ -7733,7 +6991,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -7741,99 +6999,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "id": 5789640530410, - "name": "test-000001", - "account_id": 2451002751131, - "group_id": 4291079133131, - "disabled": 0, - "create_at": 1766110836, - "create_by": 2476123212131, - "update_at": 1775205795, - "update_by": 2476123212131, - "layers": null, - "schedule_layers": null, - "final_schedule": { - "layer_name": "", - "name": "", - "mode": 0, - "schedules": null - }, - "notify": { - "advance_in_time": 300, - "fixed_time": null, - "by": { - "follow_preference": false, - "personal_channels": [ - "email" - ] - }, - "webhooks": [ - { - "type": "feishu_app", - "settings": { - "token": "", - "alias": "", - "data_source_id": 5427276014131, - "chat_ids": [ - "oc_60a6dc4c6e4e5cbc4934ef08aa7ff76d" - ], - "verify_token": "", - "sign_secret": "" - } - } - ] - }, - "schedule_id": 5789640530410, - "schedule_name": "test-000001", - "team_id": 4291079133131, - "description": "abc", - "layer_schedules": null, - "status": 0, - "cur_oncall": null, - "next_oncall": null - }, - { - "id": 5432326025106, - "name": "test-2509300001", - "account_id": 2451002751131, - "group_id": 2477033058131, - "disabled": 0, - "create_at": 1759132037, - "create_by": 2476123212131, - "update_at": 1775207501, - "update_by": 2476123212131, - "layers": null, - "schedule_layers": null, - "final_schedule": { - "layer_name": "", - "name": "", - "mode": 0, - "schedules": null - }, - "notify": { - "advance_in_time": 300, - "fixed_time": null, - "by": { - "follow_preference": true, - "personal_channels": null - }, - "webhooks": null - }, - "schedule_id": 5432326025106, - "schedule_name": "test-2509300001", - "team_id": 2477033058131, - "description": "", - "layer_schedules": null, - "status": 0, - "cur_oncall": null, - "next_oncall": null - } - ], - "total": 41 - } + "data": {} } } } @@ -7856,32 +7022,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleListRequest" + "$ref": "#/components/schemas/AckIncidentRequest" }, "example": { - "p": 1, - "limit": 20, - "query": "production", - "is_my_team": true + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ] } } } } } }, - "/schedule/self": { + "/incident/alert/list": { "post": { - "operationId": "scheduleSelf", - "summary": "查询我的值班表", - "description": "返回当前用户被分配的值班表列表。", + "operationId": "incidentAlertList", + "summary": "查询故障关联告警", + "description": "查询合并到指定故障中的所有告警列表。", "tags": [ - "On-call/值班排班" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **值班查看**(`on-call`) 或 **值班管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/schedules/schedule-self", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-alert-list", "metadata": { - "sidebarTitle": "查询我的值班表" + "sidebarTitle": "查询故障关联告警" } }, "responses": { @@ -7898,7 +7063,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleSelfResponse" + "$ref": "#/components/schemas/ListIncidentAlertsResponse" } } } @@ -7907,105 +7072,47 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "total": 1, "items": [ { - "id": 2539108069860, - "name": "Open Source Q&A", + "alert_id": "69da451df77b1b51f40e83de", + "integration_id": 2490562293131, + "data_source_id": 2490562293131, + "channel_id": 2551105804131, "account_id": 2451002751131, - "group_id": 2477033058131, - "disabled": 0, - "create_at": 1702623874, - "create_by": 2451002751131, - "update_at": 1710468081, - "update_by": 2476444212131, - "layers": [ - { - "account_id": 2451002751131, - "name": "Rule 1", - "schedule_id": 2539108069860, - "hidden": 0, - "mode": 0, - "weight": 0, - "groups": [ - { - "group_name": "A", - "name": "A", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2476444212131 - ] - } - ], - "start": 0, - "end": 0 - }, - { - "group_name": "B", - "name": "B", - "members": [ - { - "role_id": 0, - "person_ids": [ - 2469167612131 - ] - } - ], - "start": 0, - "end": 0 - } - ], - "rotation_duration": 86400, - "handoff_time": 0, - "enable_time": 1702623874, - "expire_time": 0, - "restrict_mode": 0, - "restrict_start": 0, - "restrict_end": 0, - "restrict_periods": [], - "day_mask": { - "repeat": [ - 1, - 2, - 3, - 4, - 5 - ] - }, - "create_at": 1702623874, - "create_by": 2451002751131, - "update_at": 1710468081, - "update_by": 2476444212131, - "layer_name": "Rule 1", - "fair_rotation": false, - "layer_start": 1702623874, - "layer_end": null, - "rotation_unit": "day", - "rotation_value": 1, - "mask_continuous_enabled": false - } - ], - "schedule_layers": null, - "final_schedule": { - "layer_name": "", - "name": "", - "mode": 0, - "schedules": null + "description": "", + "title": "CPU usage high - web-server-01", + "title_rule": "", + "alert_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", + "alert_severity": "Critical", + "alert_status": "Critical", + "start_time": 1775912219, + "last_time": 1775969819, + "end_time": 0, + "labels": { + "check": "cpu_usage_high", + "resource": "web-server-01" }, - "notify": { - "fixed_time": null, - "by": null, - "webhooks": null + "ever_muted": false, + "created_at": 1775912221, + "updated_at": 1775969821, + "integration_name": "FlashMonit", + "integration_type": "monit.alert", + "integration_ref_id": "a_2451002751131", + "channel_name": "Ops Channel", + "channel_status": "enabled", + "responder_name": "", + "responder_email": "", + "incident": { + "incident_id": "69da451ef77b1b51f40e83ee", + "title": "CPU usage high - web-server-01", + "progress": "Triggered" }, - "schedule_id": 2539108069860, - "schedule_name": "Open Source Q&A", - "team_id": 2477033058131, - "description": "", - "layer_schedules": null, - "status": 0, - "cur_oncall": null, - "next_oncall": null + "event_cnt": 17, + "images": null, + "data_source_name": "FlashMonit", + "data_source_type": "monit.alert", + "data_source_ref_id": "a_2451002751131" } ] } @@ -8031,30 +7138,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleSelfRequest" + "$ref": "#/components/schemas/ListIncidentAlertsRequest" }, "example": { - "start": 1712000000, - "end": 1712086400 + "incident_id": "69da451ef77b1b51f40e83ee", + "is_active": true, + "limit": 100, + "p": 1 } } } } } }, - "/schedule/infos": { + "/incident/assign": { "post": { - "operationId": "scheduleInfos", - "summary": "批量获取值班表", - "description": "根据 ID 列表批量返回值班表信息。", + "operationId": "incidentAssign", + "summary": "分派故障", + "description": "将故障分派到指定的升级环节或处理人员。", "tags": [ - "On-call/值班排班" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **值班查看**(`on-call`) 或 **值班管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/schedules/schedule-infos", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-assign", "metadata": { - "sidebarTitle": "批量获取值班表" + "sidebarTitle": "分派故障" } }, "responses": { @@ -8071,7 +7180,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ScheduleSelfResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -8079,62 +7188,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "id": 5789640530410, - "name": "test-000001", - "account_id": 2451002751131, - "group_id": 4291079133131, - "disabled": 0, - "create_at": 1766110836, - "create_by": 2476123212131, - "update_at": 1775205795, - "update_by": 2476123212131, - "layers": null, - "schedule_layers": null, - "final_schedule": { - "layer_name": "", - "name": "", - "mode": 0, - "schedules": null - }, - "notify": { - "advance_in_time": 300, - "fixed_time": null, - "by": { - "follow_preference": false, - "personal_channels": [ - "email" - ] - }, - "webhooks": [ - { - "type": "feishu_app", - "settings": { - "token": "", - "alias": "", - "data_source_id": 5427276014131, - "chat_ids": [ - "oc_60a6dc4c6e4e5cbc4934ef08aa7ff76d" - ], - "verify_token": "", - "sign_secret": "" - } - } - ] - }, - "schedule_id": 5789640530410, - "schedule_name": "test-000001", - "team_id": 4291079133131, - "description": "abc", - "layer_schedules": null, - "status": 0, - "cur_oncall": null, - "next_oncall": null - } - ] - } + "data": {} } } } @@ -8157,33 +7211,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScheduleIDsRequest" + "$ref": "#/components/schemas/AssignIncidentRequest" }, "example": { - "schedule_ids": [ - 2001, - 2002, - 2003 - ] + "incident_id": "69da451ef77b1b51f40e83ee", + "assigned_to": { + "person_ids": [ + 2476444212131 + ], + "type": "assign" + } } } } } } }, - "/calendar/create": { + "/incident/comment": { "post": { - "operationId": "calendarCreate", - "summary": "创建服务日历", - "description": "创建个人服务日历。每个账户默认最多 5 个日历,可通过 Flashcat-Break-Cal-Limit 请求头突破限制。", + "operationId": "incidentComment", + "summary": "评论故障", + "description": "在故障时间线上添加文字评论。", "tags": [ - "On-call/日历管理" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **服务日历管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/calendars/calendar-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-comment", "metadata": { - "sidebarTitle": "创建服务日历" + "sidebarTitle": "评论故障" } }, "responses": { @@ -8200,7 +7256,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalendarCreateResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -8208,10 +7264,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "cal_name": "API Test Calendar" - } + "data": {} } } } @@ -8234,38 +7287,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalendarCreateRequest" + "$ref": "#/components/schemas/CommentIncidentRequest" }, "example": { - "cal_name": "Production On-Call Calendar", - "description": "Calendar for production on-call team", - "timezone": "Asia/Shanghai", - "workdays": [ - 1, - 2, - 3, - 4, - 5 - ] + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ], + "comment": "Identified the root cause. Rolling back the deployment now." } } } } } }, - "/calendar/update": { + "/incident/create": { "post": { - "operationId": "calendarUpdate", - "summary": "更新服务日历", - "description": "更新个人服务日历,仅更新传入的非空字段。", + "operationId": "incidentCreate", + "summary": "创建故障", + "description": "手动创建一个新故障并分派处理人员。", "tags": [ - "On-call/日历管理" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **服务日历管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/calendars/calendar-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-create", "metadata": { - "sidebarTitle": "更新服务日历" + "sidebarTitle": "创建故障" } }, "responses": { @@ -8282,7 +7329,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalendarEmptyObject" + "$ref": "#/components/schemas/CreateIncidentResponse" } } } @@ -8290,7 +7337,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "incident_id": "69db2ef1a0fe7db6448b14f1", + "title": "API test incident for docs" + } } } } @@ -8313,38 +7363,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalendarUpdateRequest" + "$ref": "#/components/schemas/CreateIncidentRequest" }, "example": { - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "cal_name": "Production On-Call Calendar (Updated)", - "timezone": "America/New_York", - "workdays": [ - 1, - 2, - 3, - 4, - 5 - ] + "incident_severity": "Critical", + "title": "Database connection timeout on prod-db-01", + "channel_id": 2551105804131, + "assigned_to": { + "person_ids": [ + 2476444212131 + ] + } } } } } } }, - "/calendar/delete": { + "/incident/custom-action/do": { "post": { - "operationId": "calendarDelete", - "summary": "删除服务日历", - "description": "删除个人服务日历。当日历被分派或静默策略引用时删除会失败。", + "operationId": "incidentCustomActionDo", + "summary": "执行自定义操作", + "description": "执行为故障配置的自定义操作。", "tags": [ - "On-call/日历管理" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **服务日历管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/calendars/calendar-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-custom-action-do", "metadata": { - "sidebarTitle": "删除服务日历" + "sidebarTitle": "执行自定义操作" } }, "responses": { @@ -8361,7 +7409,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalendarEmptyObject" + "$ref": "#/components/schemas/DoIncidentCustomActionResponse" } } } @@ -8369,7 +7417,9 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "message": "" + } } } } @@ -8392,29 +7442,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalendarIDRequest" + "$ref": "#/components/schemas/DoIncidentCustomActionRequest" }, "example": { - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM" + "incident_id": "69da451ef77b1b51f40e83ee", + "integration_id": 2490562293131 } } } } } }, - "/calendar/info": { + "/incident/disable-merge": { "post": { - "operationId": "calendarInfo", - "summary": "获取服务日历详情", - "description": "返回服务日历的详细信息。", + "operationId": "incidentDisableMerge", + "summary": "禁止故障合并", + "description": "禁用指定故障的自动合并功能。", "tags": [ - "On-call/日历管理" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/calendars/calendar-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-disable-merge", "metadata": { - "sidebarTitle": "获取服务日历详情" + "sidebarTitle": "禁止故障合并" } }, "responses": { @@ -8431,7 +7482,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalendarItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -8439,29 +7490,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "account_id": 2451002751131, - "team_id": 2477033058131, - "cal_id": "cal.eh9gvPtWeH3xXgKeVSRxRg", - "cal_name": "Stock Exchange Calendar", - "description": "A stock market trading calendar example", - "timezone": "Asia/Shanghai", - "kind": "personal", - "workdays": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6 - ], - "created_at": 1702455630, - "updated_at": 1775529526, - "creator_id": 2476444212131, - "updated_by": 3790925372131, - "status": "enabled" - } + "data": {} } } } @@ -8484,29 +7513,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalendarIDRequest" + "$ref": "#/components/schemas/DisableIncidentMergeRequest" }, "example": { - "cal_id": "cal.eh9gvPtWeH3xXgKeVSRxRg" + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ] } } } } } }, - "/calendar/list": { + "/incident/feed": { "post": { - "operationId": "calendarList", - "summary": "查询服务日历列表", - "description": "返回当前账户可见的服务日历列表。", + "operationId": "incidentFeed", + "summary": "获取故障时间线", + "description": "获取指定故障的时间线动态,包括状态变更、评论和系统事件。", "tags": [ - "On-call/日历管理" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/calendars/calendar-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-feed", "metadata": { - "sidebarTitle": "查询服务日历列表" + "sidebarTitle": "获取故障时间线" } }, "responses": { @@ -8523,7 +7554,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalendarListResponse" + "$ref": "#/components/schemas/ListIncidentFeedResponse" } } } @@ -8532,49 +7563,42 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "has_next_page": true, "items": [ { + "ref_id": "69da451ef77b1b51f40e83ee", + "type": "i_new", + "detail": { + "severity": "Critical", + "title": "CPU usage high - web-server-01" + }, "account_id": 2451002751131, - "team_id": 2477033058131, - "cal_id": "cal.eh9gvPtWeH3xXgKeVSRxRg", - "cal_name": "Stock Exchange Calendar", - "description": "A stock market trading calendar example", - "timezone": "Asia/Shanghai", - "kind": "personal", - "workdays": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6 - ], - "created_at": 1702455630, - "updated_at": 1775529526, - "creator_id": 2476444212131, - "updated_by": 3790925372131, - "status": "enabled" + "creator_id": 0, + "created_at": 1775912222661, + "updated_at": 1775912222661 }, { + "ref_id": "69da451ef77b1b51f40e83ee", + "type": "i_notify", + "detail": { + "rid": "5e9ccfabcd154b41a0005fd0f52b674b", + "msg_id": "naFudJYCawBWsChdV6ErPH", + "fire_type": "fire", + "escalate_rule_id": "000000000000000000000000", + "layer_idx": 0, + "by": "email", + "persons": [ + { + "person_id": 2476444212131 + } + ] + }, "account_id": 2451002751131, - "team_id": 0, - "cal_id": "cal.VZYkchxJhGELSF4jzkUAud", - "cal_name": "HK Stock Exchange Calendar", - "description": "Hong Kong Stock Exchange trading days calendar", - "timezone": "Asia/Shanghai", - "kind": "personal", - "extra_cal_ids": [ - "zh-cn.china.official" - ], - "created_at": 1702968470, - "updated_at": 1775188967, - "creator_id": 2451002751131, - "updated_by": 3790925372131, - "status": "enabled" + "creator_id": 0, + "created_at": 1775972130174, + "updated_at": 1775972130174 } - ], - "total": 8 + ] } } } @@ -8598,29 +7622,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalendarListRequest" + "$ref": "#/components/schemas/ListIncidentFeedRequest" }, "example": { - "kind": "personal" + "incident_id": "69da451ef77b1b51f40e83ee", + "p": 1, + "limit": 20 } } } } } }, - "/calendar/event/upsert": { + "/incident/field/reset": { "post": { - "operationId": "calEventUpsert", - "summary": "创建或更新日历事件", - "description": "创建或更新日历事件(节假日或工作日覆盖)。不传 event_id 时会创建新事件。", + "operationId": "incidentFieldReset", + "summary": "更新故障自定义字段", + "description": "更新故障的自定义字段值。", "tags": [ - "On-call/日历管理" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **服务日历管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/calendars/cal-event-upsert", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-field-reset", "metadata": { - "sidebarTitle": "创建或更新日历事件" + "sidebarTitle": "更新故障自定义字段" } }, "responses": { @@ -8637,7 +7663,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalEventUpsertResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -8645,11 +7671,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "event_id": "cale.KyG9XWTCU5CucbwukEVBQ4", - "summary": "Test Holiday" - } + "data": {} } } } @@ -8672,34 +7694,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalEventUpsertRequest" + "$ref": "#/components/schemas/ResetIncidentFieldRequest" }, "example": { - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "summary": "Labour Day", - "start_at": "2024-05-01", - "end_at": "2024-05-06", - "is_off": true, - "description": "International Workers Day holiday" + "incident_id": "69da451ef77b1b51f40e83ee", + "field_name": "affected_service", + "field_value": "payment-service" } } } } } }, - "/calendar/event/delete": { + "/incident/info": { "post": { - "operationId": "calEventDelete", - "summary": "删除日历事件", - "description": "根据日历 ID 与事件 ID 删除日历事件。", + "operationId": "incidentInfo", + "summary": "获取故障详情", + "description": "获取单个故障的详细信息,包括时间线、关联告警、处理人员和自定义字段。", "tags": [ - "On-call/日历管理" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **服务日历管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/calendars/cal-event-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-info", "metadata": { - "sidebarTitle": "删除日历事件" + "sidebarTitle": "获取故障详情" } }, "responses": { @@ -8716,7 +7735,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalendarEmptyObject" + "$ref": "#/components/schemas/IncidentInfo" } } } @@ -8724,7 +7743,84 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "incident_id": "69da451ef77b1b51f40e83ee", + "account_id": 2451002751131, + "channel_id": 2551105804131, + "integration_id": 2490562293131, + "integration_ids": [ + 2490562293131 + ], + "integration_types": [ + "monit.alert" + ], + "dedup_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", + "equals_md5": "", + "start_time": 1775912219, + "end_time": 0, + "last_time": 1775969819, + "ack_time": 0, + "close_time": 0, + "creator_id": 0, + "closer_id": 0, + "owner_id": 0, + "incident_status": "Critical", + "incident_severity": "Critical", + "progress": "Triggered", + "title": "CPU usage high - web-server-01", + "description": "", + "ai_summary": "", + "impact": "", + "root_cause": "", + "resolution": "", + "num": "0E83EE", + "frequency": "frequent", + "created_at": 1775912222, + "updated_at": 1775972145, + "snoozed_before": 0, + "group_method": "n", + "ever_muted": false, + "labels": { + "check": "cpu_usage_high", + "resource": "web-server-01", + "env": "production" + }, + "fields": {}, + "assigned_to": { + "person_ids": [ + 2476444212131 + ], + "escalate_rule_id": "000000000000000000000000", + "layer_idx": 0, + "type": "assign", + "assigned_at": 1775972128, + "id": "MvQfH9Dc8eNS8k79jmrWn6", + "escalate_rule_name": "" + }, + "alert_cnt": 1, + "active_alert_cnt": 1, + "alert_event_cnt": 17, + "responders": [ + { + "person_id": 2476444212131, + "assigned_at": 1775972128, + "acknowledged_at": 0 + } + ], + "account_name": "", + "account_locale": "", + "account_time_zone": "", + "channel_name": "Ops Channel", + "channel_status": "enabled", + "detail_url": "https://app.flashcat.cloud/incident/detail/69da451ef77b1b51f40e83ee", + "silence_url": "https://app.flashcat.cloud/channel/detail/2551105804131?tab=alertSuppression&fromIncidentId=69da451ef77b1b51f40e83ee", + "integration_type": "monit.alert", + "post_mortem_id": "", + "images": null, + "manual_overrides": [ + "title" + ] + } } } } @@ -8747,30 +7843,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalEventIDRequest" + "$ref": "#/components/schemas/IncidentInfoRequest" }, "example": { - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "event_id": "cale.KyG9XWTCU5CucbwukEVBQ4" + "incident_id": "69da451ef77b1b51f40e83ee" } } } } } }, - "/calendar/event/list": { + "/incident/list": { "post": { - "operationId": "calEventList", - "summary": "查询日历事件列表", - "description": "返回个人日历在指定年/月/日范围内的事件列表。未同时传入 month 和 day 时返回整年数据。", + "operationId": "incidentList", + "summary": "查询故障列表", + "description": "分页查询故障列表,支持按协作空间、严重程度、状态、处理人员和时间范围过滤。", "tags": [ - "On-call/日历管理" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/calendars/cal-event-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-list", "metadata": { - "sidebarTitle": "查询日历事件列表" + "sidebarTitle": "查询故障列表" } }, "responses": { @@ -8787,7 +7882,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CalEventListResponse" + "$ref": "#/components/schemas/IncidentListResponse" } } } @@ -8796,35 +7891,89 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "total": 88, + "has_next_page": true, + "search_after_ctx": "69da451ef77b1b51f40e83eb", "items": [ { + "incident_id": "69da451ef77b1b51f40e83ee", "account_id": 2451002751131, - "creator_id": 2476444212131, - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "event_id": "cale.KyG9XWTCU5CucbwukEVBQ4", - "summary": "Test Holiday", - "description": "A test holiday event", - "start_at": "2026-05-01", - "end_at": "2026-05-02", - "is_off": true, - "created_at": 1775972034, - "updated_at": 1775972034 - }, - { - "account_id": 2451002751131, - "creator_id": 2451002751131, - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "event_id": "non_work.20260502", - "summary": "non-working day (Saturday)", + "channel_id": 2551105804131, + "integration_id": 2490562293131, + "integration_ids": [ + 2490562293131 + ], + "integration_types": [ + "monit.alert" + ], + "dedup_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", + "equals_md5": "", + "start_time": 1775912219, + "end_time": 0, + "last_time": 1775969819, + "ack_time": 0, + "close_time": 0, + "creator_id": 0, + "closer_id": 0, + "owner_id": 0, + "incident_status": "Critical", + "incident_severity": "Critical", + "progress": "Triggered", + "title": "CPU usage high - web-server-01", "description": "", - "start_at": "2026-05-02", - "end_at": "2026-05-03", - "is_off": true, - "created_at": 0, - "updated_at": 0 + "ai_summary": "", + "impact": "", + "root_cause": "", + "resolution": "", + "num": "0E83EE", + "frequency": "frequent", + "created_at": 1775912222, + "updated_at": 1775972145, + "snoozed_before": 0, + "group_method": "n", + "ever_muted": false, + "labels": { + "check": "cpu_usage_high", + "resource": "web-server-01", + "env": "production" + }, + "fields": {}, + "assigned_to": { + "person_ids": [ + 2476444212131 + ], + "escalate_rule_id": "000000000000000000000000", + "layer_idx": 0, + "type": "assign", + "assigned_at": 1775972128, + "id": "MvQfH9Dc8eNS8k79jmrWn6", + "escalate_rule_name": "" + }, + "alert_cnt": 1, + "active_alert_cnt": 1, + "alert_event_cnt": 17, + "responders": [ + { + "person_id": 2476444212131, + "assigned_at": 1775972128, + "acknowledged_at": 0 + } + ], + "account_name": "", + "account_locale": "", + "account_time_zone": "", + "channel_name": "Ops Channel", + "channel_status": "enabled", + "detail_url": "https://app.flashcat.cloud/incident/detail/69da451ef77b1b51f40e83ee", + "silence_url": "https://app.flashcat.cloud/channel/detail/2551105804131?tab=alertSuppression&fromIncidentId=69da451ef77b1b51f40e83ee", + "integration_type": "monit.alert", + "post_mortem_id": "", + "images": null, + "manual_overrides": [ + "title" + ] } - ], - "total": 11 + ] } } } @@ -8848,31 +7997,37 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalEventListRequest" + "$ref": "#/components/schemas/ListIncidentsRequest" }, "example": { - "cal_id": "cal.QiNvtdKs4Wj52kZhT3LafM", - "year": 2024, - "month": 5 + "start_time": 1711900800, + "end_time": 1712000000, + "progress": "Triggered,Processing", + "incident_severity": "Critical,Warning", + "channel_ids": [ + 2551105804131 + ], + "limit": 20, + "p": 1 } } } } } }, - "/template/info": { + "/incident/list-by-ids": { "post": { - "operationId": "template-read-info", - "summary": "查看模板详情", - "description": "按 ID 返回单个通知模板。", + "operationId": "incidentListByIds", + "summary": "批量查询故障", + "description": "通过故障 ID 列表批量获取故障信息。", "tags": [ - "On-call/通知模板" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **模板查看**(`on-call`) |\n\n## 使用说明\n\n- 传入 `000000000000000000000001` 作为 `template_id` 可以获取当前账户语种下的系统预置模板。", - "href": "/zh/api-reference/on-call/notification-templates/template-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-list-by-ids", "metadata": { - "sidebarTitle": "查看模板详情" + "sidebarTitle": "批量查询故障" } }, "responses": { @@ -8889,7 +8044,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TemplateItem" + "$ref": "#/components/schemas/IncidentListResponse" } } } @@ -8898,30 +8053,73 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "account_id": 10023, - "team_id": 0, - "template_id": "6605a1b2c3d4e5f6a7b8c9d0", - "template_name": "生产环境默认模板", - "description": "Default template for production incidents.", - "email": "Incident {{ .IncidentName }} on {{ .Severity }}", - "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}", - "voice": "", - "dingtalk": "", - "wecom": "", - "feishu": "", - "feishu_app": "", - "dingtalk_app": "", - "wecom_app": "", - "slack_app": "", - "teams_app": "", - "telegram": "", - "slack": "", - "zoom": "", - "status": "enabled", - "creator_id": 80011, - "updated_by": 80011, - "created_at": 1712700000, - "updated_at": 1712702400 + "total": 2, + "has_next_page": false, + "items": [ + { + "incident_id": "69da451ef77b1b51f40e83ee", + "account_id": 2451002751131, + "channel_id": 2551105804131, + "integration_id": 2490562293131, + "integration_ids": [ + 2490562293131 + ], + "integration_types": [ + "monit.alert" + ], + "dedup_key": "100128:prom-10.99.1.107:A:1579244238440766834:anydata", + "equals_md5": "", + "start_time": 1775912219, + "end_time": 0, + "last_time": 1775969819, + "ack_time": 0, + "close_time": 0, + "creator_id": 0, + "closer_id": 0, + "owner_id": 0, + "incident_status": "Critical", + "incident_severity": "Critical", + "progress": "Triggered", + "title": "CPU usage high - web-server-01", + "description": "", + "ai_summary": "", + "impact": "", + "root_cause": "", + "resolution": "", + "num": "0E83EE", + "frequency": "frequent", + "created_at": 1775912222, + "updated_at": 1775972145, + "snoozed_before": 0, + "group_method": "n", + "ever_muted": false, + "labels": {}, + "fields": {}, + "assigned_to": { + "escalate_rule_id": "000000000000000000000000", + "layer_idx": 0, + "type": "", + "assigned_at": 0, + "id": "", + "escalate_rule_name": "" + }, + "alert_cnt": 1, + "active_alert_cnt": 1, + "alert_event_cnt": 17, + "responders": [], + "account_name": "", + "account_locale": "", + "account_time_zone": "", + "channel_name": "Ops Channel", + "channel_status": "enabled", + "detail_url": "https://app.flashcat.cloud/incident/detail/69da451ef77b1b51f40e83ee", + "silence_url": "https://app.flashcat.cloud/channel/detail/2551105804131?tab=alertSuppression&fromIncidentId=69da451ef77b1b51f40e83ee", + "integration_type": "monit.alert", + "post_mortem_id": "", + "images": null, + "manual_overrides": null + } + ] } } } @@ -8945,29 +8143,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateIDRequest" + "$ref": "#/components/schemas/ListIncidentsByIdsRequest" }, "example": { - "template_id": "6605a1b2c3d4e5f6a7b8c9d0" + "incident_ids": [ + "69da451ef77b1b51f40e83ee", + "69da451ef77b1b51f40e83ef" + ] } } } } } }, - "/template/list": { + "/incident/merge": { "post": { - "operationId": "template-read-list", - "summary": "查询模板列表", - "description": "分页返回当前账户下的通知模板列表。", + "operationId": "incidentMerge", + "summary": "合并故障", + "description": "将一个或多个故障合并到目标故障中。", "tags": [ - "On-call/通知模板" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **模板查看**(`on-call`) 或 **模板管理**(`on-call`) |\n\n## 使用说明\n\n- 默认返回第 1 页、每页 20 条。响应中的 `has_next_page` 可以直接告知是否还有下一页,无需额外计数请求。\n- 当 `is_my_team=true` 时 `team_ids` 字段会被忽略。", - "href": "/zh/api-reference/on-call/notification-templates/template-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-merge", "metadata": { - "sidebarTitle": "查询模板列表" + "sidebarTitle": "合并故障" } }, "responses": { @@ -8984,7 +8185,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TemplateListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -8992,38 +8193,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 47, - "has_next_page": true, - "items": [ - { - "account_id": 10023, - "team_id": 0, - "template_id": "6605a1b2c3d4e5f6a7b8c9d0", - "template_name": "生产环境默认模板", - "description": "Default template for production incidents.", - "email": "Incident {{ .IncidentName }} on {{ .Severity }}", - "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}", - "voice": "", - "dingtalk": "", - "wecom": "", - "feishu": "", - "feishu_app": "", - "dingtalk_app": "", - "wecom_app": "", - "slack_app": "", - "teams_app": "", - "telegram": "", - "slack": "", - "zoom": "", - "status": "enabled", - "creator_id": 80011, - "updated_by": 80011, - "created_at": 1712700000, - "updated_at": 1712702400 - } - ] - } + "data": {} } } } @@ -9046,33 +8216,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateListRequest" + "$ref": "#/components/schemas/MergeIncidentsRequest" }, "example": { - "p": 1, - "limit": 20, - "orderby": "updated_at", - "asc": false, - "is_my_team": false + "source_incident_ids": [ + "69da451ef77b1b51f40e83ef", + "69da451ef77b1b51f40e83f0" + ], + "target_incident_id": "69da451ef77b1b51f40e83ee", + "comment": "Merging related database connectivity incidents into one." } } } } } }, - "/template/create": { + "/incident/past/list": { "post": { - "operationId": "template-write-create", - "summary": "创建模板", - "description": "创建一个新的通知模板。", + "operationId": "incidentPastList", + "summary": "查询历史相似故障", + "description": "查询与当前故障相关的历史故障列表,用于参考排查。", "tags": [ - "On-call/通知模板" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **模板管理**(`on-call`) |\n\n## 使用说明\n\n- `template_name` 必须在账户内唯一,重名会返回 `InvalidParameter`。\n- 服务端会对所有非空通道按 Mock 故障做一次渲染校验,任何通道的语法错误都会导致整个请求返回 `InvalidParameter`。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/notification-templates/template-write-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **100 次/分钟**;**20 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-past-list", "metadata": { - "sidebarTitle": "创建模板" + "sidebarTitle": "查询历史相似故障" } }, "responses": { @@ -9089,7 +8260,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TemplateCreateResponse" + "$ref": "#/components/schemas/ListPastIncidentsResponse" } } } @@ -9098,8 +8269,7 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "template_id": "6605a1b2c3d4e5f6a7b8c9d0", - "template_name": "生产环境默认模板" + "items": [] } } } @@ -9123,33 +8293,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateCreateRequest" + "$ref": "#/components/schemas/ListPastIncidentsRequest" }, "example": { - "team_id": 0, - "template_name": "生产环境默认模板", - "description": "生产环境故障的默认模板。", - "email": "Incident {{ .IncidentName }} on {{ .Severity }}", - "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}" + "incident_id": "69da451ef77b1b51f40e83ee", + "limit": 5 } } } } } }, - "/template/update": { + "/incident/post-mortem/basics/reset": { "post": { - "operationId": "template-write-update", - "summary": "更新模板", - "description": "替换指定模板在所有通道上的内容。", + "operationId": "postmortem-write-reset-basics", + "summary": "更新故障复盘基础信息", + "description": "替换复盘报告中记录的故障基础信息。", "tags": [ - "On-call/通知模板" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **模板管理**(`on-call`) |\n\n## 使用说明\n\n- 请求中的每个通道字段会覆盖存储值——想清空某通道时,把该字段设置为空字符串即可。\n- 调用者必须对目标模板所属团队拥有数据权限,否则返回 `AccessDenied`。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/notification-templates/template-write-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/incidents/postmortem-write-reset-basics", "metadata": { - "sidebarTitle": "更新模板" + "sidebarTitle": "更新故障复盘基础信息" } }, "responses": { @@ -9166,7 +8333,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyObject" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -9185,9 +8352,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -9200,33 +8364,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateUpdateRequest" + "$ref": "#/components/schemas/ResetPostMortemBasicsRequest" }, "example": { - "template_id": "6605a1b2c3d4e5f6a7b8c9d0", - "template_name": "生产环境默认模板", - "description": "已更新的描述。", - "email": "Incident {{ .IncidentName }} on {{ .Severity }}", - "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}" + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", + "incidents_highest_severity": "Warning", + "incidents_earliest_start_seconds": 1761133512, + "incidents_latest_close_seconds": 1761133632, + "incidents_total_duration_seconds": 120, + "responder_ids": [ + 3790925372131 + ] } } } } } }, - "/template/delete": { + "/incident/post-mortem/delete": { "post": { - "operationId": "template-write-delete", - "summary": "删除模板", - "description": "按 ID 软删除一个模板。", + "operationId": "incidentPostMortemDelete", + "summary": "删除复盘报告", + "description": "删除指定的复盘报告。", "tags": [ - "On-call/通知模板" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **模板管理**(`on-call`) |\n\n## 使用说明\n\n- 若模板仍被任何协作空间、分派策略或通知订阅引用,会返回 `400 ReferenceExist`。\n- 删除是软删除(`deleted_at` 被置值),记录仍保留用于审计,但模板不会再出现在列表中。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/notification-templates/template-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-post-mortem-delete", "metadata": { - "sidebarTitle": "删除模板" + "sidebarTitle": "删除复盘报告" } }, "responses": { @@ -9243,7 +8410,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyObject" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -9262,9 +8429,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -9277,29 +8441,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateIDRequest" + "$ref": "#/components/schemas/DeletePostMortemRequest" }, "example": { - "template_id": "6605a1b2c3d4e5f6a7b8c9d0" + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e" } } } } } }, - "/enrichment/info": { + "/incident/post-mortem/follow-ups/reset": { "post": { - "operationId": "enrichment-read-info", - "summary": "查看富化规则", - "description": "返回指定集成配置的告警富化规则集。", + "operationId": "postmortem-write-reset-follow-ups", + "summary": "更新故障复盘后续行动", + "description": "替换复盘报告中的后续行动项。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) 或 **协作空间管理**(`on-call`) 或 **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) |\n\n## 使用说明\n\n- 若该集成尚未配置富化规则,返回 `null`。", - "href": "/zh/api-reference/on-call/alert-enrichment/enrichment-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/incidents/postmortem-write-reset-follow-ups", "metadata": { - "sidebarTitle": "查看富化规则" + "sidebarTitle": "更新故障复盘后续行动" } }, "responses": { @@ -9316,7 +8480,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EnrichmentItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -9324,25 +8488,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "integration_id": 5001, - "rules": [ - { - "kind": "extraction", - "settings": { - "source_field": "labels.env", - "result_label": "environment", - "pattern": "^(prod|staging|dev).*$", - "override": true - } - } - ], - "status": "enabled", - "updated_by": 80011, - "creator_id": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 - } + "data": {} } } } @@ -9365,29 +8511,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnrichmentInfoRequest" + "$ref": "#/components/schemas/ResetPostMortemFollowUpsRequest" }, "example": { - "integration_id": 5001 + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", + "follow_ups": "- Add database saturation alert\n- Review cache TTL rollout" } } } } } }, - "/enrichment/list": { - "post": { - "operationId": "enrichment-read-list", - "summary": "批量查询富化规则", - "description": "批量返回指定集成 ID 列表的告警富化规则集。", + "/incident/post-mortem/info": { + "get": { + "operationId": "incidentPostMortemInfo", + "summary": "获取复盘报告", + "description": "通过 `post_mortem_id` 获取复盘报告。先用 `/incident/post-mortem/list` 列出报告(每行标明所属故障),再用其 id 在此获取完整报告。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/alert-enrichment/enrichment-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-post-mortem-info", "metadata": { - "sidebarTitle": "批量查询富化规则" + "sidebarTitle": "获取复盘报告" } }, "responses": { @@ -9404,7 +8551,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EnrichmentListResponse" + "$ref": "#/components/schemas/PostMortemItem" } } } @@ -9413,17 +8560,43 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ - { - "integration_id": 5001, - "rules": [], - "status": "enabled", - "updated_by": 80011, - "creator_id": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 - } - ] + "meta": { + "account_id": 2451002751131, + "title": "Postmortem1", + "status": "published", + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", + "template_id": "post_mortem_default_tmpl_en-us", + "incident_ids": [ + "69bb9233331067560c718ecd" + ], + "media_count": 0, + "author_ids": [ + 2477273692131 + ], + "team_id": 2477033058131, + "channel_id": 3047621227131, + "is_private": false, + "channel_name": "Ops Channel", + "created_at_seconds": 1773900354, + "updated_at_seconds": 1773909012 + }, + "basics": { + "incidents_highest_severity": "Warning", + "incidents_earliest_start_seconds": 1761133512, + "incidents_latest_close_seconds": 1761133632, + "incidents_total_duration_seconds": 120, + "responders": [ + { + "person_id": 3790925372131, + "assigned_at": 1761133515, + "acknowledged_at": 0 + } + ] + }, + "content": { + "content": "{\"type\":\"doc\",\"content\":[]}" + }, + "follow_ups": "" } } } @@ -9442,37 +8615,32 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EnrichmentListRequest" - }, - "example": { - "integration_ids": [ - 5001, - 5002 - ] - } - } + "parameters": [ + { + "name": "post_mortem_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + }, + "description": "Post-mortem ID. Deterministic hash derived from account ID and the set of linked incident IDs." } - } + ] } }, - "/enrichment/upsert": { + "/incident/post-mortem/init": { "post": { - "operationId": "enrichment-write-upsert", - "summary": "创建或替换富化规则", - "description": "创建或全量替换指定集成的告警富化规则集,`rules` 数组将被原子替换。", + "operationId": "postmortem-write-init", + "summary": "初始化故障复盘", + "description": "根据一个或多个故障和模板创建复盘草稿。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间管理**(`on-call`) 或 **集成中心管理**(`on-call`) |\n\n## 使用说明\n\n- 富化规则按顺序依次执行。\n- 每条规则有一个 `kind`:`extraction`(正则/gjson 提取)、`composition`(模板组合标签)、`mapping`(通过映射规则或 API 查找)、`drop`(删除标签)。\n- 可选的 `if` 字段为 `AndFilters` 条件,不匹配时跳过该规则。\n- `kind: extraction`:`source_field` 须为 `title`、`description` 或 `labels.*` 前缀的键;`pattern`(正则,须包含命名分组 `result`)和 `g_json`(GJson 路径)二选一。\n- `kind: composition`:`template` 使用 Go text/template 语法,可引用 `labels.*` 键。\n- `kind: mapping`:`mapping_type` 为 `schema`(默认)或 `api`;分别提供 `schema_id` 或 `api_id`。\n- `kind: drop`:`drop_labels` 列出要删除的标签键名。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/alert-enrichment/enrichment-write-upsert", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |\n\n## 使用说明\n\n- 最多可将 10 个故障关联到同一份复盘报告。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/incidents/postmortem-write-init", "metadata": { - "sidebarTitle": "创建或替换富化规则" + "sidebarTitle": "初始化故障复盘" } }, "responses": { @@ -9489,7 +8657,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/PostMortemItem" } } } @@ -9497,7 +8665,45 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "meta": { + "account_id": 2451002751131, + "title": "Postmortem1", + "status": "published", + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", + "template_id": "post_mortem_default_tmpl_en-us", + "incident_ids": [ + "69bb9233331067560c718ecd" + ], + "media_count": 0, + "author_ids": [ + 2477273692131 + ], + "team_id": 2477033058131, + "channel_id": 3047621227131, + "is_private": false, + "channel_name": "Ops Channel", + "created_at_seconds": 1773900354, + "updated_at_seconds": 1773909012 + }, + "basics": { + "incidents_highest_severity": "Warning", + "incidents_earliest_start_seconds": 1761133512, + "incidents_latest_close_seconds": 1761133632, + "incidents_total_duration_seconds": 120, + "responders": [ + { + "person_id": 3790925372131, + "assigned_at": 1761133515, + "acknowledged_at": 0 + } + ] + }, + "content": { + "content": "{\"type\":\"doc\",\"content\":[]}" + }, + "follow_ups": "" + } } } } @@ -9520,40 +8726,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnrichmentUpsertRequest" + "$ref": "#/components/schemas/InitPostMortemRequest" }, "example": { - "integration_id": 5001, - "rules": [ - { - "kind": "extraction", - "settings": { - "source_field": "labels.env", - "result_label": "environment", - "pattern": "(?Pprod|staging|dev)", - "override": true - } - } - ] + "incident_ids": [ + "69bb9233331067560c718ecd" + ], + "template_id": "post_mortem_default_tmpl_en-us" } } } } } }, - "/enrichment/mapping/schema/list": { + "/incident/post-mortem/list": { "post": { - "operationId": "mapping-schema-read-list", - "summary": "查询映射规则列表", - "description": "返回账户下所有映射规则,按创建时间升序排列。", + "operationId": "incidentPostMortemList", + "summary": "查询复盘报告列表", + "description": "分页查询复盘报告列表,支持过滤条件。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) 或 **协作空间管理**(`on-call`) 或 **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) 或 **映射数据查看**(`on-call`) 或 **映射数据管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-schema-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-post-mortem-list", "metadata": { - "sidebarTitle": "查询映射规则列表" + "sidebarTitle": "查询复盘报告列表" } }, "responses": { @@ -9570,7 +8768,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingSchemaListResponse" + "$ref": "#/components/schemas/ListPostMortemsResponse" } } } @@ -9579,25 +8777,28 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 1, + "total": 3, + "has_next_page": false, "items": [ { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01", - "schema_name": "CMDB 查询", - "description": "用 CMDB 数据富化告警", - "source_labels": [ - "host" + "account_id": 2451002751131, + "title": "Postmortem1", + "status": "published", + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", + "template_id": "post_mortem_default_tmpl_en-us", + "incident_ids": [ + "69bb9233331067560c718ecd" ], - "result_labels": [ - "owner", - "team", - "service" + "media_count": 0, + "author_ids": [ + 2477273692131 ], - "status": "enabled", - "team_id": 0, - "creator_id": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 + "team_id": 2477033058131, + "channel_id": 3047621227131, + "is_private": false, + "channel_name": "Ops Channel", + "created_at_seconds": 1773900354, + "updated_at_seconds": 1773909012 } ] } @@ -9623,27 +8824,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmptyRequest" + "$ref": "#/components/schemas/ListPostMortemsRequest" }, - "example": {} + "example": { + "status": "published", + "p": 1, + "limit": 20 + } } } } } }, - "/enrichment/mapping/schema/info": { + "/incident/post-mortem/status/reset": { "post": { - "operationId": "mapping-schema-read-info", - "summary": "查看映射规则详情", - "description": "根据映射规则 ID 返回单个映射规则的详细信息。", + "operationId": "postmortem-write-reset-status", + "summary": "更新故障复盘状态", + "description": "将复盘报告设置为草稿或已发布。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) 或 **映射数据查看**(`on-call`) 或 **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 映射规则不存在时返回 `null`。", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-schema-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/incidents/postmortem-write-reset-status", "metadata": { - "sidebarTitle": "查看映射规则详情" + "sidebarTitle": "更新故障复盘状态" } }, "responses": { @@ -9660,7 +8865,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingSchemaItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -9668,24 +8873,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01", - "schema_name": "CMDB 查询", - "description": "用 CMDB 数据富化告警", - "source_labels": [ - "host" - ], - "result_labels": [ - "owner", - "team", - "service" - ], - "status": "enabled", - "team_id": 0, - "creator_id": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 - } + "data": {} } } } @@ -9708,29 +8896,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingSchemaIDRequest" + "$ref": "#/components/schemas/ResetPostMortemStatusRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01" + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", + "status": "published" } } } } } }, - "/enrichment/mapping/schema/create": { + "/incident/post-mortem/template/delete": { "post": { - "operationId": "mapping-schema-write-create", - "summary": "创建映射规则", - "description": "创建新的映射规则,定义查找来源标签和待填充的结果标签。需要 Pro 计划。", + "operationId": "postmortem-write-delete-template", + "summary": "删除故障复盘模板", + "description": "删除自定义复盘模板。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 映射规则名称在账户内唯一。\n- `source_labels`(1–3 个)为查找键,`result_labels`(1–10 个)为匹配后写入的标签。\n- 标签名须符合 `^[a-z][a-z0-9_]{0,39}$`(小写)。\n- `source_labels` 与 `result_labels` 不得重叠。\n- 账户最多可创建 20 个映射规则。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-schema-write-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/incidents/postmortem-write-delete-template", "metadata": { - "sidebarTitle": "创建映射规则" + "sidebarTitle": "删除故障复盘模板" } }, "responses": { @@ -9747,7 +8936,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingSchemaCreateResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -9755,10 +8944,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01", - "schema_name": "CMDB 查询" - } + "data": {} } } } @@ -9781,38 +8967,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingSchemaCreateRequest" + "$ref": "#/components/schemas/DeletePostMortemTemplateRequest" }, "example": { - "schema_name": "CMDB 查询", - "description": "用 CMDB 数据富化告警", - "source_labels": [ - "host" - ], - "result_labels": [ - "owner", - "team", - "service" - ] + "template_id": "post_mortem_custom_tmpl_01" } } } } } }, - "/enrichment/mapping/schema/update": { - "post": { - "operationId": "mapping-schema-write-update", - "summary": "更新映射规则", - "description": "更新映射规则的名称、描述或所属团队。来源标签和结果标签创建后不可更改。", + "/incident/post-mortem/template/info": { + "get": { + "operationId": "postmortem-read-template-info", + "summary": "查看故障复盘模板详情", + "description": "按 ID 返回单个故障复盘模板。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 仅映射规则创建者、账户管理员或所属团队成员可更新。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-schema-write-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/postmortem-read-template-info", "metadata": { - "sidebarTitle": "更新映射规则" + "sidebarTitle": "查看故障复盘模板详情" } }, "responses": { @@ -9829,7 +9006,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/PostMortemTemplate" } } } @@ -9837,7 +9014,17 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "account_id": 2451002751131, + "template_id": "post_mortem_default_tmpl_en-us", + "name": "Default post-mortem report", + "description": "Default sections for post-mortem reports.", + "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", + "content_markdown": "## Summary\nDescribe what happened.", + "team_id": 2477033058131, + "created_at_seconds": 1773900000, + "updated_at_seconds": 1773903600 + } } } } @@ -9855,36 +9042,32 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MappingSchemaUpdateRequest" - }, - "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01", - "schema_name": "CMDB 查询 v2", - "description": "更新后的描述" - } - } + "parameters": [ + { + "name": "template_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + }, + "description": "Template ID." } - } + ] } }, - "/enrichment/mapping/schema/delete": { + "/incident/post-mortem/template/list": { "post": { - "operationId": "mapping-schema-write-delete", - "summary": "删除映射规则", - "description": "删除映射规则及其所有关联数据。若该规则被富化规则或 Webhook 引用,则拒绝删除。", + "operationId": "postmortem-read-list-templates", + "summary": "查询故障复盘模板列表", + "description": "返回账号下的内置和自定义故障复盘模板。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 若映射规则仍被引用,响应返回 HTTP 400,`refs` 字段列出所有阻止删除的引用。\n- 仅映射规则创建者、账户管理员或所属团队成员可删除。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。\n- 本接口为高危操作。控制台 JWT 调用需二次验证码;`app_key` 调用跳过 MFA 但仍会被完整记录,请妥善保管 app_key。", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-schema-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/postmortem-read-list-templates", "metadata": { - "sidebarTitle": "删除映射规则" + "sidebarTitle": "查询故障复盘模板列表" } }, "responses": { @@ -9901,7 +9084,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ListPostMortemTemplatesResponse" } } } @@ -9909,8 +9092,24 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } + "data": { + "total": 2, + "has_next_page": false, + "items": [ + { + "account_id": 2451002751131, + "template_id": "post_mortem_default_tmpl_en-us", + "name": "Default post-mortem report", + "description": "Default sections for post-mortem reports.", + "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", + "content_markdown": "## Summary\nDescribe what happened.", + "team_id": 2477033058131, + "created_at_seconds": 1773900000, + "updated_at_seconds": 1773903600 + } + ] + } + } } } }, @@ -9932,29 +9131,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingSchemaIDRequest" + "$ref": "#/components/schemas/ListPostMortemTemplatesRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01" + "p": 1, + "limit": 20, + "order_by": "created_at_seconds", + "asc": false } } } } } }, - "/enrichment/mapping/data/list": { + "/incident/post-mortem/template/upsert": { "post": { - "operationId": "mapping-data-read-list", - "summary": "查询映射数据列表", - "description": "分页返回指定映射规则的数据行,可按来源标签值进行精确过滤。", + "operationId": "postmortem-write-upsert-template", + "summary": "创建或更新故障复盘模板", + "description": "创建自定义复盘模板,或更新已有模板。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) 或 **映射数据查看**(`on-call`) 或 **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 若提供 `query`,须包含全部来源标签——不支持部分来源标签查询。\n- 支持游标分页(`search_after_ctx`)或页码分页(`p`、`limit`)。`limit` 默认 20,最大 100。\n- 响应中的 `search_after_ctx` 可用于获取下一页。", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-data-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/incidents/postmortem-write-upsert-template", "metadata": { - "sidebarTitle": "查询映射数据列表" + "sidebarTitle": "创建或更新故障复盘模板" } }, "responses": { @@ -9971,7 +9173,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingDataListResponse" + "$ref": "#/components/schemas/PostMortemTemplate" } } } @@ -9980,21 +9182,15 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ - { - "key": "server01", - "fields": { - "host": "server01", - "owner": "alice", - "team": "sre", - "service": "api" - }, - "created_at": 1710000000, - "updated_at": 1710000000 - } - ], - "total": 1, - "has_next_page": false + "account_id": 2451002751131, + "template_id": "post_mortem_default_tmpl_en-us", + "name": "Default post-mortem report", + "description": "Default sections for post-mortem reports.", + "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", + "content_markdown": "## Summary\nDescribe what happened.", + "team_id": 2477033058131, + "created_at_seconds": 1773900000, + "updated_at_seconds": 1773903600 } } } @@ -10018,33 +9214,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingDataListRequest" + "$ref": "#/components/schemas/UpsertPostMortemTemplateRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01", - "orderby": "updated_at", - "asc": false, - "p": 1, - "limit": 20 + "team_id": 2477033058131, + "name": "Production incident template", + "description": "Template for production incident reviews.", + "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", + "content_markdown": "## Summary\nDescribe what happened." } } } } } }, - "/enrichment/mapping/data/upsert": { + "/incident/post-mortem/title/reset": { "post": { - "operationId": "mapping-data-write-upsert", - "summary": "写入映射数据", - "description": "向映射规则中插入或更新最多 1000 条数据行,每行须包含所有来源标签和结果标签。", + "operationId": "postmortem-write-reset-title", + "summary": "更新故障复盘标题", + "description": "替换复盘报告标题。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 每条数据须包含映射规则中定义的所有来源标签和结果标签的值。\n- 未知标签的值将被静默忽略。\n- 每个值最多 2048 个字符。\n- Upsert 以来源标签组合为键,来源键相同的行将被更新。\n- 单个映射规则默认最多存储 10,000 条数据。\n- 每个映射规则的写入操作有锁保护,并发 Upsert 可能返回 `ErrRequestTooFrequently`。", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-data-write-upsert", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/incidents/postmortem-write-reset-title", "metadata": { - "sidebarTitle": "写入映射数据" + "sidebarTitle": "更新故障复盘标题" } }, "responses": { @@ -10061,7 +9257,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingDataUpsertResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -10069,12 +9265,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "keys": [ - "server01", - "server02" - ] - } + "data": {} } } } @@ -10097,43 +9288,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingDataUpsertRequest" + "$ref": "#/components/schemas/ResetPostMortemTitleRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01", - "docs": [ - { - "host": "server01", - "owner": "alice", - "team": "sre", - "service": "api" - }, - { - "host": "server02", - "owner": "bob", - "team": "平台", - "service": "gateway" - } - ] + "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", + "title": "Production API latency incident" } } } } } }, - "/enrichment/mapping/data/delete": { + "/incident/remove": { "post": { - "operationId": "mapping-data-write-delete", - "summary": "删除映射数据", - "description": "按键名批量删除最多 100 条映射数据行。", + "operationId": "incidentRemove", + "summary": "删除故障", + "description": "永久删除一个故障及其关联数据。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-data-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-remove", "metadata": { - "sidebarTitle": "删除映射数据" + "sidebarTitle": "删除故障" } }, "responses": { @@ -10181,13 +9359,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingDataDeleteRequest" + "$ref": "#/components/schemas/RemoveIncidentRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01", - "keys": [ - "server01", - "server02" + "incident_ids": [ + "69da451ef77b1b51f40e83ee" ] } } @@ -10195,19 +9371,19 @@ } } }, - "/enrichment/mapping/data/truncate": { + "/incident/reopen": { "post": { - "operationId": "mapping-data-write-truncate", - "summary": "清空映射数据", - "description": "删除指定映射规则的全部数据行。", + "operationId": "incidentReopen", + "summary": "重开故障", + "description": "重新打开一个已恢复的故障。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 此操作不可逆,将删除映射规则中的所有数据。\n- 本接口为高危操作。控制台 JWT 调用需二次验证码;`app_key` 调用跳过 MFA 但仍会被完整记录,请妥善保管 app_key。", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-data-write-truncate", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-reopen", "metadata": { - "sidebarTitle": "清空映射数据" + "sidebarTitle": "重开故障" } }, "responses": { @@ -10255,29 +9431,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingSchemaIDRequest" + "$ref": "#/components/schemas/ReopenIncidentRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01" + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ], + "reason": "Monitoring detected the issue recurred after the initial fix." } } } } } }, - "/enrichment/mapping/data/upload": { + "/incident/reset": { "post": { - "operationId": "mapping-data-write-upload", - "summary": "通过 CSV 上传映射数据", - "description": "上传 CSV 文件批量导入映射数据。默认情况下,导入前先清空现有数据。", + "operationId": "incidentReset", + "summary": "更新故障信息", + "description": "一次调用更新故障的多个可编辑字段,包括标题、描述、影响范围、根因、恢复方案和严重程度。至少需要提供一个字段。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **20 次/分钟**;**2 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 请求须使用 `Content-Type: multipart/form-data`,文件字段名为 `file`,`schema_id` 通过查询参数传入。\n- CSV 标题行须包含所有来源标签和结果标签名称。\n- 文件大小上限:100 MB。\n- 默认情况下,导入前先清空现有数据;传入查询参数 `do_not_truncate_first=TRUE` 可改为追加模式。\n- CSV 中存在重复来源标签组合时返回 400 错误。", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-data-write-upload", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-reset", "metadata": { - "sidebarTitle": "通过 CSV 上传映射数据" + "sidebarTitle": "更新故障信息" } }, "responses": { @@ -10325,29 +9504,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingDataUploadRequest" + "$ref": "#/components/schemas/UpdateIncidentFieldsRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01" + "incident_id": "69da451ef77b1b51f40e83ee", + "title": "Database connection timeout - prod-db-01 primary", + "incident_severity": "Critical" } } } } } }, - "/enrichment/mapping/data/download": { + "/incident/resolve": { "post": { - "operationId": "mapping-data-read-download", - "summary": "下载映射数据 CSV", - "description": "将映射规则的所有数据行导出为 CSV 文件。", + "operationId": "incidentResolve", + "summary": "恢复故障", + "description": "将故障标记为已恢复。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) 或 **映射数据查看**(`on-call`) 或 **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 响应为 CSV 文件,包含 `Content-Disposition: attachment` 响应头。\n- CSV 标题行按顺序对应映射规则的来源标签和结果标签。", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-data-read-download", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-resolve", "metadata": { - "sidebarTitle": "下载映射数据 CSV" + "sidebarTitle": "恢复故障" } }, "responses": { @@ -10364,7 +9545,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CsvFileResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -10372,7 +9553,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": "host,owner,team,service\nserver01,alice,sre,api\n" + "data": {} } } } @@ -10395,29 +9576,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingSchemaIDRequest" + "$ref": "#/components/schemas/ResolveIncidentRequest" }, "example": { - "schema_id": "665f1a2b3c4d5e6f7a8b9c01" + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ], + "root_cause": "Memory leak in the connection pool caused by a missing cleanup call.", + "resolution": "Deployed hotfix v2.3.1 and restarted the affected service." } } } } } }, - "/enrichment/mapping/api/list": { + "/incident/responder/add": { "post": { - "operationId": "mapping-api-read-list", - "summary": "查询映射 API 列表", - "description": "返回账户下所有配置的映射 API。", + "operationId": "incidentResponderAdd", + "summary": "添加故障处理人员", + "description": "向已有故障添加处理人员。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据查看**(`on-call`) 或 **映射数据管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-api-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-responder-add", "metadata": { - "sidebarTitle": "查询映射 API 列表" + "sidebarTitle": "添加故障处理人员" } }, "responses": { @@ -10434,7 +9619,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingAPIListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -10442,28 +9627,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 1, - "items": [ - { - "api_id": "665f1a2b3c4d5e6f7a8b9c02", - "api_name": "CMDB API", - "description": "查询 CMDB 主机元数据", - "url": "https://cmdb.example.com/api/lookup", - "headers": { - "X-Token": "***" - }, - "timeout": 2, - "retry_count": 1, - "insecure_skip_verify": false, - "status": "enabled", - "team_id": 0, - "creator_id": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 - } - ] - } + "data": {} } } } @@ -10486,27 +9650,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmptyRequest" + "$ref": "#/components/schemas/AddIncidentResponderRequest" }, - "example": {} + "example": { + "incident_id": "69da451ef77b1b51f40e83ee", + "person_ids": [ + 2476444212131, + 2476444212132 + ] + } } } } } }, - "/enrichment/mapping/api/info": { + "/incident/snooze": { "post": { - "operationId": "mapping-api-read-info", - "summary": "查看映射 API 详情", - "description": "根据映射 API ID 返回单个映射 API 的详细信息。", + "operationId": "incidentSnooze", + "summary": "暂停故障通知", + "description": "暂时屏蔽故障通知直到指定时间。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 映射 API 不存在时返回 `null`。", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-api-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-snooze", "metadata": { - "sidebarTitle": "查看映射 API 详情" + "sidebarTitle": "暂停故障通知" } }, "responses": { @@ -10523,7 +9693,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingAPIItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -10531,18 +9701,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "api_id": "665f1a2b3c4d5e6f7a8b9c02", - "api_name": "CMDB API", - "url": "https://cmdb.example.com/api/lookup", - "timeout": 2, - "retry_count": 1, - "insecure_skip_verify": false, - "status": "enabled", - "creator_id": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 - } + "data": {} } } } @@ -10565,29 +9724,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingAPIIDRequest" + "$ref": "#/components/schemas/SnoozeIncidentRequest" }, "example": { - "api_id": "665f1a2b3c4d5e6f7a8b9c02" + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ], + "minutes": 60 } } } } } }, - "/enrichment/mapping/api/create": { + "/incident/unack": { "post": { - "operationId": "mapping-api-write-create", - "summary": "创建映射 API", - "description": "创建新的外部 HTTP API 端点,用于通过 HTTP 查询富化告警。", + "operationId": "incidentUnack", + "summary": "取消认领故障", + "description": "取消故障的认领状态。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- `url` 须以 `http://` 或 `https://` 开头,SaaS 模式下不得解析为内网 IP。\n- `timeout` 为 HTTP 读取超时秒数(1–3,默认 2)。\n- `retry_count` 为失败重试次数(0–1,默认 0)。\n- SaaS 模式下,含敏感名称的请求头(如 `authorization`、`cookie`)将被拒绝。\n- 账户最多可创建 50 个映射 API。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-api-write-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-unack", "metadata": { - "sidebarTitle": "创建映射 API" + "sidebarTitle": "取消认领故障" } }, "responses": { @@ -10604,7 +9766,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MappingAPICreateResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -10612,10 +9774,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "api_id": "665f1a2b3c4d5e6f7a8b9c02", - "api_name": "CMDB API" - } + "data": {} } } } @@ -10638,37 +9797,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingAPICreateRequest" + "$ref": "#/components/schemas/UnackIncidentRequest" }, "example": { - "api_name": "CMDB API", - "description": "查询 CMDB 主机元数据", - "url": "https://cmdb.example.com/api/lookup", - "headers": { - "X-Token": "mytoken" - }, - "timeout": 2, - "retry_count": 1, - "insecure_skip_verify": false + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ] } } } } } }, - "/enrichment/mapping/api/update": { + "/incident/wake": { "post": { - "operationId": "mapping-api-write-update", - "summary": "更新映射 API", - "description": "更新现有映射 API 的配置。", + "operationId": "incidentWake", + "summary": "恢复故障通知", + "description": "取消故障的暂停状态,恢复通知。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 仅 API 创建者、账户管理员或所属团队成员可更新。\n- 所有可更新字段均为可选,仅更新提供的字段。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-api-write-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-wake", "metadata": { - "sidebarTitle": "更新映射 API" + "sidebarTitle": "恢复故障通知" } }, "responses": { @@ -10716,36 +9869,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingAPIUpdateRequest" + "$ref": "#/components/schemas/WakeIncidentRequest" }, "example": { - "api_id": "665f1a2b3c4d5e6f7a8b9c02", - "timeout": 3, - "retry_count": 1 + "incident_ids": [ + "69da451ef77b1b51f40e83ee" + ] } } } } } }, - "/enrichment/mapping/api/delete": { + "/incident/war-room/add-member": { "post": { - "operationId": "mapping-api-write-delete", - "summary": "删除映射 API", - "description": "删除映射 API。若该 API 被富化规则引用,则拒绝删除。", + "operationId": "incident-write-add-war-room-member", + "summary": "添加作战室成员", + "description": "向与故障集成绑定的 IM 作战室添加一名或多名成员。", "tags": [ - "On-call/标签增强" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **映射数据管理**(`on-call`) |\n\n## 使用说明\n\n- 若 API 仍被引用,响应返回 HTTP 400,`refs` 字段列出所有阻止删除的引用。\n- 仅 API 创建者、账户管理员或所属团队成员可删除。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/alert-enrichment/mapping-api-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", + "href": "/zh/api-reference/on-call/incidents/incident-write-add-war-room-member", "metadata": { - "sidebarTitle": "删除映射 API" + "sidebarTitle": "添加作战室成员" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { @@ -10757,7 +9910,8 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "type": "string", + "description": "成功时返回字面量 \"ok\"。" } } } @@ -10765,7 +9919,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": "ok" } } } @@ -10788,29 +9942,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MappingAPIIDRequest" + "$ref": "#/components/schemas/AddWarRoomMemberRequest" }, "example": { - "api_id": "665f1a2b3c4d5e6f7a8b9c02" + "integration_id": 362, + "chat_id": "oc_5ce6d572455d361153b7cb51da133945", + "member_ids": [ + 20001, + 20002 + ] } } } } } }, - "/insight/alert/topk-by-label": { + "/incident/war-room/create": { "post": { - "operationId": "insightTopkAlertsByLabel", - "summary": "查看按 check/resource 聚合的 Top-K 告警", - "description": "返回指定时间范围内按 `check` 或 `resource` 聚合的 Top-K 告警组。", + "operationId": "incidentWarRoomCreate", + "summary": "创建战情室", + "description": "为故障协同响应创建战情室频道。", "tags": [ - "On-call/分析看板" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **分析看板查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/analytics/insight-topk-alerts-by-label", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-war-room-create", "metadata": { - "sidebarTitle": "查看按 check/resource 聚合的 Top-K 告警" + "sidebarTitle": "创建战情室" } }, "responses": { @@ -10827,7 +9986,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/InsightAlertByLabelResponse" + "$ref": "#/components/schemas/WarRoom" } } } @@ -10836,23 +9995,9 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ - { - "label": "cpu-high", - "total_alert_cnt": 312, - "total_alert_event_cnt": 987 - }, - { - "label": "disk-full", - "total_alert_cnt": 178, - "total_alert_event_cnt": 452 - }, - { - "label": "memory-oom", - "total_alert_cnt": 94, - "total_alert_event_cnt": 231 - } - ] + "chat_id": "oc_a0553eda9014c2de1b3a8f75b4e0c000", + "chat_name": "Incident #0E83EE war room", + "share_link": "" } } } @@ -10876,38 +10021,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsightTopkAlertByLabelRequest" + "$ref": "#/components/schemas/CreateWarRoomRequest" }, "example": { - "start_time": 1712000000, - "end_time": 1712604800, - "label": "check", - "k": 10, - "orderby": "total_alert_cnt" + "incident_id": "69da451ef77b1b51f40e83ee", + "integration_id": 2490562293131, + "add_observers": true } } } } } }, - "/insight/account": { + "/incident/war-room/default-observers": { "post": { - "operationId": "insightByAccount", - "summary": "查看账户级别洞察", - "description": "返回整个账户的聚合故障洞察指标。", + "operationId": "incident-read-get-war-room-default-observers", + "summary": "查看作战室默认观察者", + "description": "返回开启作战室时建议作为默认观察者的历史响应人。", "tags": [ - "On-call/分析看板" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **分析看板查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/analytics/insight-by-account", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", + "href": "/zh/api-reference/on-call/incidents/incident-read-get-war-room-default-observers", "metadata": { - "sidebarTitle": "查看账户级别洞察" + "sidebarTitle": "查看作战室默认观察者" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { @@ -10919,7 +10062,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DimensionInsightResponse" + "$ref": "#/components/schemas/GetWarRoomDefaultObserversResponse" } } } @@ -10928,30 +10071,18 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ + "observers": [ { - "ts": 1740844800, - "total_incident_cnt": 2, - "total_incidents_acknowledged": 2, - "total_incidents_closed": 2, - "total_incidents_auto_closed": 0, - "total_incidents_manually_closed": 2, - "total_incidents_timeout_closed": 0, - "total_incidents_escalated": 0, - "total_incidents_manually_escalated": 0, - "total_incidents_timeout_escalated": 0, - "total_incidents_reassigned": 2, - "total_interruptions": 3, - "total_notifications": 6, - "total_engaged_seconds": 3317709, - "total_seconds_to_ack": 3317709, - "total_seconds_to_close": 3749514, - "mean_seconds_to_ack": 1658854.5, - "mean_seconds_to_close": 1874757, - "noise_reduction_pct": 0, - "acknowledgement_pct": 100, - "total_alert_cnt": 0, - "total_alert_event_cnt": 0 + "account_id": 10001, + "person_id": 20001, + "person_name": "Alice Chen", + "avatar": "https://cdn.flashcat.cloud/avatar/20001.png", + "email": "alice@acme.com", + "phone": "+8613800000000", + "locale": "zh-CN", + "time_zone": "Asia/Shanghai", + "as": "responder", + "status": "active" } ] } @@ -10977,35 +10108,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsightQueryRequest" + "$ref": "#/components/schemas/GetWarRoomDefaultObserversRequest" }, "example": { - "start_time": 1712000000, - "end_time": 1712604800, - "aggregate_unit": "day", - "severities": [ - "Critical", - "Warning" - ] + "incident_id": "664a1b2c3d4e5f6a7b8c9d0e" } } } } } }, - "/insight/incident/list": { + "/incident/war-room/delete": { "post": { - "operationId": "insightIncidentList", - "summary": "查询洞察故障列表", - "description": "返回用于分析看板的故障分页列表,包含每条故障的处理效能指标。", + "operationId": "incidentWarRoomDelete", + "summary": "删除战情室", + "description": "删除指定的故障战情室。", "tags": [ - "On-call/分析看板" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **分析看板查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/analytics/insight-incident-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-war-room-delete", "metadata": { - "sidebarTitle": "查询洞察故障列表" + "sidebarTitle": "删除战情室" } }, "responses": { @@ -11022,7 +10147,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/InsightIncidentListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -11030,58 +10155,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 2, - "has_next_page": false, - "items": [ - { - "incident_id": "67ca560c381a4fedb664f5f8", - "title": "CPU spike on prod-web-01", - "description": "CPU usage exceeded 90% threshold", - "team_id": 4295771902131, - "team_name": "SRE Team", - "channel_id": 4321322010131, - "channel_name": "Production Alerts", - "progress": "Closed", - "severity": "Info", - "created_at": 1741313548, - "closed_by": "manually", - "seconds_to_ack": 1052085, - "seconds_to_close": 1483880, - "engaged_seconds": 1052085, - "hours": "work", - "responders": [ - { - "person_id": 3790925372131, - "assigned_at": 1741313548, - "acknowledged_at": 1742365633, - "person_name": "alice", - "email": "alice@example.com" - } - ], - "assigned_to": { - "person_ids": [ - 3790925372131 - ], - "escalate_rule_id": "000000000000000000000000", - "layer_idx": 0, - "type": "reassign" - }, - "labels": {}, - "fields": {}, - "notifications": 4, - "interruptions": 2, - "assignments": 2, - "reassignments": 1, - "acknowledgements": 1, - "escalations": 0, - "timeout_escalations": 0, - "manual_escalations": 0, - "creator_id": 3790925372131, - "creator_name": "alice" - } - ] - } + "data": {} } } } @@ -11104,35 +10178,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsightIncidentListRequest" + "$ref": "#/components/schemas/DeleteWarRoomRequest" }, "example": { - "start_time": 1712000000, - "end_time": 1712604800, - "p": 1, - "limit": 20, - "severities": [ - "Critical" - ] + "incident_id": "69da451ef77b1b51f40e83ee", + "integration_id": 2490562293131 } } } } } }, - "/insight/incident/export": { + "/incident/war-room/detail": { "post": { - "operationId": "insightIncidentExport", - "summary": "导出洞察故障", - "description": "将故障分析列表以 CSV 文件形式导出。响应为 CSV 字节流(`Content-Disposition: attachment`),不是 JSON 响应包。", + "operationId": "incidentWarRoomDetail", + "summary": "获取战情室详情", + "description": "获取故障的战情室配置和成员信息。", "tags": [ - "On-call/分析看板" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **10 次/分钟**;**1 次/秒** |\n| 权限要求 | **分析看板查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/analytics/insight-incident-export", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-war-room-detail", "metadata": { - "sidebarTitle": "导出洞察故障" + "sidebarTitle": "获取战情室详情" } }, "responses": { @@ -11149,7 +10218,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/WarRoom" } } } @@ -11157,7 +10226,11 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "chat_id": "oc_a0553eda9014c2de1b3a8f75b4e0c000", + "chat_name": "Incident #0E83EE war room", + "share_link": "" + } } } } @@ -11180,42 +10253,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsightIncidentExportRequest" + "$ref": "#/components/schemas/GetWarRoomDetailRequest" }, "example": { - "start_time": 1712000000, - "end_time": 1712604800, - "severities": [ - "Critical", - "Warning" - ], - "export_fields": [ - "incident_id", - "title", - "severity", - "created_at", - "seconds_to_close" - ], - "description_html_to_text": true + "integration_id": 2490562293131, + "chat_id": "oc_a0553eda9014c2de1b3a8f75b4e0c000" } } } } } }, - "/insight/channel": { + "/incident/war-room/list": { "post": { - "operationId": "insightByChannel", - "summary": "查看协作空间洞察", - "description": "返回按协作空间聚合的洞察指标。", + "operationId": "incidentWarRoomList", + "summary": "查询战情室列表", + "description": "查询故障关联的所有战情室。", "tags": [ - "On-call/分析看板" + "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **分析看板查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/analytics/insight-by-channel", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/incidents/incident-war-room-list", "metadata": { - "sidebarTitle": "查看协作空间洞察" + "sidebarTitle": "查询战情室列表" } }, "responses": { @@ -11232,7 +10293,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DimensionInsightResponse" + "$ref": "#/components/schemas/ListWarRoomsResponse" } } } @@ -11241,34 +10302,7 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ - { - "ts": 1740844800, - "channel_id": 4321322010131, - "channel_name": "Production Alerts", - "total_incident_cnt": 2, - "total_incidents_acknowledged": 2, - "total_incidents_closed": 2, - "total_incidents_auto_closed": 0, - "total_incidents_manually_closed": 2, - "total_incidents_timeout_closed": 0, - "total_incidents_escalated": 0, - "total_incidents_manually_escalated": 0, - "total_incidents_timeout_escalated": 0, - "total_incidents_reassigned": 2, - "total_interruptions": 3, - "total_notifications": 6, - "total_engaged_seconds": 3317709, - "total_seconds_to_ack": 3317709, - "total_seconds_to_close": 3749514, - "mean_seconds_to_ack": 1658854.5, - "mean_seconds_to_close": 1874757, - "noise_reduction_pct": 0, - "acknowledgement_pct": 100, - "total_alert_cnt": 0, - "total_alert_event_cnt": 0 - } - ] + "items": [] } } } @@ -11292,34 +10326,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InsightQueryRequest" + "$ref": "#/components/schemas/ListWarRoomsRequest" }, "example": { - "start_time": 1712000000, - "end_time": 1712604800, - "channel_ids": [ - 4321322010131 - ], - "aggregate_unit": "day" + "incident_id": "69da451ef77b1b51f40e83ee" } } } } } }, - "/insight/channel/export": { + "/insight/account": { "post": { - "operationId": "insightChannelExport", - "summary": "导出协作空间洞察", - "description": "将协作空间洞察指标以 CSV 文件形式导出。响应为 CSV 字节流(`Content-Disposition: attachment`),不是 JSON 响应包。", + "operationId": "insightByAccount", + "summary": "查看账户级别洞察", + "description": "返回整个账户的聚合故障洞察指标。", "tags": [ "On-call/分析看板" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **10 次/分钟**;**1 次/秒** |\n| 权限要求 | **分析看板查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/analytics/insight-channel-export", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **分析看板查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/analytics/insight-by-account", "metadata": { - "sidebarTitle": "导出协作空间洞察" + "sidebarTitle": "查看账户级别洞察" } }, "responses": { @@ -11336,7 +10365,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/DimensionInsightResponse" } } } @@ -11344,7 +10373,34 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "ts": 1740844800, + "total_incident_cnt": 2, + "total_incidents_acknowledged": 2, + "total_incidents_closed": 2, + "total_incidents_auto_closed": 0, + "total_incidents_manually_closed": 2, + "total_incidents_timeout_closed": 0, + "total_incidents_escalated": 0, + "total_incidents_manually_escalated": 0, + "total_incidents_timeout_escalated": 0, + "total_incidents_reassigned": 2, + "total_interruptions": 3, + "total_notifications": 6, + "total_engaged_seconds": 3317709, + "total_seconds_to_ack": 3317709, + "total_seconds_to_close": 3749514, + "mean_seconds_to_ack": 1658854.5, + "mean_seconds_to_close": 1874757, + "noise_reduction_pct": 0, + "acknowledgement_pct": 100, + "total_alert_cnt": 0, + "total_alert_event_cnt": 0 + } + ] + } } } } @@ -11372,9 +10428,7 @@ "example": { "start_time": 1712000000, "end_time": 1712604800, - "channel_ids": [ - 4321322010131 - ], + "aggregate_unit": "day", "severities": [ "Critical", "Warning" @@ -11385,19 +10439,19 @@ } } }, - "/insight/team": { + "/insight/alert/topk-by-label": { "post": { - "operationId": "insightByTeam", - "summary": "查看团队洞察", - "description": "返回按团队聚合的洞察指标。", + "operationId": "insightTopkAlertsByLabel", + "summary": "查看按 check/resource 聚合的 Top-K 告警", + "description": "返回指定时间范围内按 `check` 或 `resource` 聚合的 Top-K 告警组。", "tags": [ "On-call/分析看板" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **分析看板查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/analytics/insight-by-team", + "href": "/zh/api-reference/on-call/analytics/insight-topk-alerts-by-label", "metadata": { - "sidebarTitle": "查看团队洞察" + "sidebarTitle": "查看按 check/resource 聚合的 Top-K 告警" } }, "responses": { @@ -11414,7 +10468,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DimensionInsightResponse" + "$ref": "#/components/schemas/InsightAlertByLabelResponse" } } } @@ -11425,22 +10479,114 @@ "data": { "items": [ { - "ts": 1740844800, - "team_id": 4295771902131, - "team_name": "SRE Team", - "total_incident_cnt": 2, - "total_incidents_acknowledged": 2, - "total_incidents_closed": 2, - "total_incidents_auto_closed": 0, - "total_incidents_manually_closed": 2, - "total_incidents_timeout_closed": 0, - "total_incidents_escalated": 0, - "total_incidents_manually_escalated": 0, - "total_incidents_timeout_escalated": 0, - "total_incidents_reassigned": 2, - "total_interruptions": 3, - "total_notifications": 6, - "total_engaged_seconds": 3317709, + "label": "cpu-high", + "total_alert_cnt": 312, + "total_alert_event_cnt": 987 + }, + { + "label": "disk-full", + "total_alert_cnt": 178, + "total_alert_event_cnt": 452 + }, + { + "label": "memory-oom", + "total_alert_cnt": 94, + "total_alert_event_cnt": 231 + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightTopkAlertByLabelRequest" + }, + "example": { + "start_time": 1712000000, + "end_time": 1712604800, + "label": "check", + "k": 10, + "orderby": "total_alert_cnt" + } + } + } + } + } + }, + "/insight/channel": { + "post": { + "operationId": "insightByChannel", + "summary": "查看协作空间洞察", + "description": "返回按协作空间聚合的洞察指标。", + "tags": [ + "On-call/分析看板" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **分析看板查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/analytics/insight-by-channel", + "metadata": { + "sidebarTitle": "查看协作空间洞察" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/DimensionInsightResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "items": [ + { + "ts": 1740844800, + "channel_id": 4321322010131, + "channel_name": "Production Alerts", + "total_incident_cnt": 2, + "total_incidents_acknowledged": 2, + "total_incidents_closed": 2, + "total_incidents_auto_closed": 0, + "total_incidents_manually_closed": 2, + "total_incidents_timeout_closed": 0, + "total_incidents_escalated": 0, + "total_incidents_manually_escalated": 0, + "total_incidents_timeout_escalated": 0, + "total_incidents_reassigned": 2, + "total_interruptions": 3, + "total_notifications": 6, + "total_engaged_seconds": 3317709, "total_seconds_to_ack": 3317709, "total_seconds_to_close": 3749514, "mean_seconds_to_ack": 1658854.5, @@ -11479,8 +10625,8 @@ "example": { "start_time": 1712000000, "end_time": 1712604800, - "team_ids": [ - 4295771902131 + "channel_ids": [ + 4321322010131 ], "aggregate_unit": "day" } @@ -11489,19 +10635,19 @@ } } }, - "/insight/team/export": { + "/insight/channel/export": { "post": { - "operationId": "insightTeamExport", - "summary": "导出团队洞察", - "description": "将团队洞察指标以 CSV 文件形式导出。响应为 CSV 字节流(`Content-Disposition: attachment`),不是 JSON 响应包。", + "operationId": "insightChannelExport", + "summary": "导出协作空间洞察", + "description": "将协作空间洞察指标以 CSV 文件形式导出。响应为 CSV 字节流(`Content-Disposition: attachment`),不是 JSON 响应包。", "tags": [ "On-call/分析看板" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **10 次/分钟**;**1 次/秒** |\n| 权限要求 | **分析看板查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/analytics/insight-team-export", + "href": "/zh/api-reference/on-call/analytics/insight-channel-export", "metadata": { - "sidebarTitle": "导出团队洞察" + "sidebarTitle": "导出协作空间洞察" } }, "responses": { @@ -11554,8 +10700,8 @@ "example": { "start_time": 1712000000, "end_time": 1712604800, - "team_ids": [ - 4295771902131 + "channel_ids": [ + 4321322010131 ], "severities": [ "Critical", @@ -11567,6 +10713,216 @@ } } }, + "/insight/incident/export": { + "post": { + "operationId": "insightIncidentExport", + "summary": "导出洞察故障", + "description": "将故障分析列表以 CSV 文件形式导出。响应为 CSV 字节流(`Content-Disposition: attachment`),不是 JSON 响应包。", + "tags": [ + "On-call/分析看板" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **10 次/分钟**;**1 次/秒** |\n| 权限要求 | **分析看板查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/analytics/insight-incident-export", + "metadata": { + "sidebarTitle": "导出洞察故障" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/EmptyResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": {} + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightIncidentExportRequest" + }, + "example": { + "start_time": 1712000000, + "end_time": 1712604800, + "severities": [ + "Critical", + "Warning" + ], + "export_fields": [ + "incident_id", + "title", + "severity", + "created_at", + "seconds_to_close" + ], + "description_html_to_text": true + } + } + } + } + } + }, + "/insight/incident/list": { + "post": { + "operationId": "insightIncidentList", + "summary": "查询洞察故障列表", + "description": "返回用于分析看板的故障分页列表,包含每条故障的处理效能指标。", + "tags": [ + "On-call/分析看板" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **分析看板查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/analytics/insight-incident-list", + "metadata": { + "sidebarTitle": "查询洞察故障列表" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/InsightIncidentListResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "total": 2, + "has_next_page": false, + "items": [ + { + "incident_id": "67ca560c381a4fedb664f5f8", + "title": "CPU spike on prod-web-01", + "description": "CPU usage exceeded 90% threshold", + "team_id": 4295771902131, + "team_name": "SRE Team", + "channel_id": 4321322010131, + "channel_name": "Production Alerts", + "progress": "Closed", + "severity": "Info", + "created_at": 1741313548, + "closed_by": "manually", + "seconds_to_ack": 1052085, + "seconds_to_close": 1483880, + "engaged_seconds": 1052085, + "hours": "work", + "responders": [ + { + "person_id": 3790925372131, + "assigned_at": 1741313548, + "acknowledged_at": 1742365633, + "person_name": "alice", + "email": "alice@example.com" + } + ], + "assigned_to": { + "person_ids": [ + 3790925372131 + ], + "escalate_rule_id": "000000000000000000000000", + "layer_idx": 0, + "type": "reassign" + }, + "labels": {}, + "fields": {}, + "notifications": 4, + "interruptions": 2, + "assignments": 2, + "reassignments": 1, + "acknowledgements": 1, + "escalations": 0, + "timeout_escalations": 0, + "manual_escalations": 0, + "creator_id": 3790925372131, + "creator_name": "alice" + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightIncidentListRequest" + }, + "example": { + "start_time": 1712000000, + "end_time": 1712604800, + "p": 1, + "limit": 20, + "severities": [ + "Critical" + ] + } + } + } + } + } + }, "/insight/responder": { "post": { "operationId": "insightByResponder", @@ -11740,19 +11096,19 @@ } } }, - "/status-page/change/info": { - "get": { - "operationId": "statusPageChangeInfo", - "summary": "获取状态页事件详情", - "description": "获取状态页指定事件(故障或维护)的详细信息。", + "/insight/team": { + "post": { + "operationId": "insightByTeam", + "summary": "查看团队洞察", + "description": "返回按团队聚合的洞察指标。", "tags": [ - "On-call/状态页" + "On-call/分析看板" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/status-pages/status-page-change-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **分析看板查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/analytics/insight-by-team", "metadata": { - "sidebarTitle": "获取状态页事件详情" + "sidebarTitle": "查看团队洞察" } }, "responses": { @@ -11769,7 +11125,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageChangeItem" + "$ref": "#/components/schemas/DimensionInsightResponse" } } } @@ -11778,53 +11134,34 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "change_id": 5821693893131, - "page_id": 5750613685214, - "type": "incident", - "title": "Web Console Degraded Performance", - "description": "The issue has been resolved, and all services are operating normally.\n\nThank you for your patience.", - "status": "resolved", - "affected_components": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", - "name": "Web Console", - "available_since_seconds": 1765349358, - "order_id": 1, - "status": "operational" - } - ], - "start_at_seconds": 1766736878, - "close_at_seconds": 1775529742, - "updates": [ - { - "update_id": "01KDCVJQ88SZPHWPTDV2Z2AZW8", - "at_seconds": 1766736876, - "status": "investigating", - "description": "We are currently investigating an issue affecting some services.", - "component_changes": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "component_name": "Web Console", - "status": "degraded" - } - ] - }, + "items": [ { - "update_id": "01KNJX3KW873ZZSRZC14SGFYS3", - "at_seconds": 1775529742, - "status": "resolved", - "description": "The issue has been resolved, and all services are operating normally.", - "component_changes": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "component_name": "Web Console", - "status": "operational" - } - ] + "ts": 1740844800, + "team_id": 4295771902131, + "team_name": "SRE Team", + "total_incident_cnt": 2, + "total_incidents_acknowledged": 2, + "total_incidents_closed": 2, + "total_incidents_auto_closed": 0, + "total_incidents_manually_closed": 2, + "total_incidents_timeout_closed": 0, + "total_incidents_escalated": 0, + "total_incidents_manually_escalated": 0, + "total_incidents_timeout_escalated": 0, + "total_incidents_reassigned": 2, + "total_interruptions": 3, + "total_notifications": 6, + "total_engaged_seconds": 3317709, + "total_seconds_to_ack": 3317709, + "total_seconds_to_close": 3749514, + "mean_seconds_to_ack": 1658854.5, + "mean_seconds_to_close": 1874757, + "noise_reduction_pct": 0, + "acknowledgement_pct": 100, + "total_alert_cnt": 0, + "total_alert_event_cnt": 0 } - ], - "notify_subscribers": true + ] } } } @@ -11843,43 +11180,39 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "page_id", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Status page ID." - }, - { - "name": "change_id", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Event (change) ID." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightQueryRequest" + }, + "example": { + "start_time": 1712000000, + "end_time": 1712604800, + "team_ids": [ + 4295771902131 + ], + "aggregate_unit": "day" + } + } } - ] + } } }, - "/status-page/change/list": { - "get": { - "operationId": "statusPageChangeList", - "summary": "查询状态页事件列表", - "description": "查询状态页的事件列表(故障和维护)。", + "/insight/team/export": { + "post": { + "operationId": "insightTeamExport", + "summary": "导出团队洞察", + "description": "将团队洞察指标以 CSV 文件形式导出。响应为 CSV 字节流(`Content-Disposition: attachment`),不是 JSON 响应包。", "tags": [ - "On-call/状态页" + "On-call/分析看板" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/status-pages/status-page-change-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **10 次/分钟**;**1 次/秒** |\n| 权限要求 | **分析看板查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/analytics/insight-team-export", "metadata": { - "sidebarTitle": "查询状态页事件列表" + "sidebarTitle": "导出团队洞察" } }, "responses": { @@ -11896,7 +11229,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageChangeListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -11904,59 +11237,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "change_id": 5821693893131, - "page_id": 5750613685214, - "type": "incident", - "title": "Web Console Degraded Performance", - "description": "The issue has been resolved, and all services are operating normally.", - "status": "resolved", - "affected_components": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", - "name": "Web Console", - "available_since_seconds": 1765349358, - "order_id": 1, - "status": "operational" - } - ], - "start_at_seconds": 1766736878, - "close_at_seconds": 1775529742, - "updates": [ - { - "update_id": "01KDCVJQ88SZPHWPTDV2Z2AZW8", - "at_seconds": 1766736876, - "status": "investigating", - "description": "We are currently investigating an issue affecting some services.", - "component_changes": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "component_name": "Web Console", - "status": "degraded" - } - ] - }, - { - "update_id": "01KNJX3KW873ZZSRZC14SGFYS3", - "at_seconds": 1775529742, - "status": "resolved", - "description": "The issue has been resolved, and all services are operating normally.", - "component_changes": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "component_name": "Web Console", - "status": "operational" - } - ] - } - ], - "notify_subscribers": true - } - ] - } + "data": {} } } } @@ -11974,84 +11255,42 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "page_id", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Status page ID." - }, - { - "name": "start_at_seconds", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Filter events started at or after this unix timestamp (seconds)." - }, - { - "name": "end_at_seconds", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Filter events started at or before this unix timestamp (seconds)." - }, - { - "name": "type", - "in": "query", - "required": true, - "schema": { - "type": "string", - "enum": [ - "incident", - "maintenance" - ] - }, - "description": "Event type filter. Required." - }, - { - "name": "status", - "in": "query", - "required": true, - "schema": { - "type": "string", - "enum": [ - "investigating", - "identified", - "monitoring", - "resolved", - "scheduled", - "ongoing", - "completed" - ] - }, - "description": "Event status filter. Required. Must be a status valid for the given `type` (e.g. `investigating`/`identified`/`monitoring`/`resolved` for incidents; `scheduled`/`ongoing`/`completed` for maintenances)." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightQueryRequest" + }, + "example": { + "start_time": 1712000000, + "end_time": 1712604800, + "team_ids": [ + 4295771902131 + ], + "severities": [ + "Critical", + "Warning" + ] + } + } } - ] + } } }, - "/status-page/change/active/list": { - "get": { - "operationId": "statusPageChangeActiveList", - "summary": "查询状态页活跃事件列表", - "description": "查询状态页指定类型的进行中(非终态)事件列表。", + "/member/delete": { + "post": { + "operationId": "memberDelete", + "summary": "删除成员", + "description": "通过 ID、邮箱、手机号或名称从组织中移除成员。", "tags": [ - "On-call/状态页" + "平台/成员管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/status-pages/status-page-change-active-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **成员管理**(`organization`) |\n\n## 使用说明\n\n- 默认情况下(`is_force=false`),系统会检查该成员是否被其他资源引用(如分派策略、值班表等)。如果存在引用,接口将返回错误码 `ReferenceExist` 并在 `data.refs` 中返回引用列表。设置 `is_force=true` 可跳过引用检查,直接强制删除。\n- 通过 SSO 同步且 SSO 配置了成员不可编辑(`sso_user_non_editable=true`)的成员,无法通过此接口删除。需要先在 SSO 配置中关闭该限制。\n- 此操作会记录审计日志。", + "href": "/zh/api-reference/platform/members/member-delete", "metadata": { - "sidebarTitle": "查询状态页活跃事件列表" + "sidebarTitle": "删除成员" } }, "responses": { @@ -12068,7 +11307,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageChangeListResponse" + "$ref": "#/components/schemas/MemberEmptyObject" } } } @@ -12076,45 +11315,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "change_id": 5821693893131, - "page_id": 5750613685214, - "type": "incident", - "title": "Web Console Degraded Performance", - "description": "We are currently investigating an issue affecting some services.", - "status": "investigating", - "affected_components": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", - "name": "Web Console", - "available_since_seconds": 1765349358, - "order_id": 1, - "status": "degraded" - } - ], - "start_at_seconds": 1766736878, - "updates": [ - { - "update_id": "01KDCVJQ88SZPHWPTDV2Z2AZW8", - "at_seconds": 1766736876, - "status": "investigating", - "description": "We are currently investigating an issue affecting some services.", - "component_changes": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "component_name": "Web Console", - "status": "degraded" - } - ] - } - ], - "notify_subscribers": true - } - ] - } + "data": {} } } } @@ -12132,46 +11333,34 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "page_id", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "状态页 ID。" - }, - { - "name": "type", - "in": "query", - "required": true, - "schema": { - "type": "string", - "enum": [ - "incident", - "maintenance" - ] - }, - "description": "事件类型筛选,必填。仅返回进行中(非终态)事件:incident 含 investigating/identified/monitoring,maintenance 含 scheduled/ongoing。" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MemberDeleteRequest" + }, + "example": { + "member_id": 5068740052131 + } + } } - ] + } } }, - "/status-page/change/create": { + "/member/info": { "post": { - "operationId": "statusPageChangeCreate", - "summary": "创建状态页事件", - "description": "在状态页上创建新的故障或维护事件。", + "operationId": "memberInfo", + "summary": "获取当前成员信息", + "description": "返回当前会话成员的完整资料。", "tags": [ - "On-call/状态页" + "平台/成员管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面事件管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-change-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/platform/members/member-info", "metadata": { - "sidebarTitle": "创建状态页事件" + "sidebarTitle": "获取当前成员信息" } }, "responses": { @@ -12188,7 +11377,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageChangeCreateResponse" + "$ref": "#/components/schemas/MemberInfoResponse" } } } @@ -12197,8 +11386,28 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "change_id": 6294539747131, - "change_name": "API Test Incident" + "account_avatar": "", + "account_email": "alice@example.com", + "account_id": 2451002751131, + "account_locale": "en-US", + "account_name": "Acme Corp", + "account_role_ids": [ + 6 + ], + "account_time_zone": "Asia/Shanghai", + "avatar": "/image/avatar1.png", + "country_code": "CN", + "created_at": 1701399971, + "domain": "acme", + "email": "alice@example.com", + "email_verified": true, + "is_external": false, + "locale": "zh-CN", + "member_id": 2476444212131, + "member_name": "Alice", + "phone": "+86185****0300", + "phone_verified": true, + "time_zone": "Asia/Shanghai" } } } @@ -12222,47 +11431,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateStatusPageChangeRequest" + "$ref": "#/components/schemas/MemberInfoRequest" }, - "example": { - "page_id": 5750613685214, - "type": "incident", - "title": "Web Console Degraded Performance", - "description": "We are investigating degraded performance affecting the web console.", - "status": "investigating", - "start_at_seconds": 1712000000, - "notify_subscribers": true, - "updates": [ - { - "status": "investigating", - "description": "We are currently investigating an issue affecting some users.", - "component_changes": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "status": "degraded" - } - ] - } - ] - } + "example": {} } } } } }, - "/status-page/change/update": { + "/member/info/reset": { "post": { - "operationId": "statusPageChangeUpdate", - "summary": "更新状态页事件", - "description": "更新已有状态页事件。", + "operationId": "memberResetInfo", + "summary": "重置成员信息", + "description": "批量更新当前成员的多个资料字段。", "tags": [ - "On-call/状态页" + "平台/成员管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面事件管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-change-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/platform/members/member-reset-info", "metadata": { - "sidebarTitle": "更新状态页事件" + "sidebarTitle": "重置成员信息" } }, "responses": { @@ -12279,7 +11468,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/MemberEmptyObject" } } } @@ -12310,31 +11499,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateStatusPageChangeRequest" + "$ref": "#/components/schemas/MemberResetInfoRequest" }, "example": { - "page_id": 5750613685214, - "change_id": 5821693893131, - "title": "Web Console Degraded Performance (Updated)" + "member_id": 2476444212131, + "member_name": "Alice", + "locale": "zh-CN", + "time_zone": "Asia/Shanghai" } } } } } }, - "/status-page/change/delete": { + "/member/invite": { "post": { - "operationId": "statusPageChangeDelete", - "summary": "删除状态页事件", - "description": "删除指定的状态页事件。", + "operationId": "memberInvite", + "summary": "邀请成员", + "description": "通过邮箱或手机号批量邀请新成员加入组织。", "tags": [ - "On-call/状态页" + "平台/成员管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面事件管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-change-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **成员管理**(`organization`) |", + "href": "/zh/api-reference/platform/members/member-invite", "metadata": { - "sidebarTitle": "删除状态页事件" + "sidebarTitle": "邀请成员" } }, "responses": { @@ -12351,7 +11541,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/MemberInviteResponse" } } } @@ -12359,7 +11549,14 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "member_id": 5068740052131, + "member_name": "Charlie" + } + ] + } } } } @@ -12382,30 +11579,39 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteStatusPageChangeRequest" + "$ref": "#/components/schemas/MemberInviteRequest" }, "example": { - "page_id": 5750613685214, - "change_id": 5821693893131 + "members": [ + { + "member_name": "Charlie", + "email": "charlie@example.com", + "locale": "en-US", + "time_zone": "Asia/Shanghai", + "role_ids": [ + 6 + ] + } + ] } } } } } }, - "/status-page/change/timeline/create": { + "/member/list": { "post": { - "operationId": "statusPageChangeTimelineCreate", - "summary": "创建事件时间线", - "description": "在状态页事件上添加时间线更新。", + "operationId": "memberList", + "summary": "查询成员列表", + "description": "返回组织成员的分页列表。", "tags": [ - "On-call/状态页" + "平台/成员管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面事件管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-change-timeline-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/platform/members/member-list", "metadata": { - "sidebarTitle": "创建事件时间线" + "sidebarTitle": "查询成员列表" } }, "responses": { @@ -12422,7 +11628,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageChangeTimelineCreateResponse" + "$ref": "#/components/schemas/MemberListResponse" } } } @@ -12431,7 +11637,50 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "update_id": "01KP0311872NVYFRRQ82FWXAP4" + "p": 1, + "limit": 5, + "total": 148, + "items": [ + { + "account_id": 2451002751131, + "member_id": 5068740052131, + "member_name": "Bob", + "country_code": "", + "phone": "+86151****6519", + "email": "bob@example.com", + "phone_verified": true, + "email_verified": true, + "avatar": "", + "status": "enabled", + "account_role_ids": [ + 2, + 6 + ], + "created_at": 1752030749, + "updated_at": 1775962064, + "ref_id": "", + "is_external": false + }, + { + "account_id": 2451002751131, + "member_id": 2476444212131, + "member_name": "Alice", + "country_code": "CN", + "phone": "+86185****0300", + "email": "alice@example.com", + "phone_verified": true, + "email_verified": true, + "avatar": "/image/avatar1.png", + "status": "enabled", + "account_role_ids": [ + 6 + ], + "created_at": 1701399971, + "updated_at": 1775809507, + "ref_id": "", + "is_external": false + } + ] } } } @@ -12455,39 +11704,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateStatusPageChangeTimelineRequest" + "$ref": "#/components/schemas/MemberListRequest" }, "example": { - "page_id": 5750613685214, - "change_id": 5821693893131, - "status": "identified", - "description": "We have identified the root cause and are working on a fix.", - "at_seconds": 1712003600, - "component_changes": [ - { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "status": "partial_outage" - } - ] + "p": 1, + "limit": 5 } } } } } }, - "/status-page/change/timeline/update": { + "/member/role/grant": { "post": { - "operationId": "statusPageChangeTimelineUpdate", - "summary": "更新事件时间线", - "description": "更新状态页事件的时间线条目。", + "operationId": "memberGrantRole", + "summary": "授予成员角色", + "description": "为成员添加角色授权。", "tags": [ - "On-call/状态页" + "平台/成员管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面事件管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-change-timeline-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **成员管理**(`organization`) |", + "href": "/zh/api-reference/platform/members/member-grant-role", "metadata": { - "sidebarTitle": "更新事件时间线" + "sidebarTitle": "授予成员角色" } }, "responses": { @@ -12504,7 +11744,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/MemberEmptyObject" } } } @@ -12535,33 +11775,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateStatusPageChangeTimelineRequest" + "$ref": "#/components/schemas/MemberRoleGrantRequest" }, "example": { - "page_id": 5750613685214, - "change_id": 5821693893131, - "update_id": "01KP0311872NVYFRRQ82FWXAP4", - "description": "Corrected description: root cause identified in database layer.", - "at_seconds": 1712003600 + "member_id": 5068740052131, + "role_ids": [ + 6 + ] } } } } } }, - "/status-page/change/timeline/delete": { + "/member/role/revoke": { "post": { - "operationId": "statusPageChangeTimelineDelete", - "summary": "删除事件时间线", - "description": "从状态页事件中删除时间线条目。", + "operationId": "memberRevokeRole", + "summary": "解除成员角色", + "description": "移除成员的角色授权。", "tags": [ - "On-call/状态页" + "平台/成员管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面事件管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-change-timeline-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **成员管理**(`organization`) |", + "href": "/zh/api-reference/platform/members/member-revoke-role", "metadata": { - "sidebarTitle": "删除事件时间线" + "sidebarTitle": "解除成员角色" } }, "responses": { @@ -12578,7 +11817,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/MemberEmptyObject" } } } @@ -12609,31 +11848,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteStatusPageChangeTimelineRequest" + "$ref": "#/components/schemas/MemberRoleRevokeRequest" }, "example": { - "page_id": 5750613685214, - "change_id": 5821693893131, - "update_id": "01KP0311872NVYFRRQ82FWXAP4" + "member_id": 5068740052131, + "role_ids": [ + 6 + ] } } } } } }, - "/status-page/subscriber/list": { - "get": { - "operationId": "statusPageSubscriberList", - "summary": "查询状态页订阅者列表", - "description": "查询已订阅状态页通知的用户列表。", + "/member/role/update": { + "post": { + "operationId": "memberUpdateRole", + "summary": "更新成员角色", + "description": "一次性替换成员的全部角色授权。", "tags": [ - "On-call/状态页" + "平台/成员管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/status-pages/status-page-subscriber-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **成员管理**(`organization`) |", + "href": "/zh/api-reference/platform/members/member-update-role", "metadata": { - "sidebarTitle": "查询状态页订阅者列表" + "sidebarTitle": "更新成员角色" } }, "responses": { @@ -12650,7 +11890,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageSubscriberListResponse" + "$ref": "#/components/schemas/MemberEmptyObject" } } } @@ -12658,26 +11898,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 2, - "has_next_page": false, - "items": [ - { - "recipient": "alice@example.com", - "method": "email", - "components": [], - "all": true, - "locale": "zh-CN" - }, - { - "recipient": "bob@example.com", - "method": "email", - "components": [], - "all": true, - "locale": "en-US" - } - ] - } + "data": {} } } } @@ -12695,67 +11916,38 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "page_id", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Status page ID." - }, - { - "name": "component_ids", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "description": "Comma-separated component IDs to filter subscribers by." - }, - { - "name": "p", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "minimum": 1, - "default": 1 - }, - "description": "Page number (1-based)." - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100, - "default": 10 - }, - "description": "Page size (1-100)." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MemberRoleUpdateRequest" + }, + "example": { + "member_id": 5068740052131, + "role_ids": [ + 2, + 6 + ] + } + } } - ] + } } }, - "/status-page/subscriber/import": { + "/monit/datasource/create": { "post": { - "operationId": "statusPageSubscriberImport", - "summary": "批量导入订阅者", - "description": "批量导入状态页的订阅者。", + "operationId": "monit-datasource-write-create", + "summary": "创建数据源", + "description": "创建新的监控数据源,`payload` 中须包含对应类型的配置块。", "tags": [ - "On-call/状态页" + "Monitors/告警数据源" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **20 次/分钟**;**2 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-subscriber-import", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **数据源管理**(`monit`) |\n\n## 使用说明\n\n- `type_ident` 必须为以下之一:`prometheus`、`loki`、`mysql`、`oracle`、`postgres`、`clickhouse`、`elasticsearch`、`sls`、`victorialogs`。\n- `edge_cluster_name` 指定使用该数据源进行规则评估的 Monitors Edge 集群。\n- 对于 `elasticsearch`,`payload.elasticsearch.deployment` 须设为 `cloud` 或 `self-managed`。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/monitors/data-sources/monit-datasource-write-create", "metadata": { - "sidebarTitle": "批量导入订阅者" + "sidebarTitle": "创建数据源" } }, "responses": { @@ -12772,7 +11964,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/DataSourceItem" } } } @@ -12780,7 +11972,14 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "id": 10, + "type_ident": "prometheus", + "name": "生产 Prometheus", + "enabled": true, + "edge_cluster_name": "default", + "updated_at": 1712000000 + } } } } @@ -12803,45 +12002,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ImportStatusPageSubscribersRequest" + "$ref": "#/components/schemas/DataSourceUpsertRequest" }, "example": { - "page_id": 5750613685214, - "method": "email", - "subscribers": [ - { - "recipient": "alice@example.com", - "all": true, - "locale": "en-US" - }, - { - "recipient": "bob@example.com", - "component_ids": [ - "01KC3GAZ6ZJE40H55GM31RPWZE" - ], - "all": false, - "locale": "zh-CN" + "type_ident": "prometheus", + "name": "生产 Prometheus", + "note": "生产环境 Prometheus", + "address": "http://prometheus.example.com:9090", + "edge_cluster_name": "default", + "payload": { + "prometheus": { + "basic_auth_enabled": false } - ] + } } } } } } }, - "/status-page/subscriber/export": { + "/monit/datasource/delete": { "post": { - "operationId": "statusPageSubscriberExport", - "summary": "导出订阅者", - "description": "以 CSV 附件形式导出状态页的订阅者列表。响应为 `text/csv` 文件,包含列:Method、Recipient、Components、Subscribe All、Locale。", + "operationId": "monit-datasource-write-delete", + "summary": "删除数据源", + "description": "通过 ID 删除数据源。引用该数据源的告警规则需提前更新或删除。", "tags": [ - "On-call/状态页" + "Monitors/告警数据源" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **10 次/分钟**;**1 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-subscriber-export", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **数据源管理**(`monit`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/monitors/data-sources/monit-datasource-write-delete", "metadata": { - "sidebarTitle": "导出订阅者" + "sidebarTitle": "删除数据源" } }, "responses": { @@ -12858,7 +12050,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageSubscriberExportResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -12866,7 +12058,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": "Method,Recipient,Components,Subscribe All,Locale\nemail,alice@example.com,,true,zh-CN\nemail,bob@example.com,,true,en-US" + "data": {} } } } @@ -12889,29 +12081,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ExportStatusPageSubscribersRequest" + "$ref": "#/components/schemas/IDRequest" }, "example": { - "page_id": 5750613685214 + "id": 10 } } } } } }, - "/status-page/migrate-structure": { + "/monit/datasource/info": { "post": { - "operationId": "statusPageMigrateStructure", - "summary": "迁移状态页结构", - "description": "启动迁移任务,从 Atlassian Statuspage 导入结构和历史事件到新的 Flashduty 状态页。", + "operationId": "monit-datasource-read-info", + "summary": "查看数据源详情", + "description": "通过 ID 获取单个数据源的完整信息,包括 `payload` 配置。", "tags": [ - "On-call/状态页" + "Monitors/告警数据源" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-migrate-structure", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **数据源查看**(`monit`) |", + "href": "/zh/api-reference/monitors/data-sources/monit-datasource-read-info", "metadata": { - "sidebarTitle": "迁移状态页结构" + "sidebarTitle": "查看数据源详情" } }, "responses": { @@ -12928,7 +12120,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageMigrationStartResponse" + "$ref": "#/components/schemas/DataSourceItem" } } } @@ -12937,7 +12129,23 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "job_id": "01KP0311872NVYFRRQ82FW0001" + "id": 10, + "account_id": 10023, + "type_ident": "prometheus", + "name": "生产 Prometheus", + "enabled": true, + "note": "生产环境 Prometheus", + "address": "http://prometheus.example.com:9090", + "payload": { + "prometheus": { + "basic_auth_enabled": false, + "basic_auth_username": "", + "basic_auth_password": "", + "tls_skip_verify": false + } + }, + "edge_cluster_name": "default", + "updated_at": 1712000000 } } } @@ -12961,30 +12169,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MigrateStatusPageStructureRequest" + "$ref": "#/components/schemas/IDRequest" }, "example": { - "api_key": "sk-stsp-xxxxxxxxxxxxxxxxxxxx", - "source_page_id": "abcdefghij" + "id": 10 } } } } } }, - "/status-page/migrate-email-subscribers": { + "/monit/datasource/list": { "post": { - "operationId": "statusPageMigrateEmailSubscribers", - "summary": "迁移邮件订阅者", - "description": "启动迁移任务,从 Atlassian Statuspage 将邮件订阅者导入到已有的 Flashduty 状态页。", + "operationId": "monit-datasource-read-list", + "summary": "查询数据源列表", + "description": "返回当前账户下的所有数据源,可通过 `type_ident` 过滤类型。", "tags": [ - "On-call/状态页" + "Monitors/告警数据源" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-migrate-email-subscribers", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **数据源查看**(`monit`) |\n\n## 使用说明\n\n- 省略 `type_ident` 可返回所有类型的数据源。\n- 列表响应中不返回敏感凭证字段(密码、密钥)。", + "href": "/zh/api-reference/monitors/data-sources/monit-datasource-read-list", "metadata": { - "sidebarTitle": "迁移邮件订阅者" + "sidebarTitle": "查询数据源列表" } }, "responses": { @@ -13001,7 +12208,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageMigrationStartResponse" + "$ref": "#/components/schemas/DataSourceListResponse" } } } @@ -13009,9 +12216,19 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "job_id": "01KP0311872NVYFRRQ82FW0002" - } + "data": [ + { + "id": 10, + "account_id": 10023, + "type_ident": "prometheus", + "name": "生产 Prometheus", + "enabled": true, + "note": "生产环境 Prometheus", + "address": "http://prometheus.example.com:9090", + "edge_cluster_name": "default", + "updated_at": 1712000000 + } + ] } } } @@ -13034,31 +12251,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MigrateStatusPageEmailSubscribersRequest" + "$ref": "#/components/schemas/DataSourceListRequest" }, "example": { - "api_key": "sk-stsp-xxxxxxxxxxxxxxxxxxxx", - "source_page_id": "abcdefghij", - "target_page_id": 5750613685214 + "type": "prometheus" } } } } } }, - "/status-page/migration/status": { - "get": { - "operationId": "statusPageMigrationStatus", - "summary": "获取迁移状态", - "description": "获取状态页迁移任务的当前状态和进度。", + "/monit/datasource/sls/logstores": { + "post": { + "operationId": "monit-datasource-read-sls-logstores", + "summary": "查询 SLS 日志库列表", + "description": "列出指定 SLS 数据源中某个项目下的日志库。", "tags": [ - "On-call/状态页" + "Monitors/告警数据源" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/status-pages/status-page-migration-status", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **数据源查看**(`monit`) |\n\n## 使用说明\n\n- `id` 指定的数据源类型必须为 `sls`。\n- 通过 `project` 指定要列出日志库的 SLS 项目。", + "href": "/zh/api-reference/monitors/data-sources/monit-datasource-read-sls-logstores", "metadata": { - "sidebarTitle": "获取迁移状态" + "sidebarTitle": "查询 SLS 日志库列表" } }, "responses": { @@ -13075,7 +12290,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StatusPageMigrationJob" + "$ref": "#/components/schemas/SLSLogstoresResponse" } } } @@ -13083,27 +12298,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "job_id": "01KP0311872NVYFRRQ82FW0001", - "account_id": 2451002751131, - "source_page_id": "abcdefghij", - "target_page_id": 5750613685214, - "phase": "history", - "status": "completed", - "progress": { - "total_steps": 5, - "completed_steps": 5, - "components_imported": 8, - "sections_imported": 3, - "incidents_imported": 12, - "maintenances_imported": 2, - "subscribers_imported": 0, - "templates_imported": 0, - "subscribers_skipped": 0 - }, - "created_at": 1766736878, - "updated_at": 1766740000 - } + "data": [ + "logstore-1", + "logstore-2" + ] } } } @@ -13121,32 +12319,37 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "job_id", - "in": "query", - "required": true, - "schema": { - "type": "string" - }, - "description": "Migration job ID returned by `migrate-structure` or `migrate-email-subscribers`." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SLSLogstoresRequest" + }, + "example": { + "id": 10, + "project": "project-a", + "offset": 0, + "size": 50 + } + } } - ] + } } }, - "/status-page/migration/cancel": { + "/monit/datasource/sls/projects": { "post": { - "operationId": "statusPageMigrationCancel", - "summary": "取消状态页迁移", - "description": "取消正在进行的状态页迁移任务。只能取消处于 `running` 状态的任务。", + "operationId": "monit-datasource-read-sls-projects", + "summary": "查询 SLS 项目列表", + "description": "列出指定 SLS 数据源中可用的阿里云日志服务(SLS)项目。", "tags": [ - "On-call/状态页" + "Monitors/告警数据源" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-migration-cancel", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **数据源查看**(`monit`) |\n\n## 使用说明\n\n- `id` 指定的数据源类型必须为 `sls`。\n- 使用 `query` 按名称前缀过滤项目,使用 `offset` 和 `size` 分页。", + "href": "/zh/api-reference/monitors/data-sources/monit-datasource-read-sls-projects", "metadata": { - "sidebarTitle": "取消状态页迁移" + "sidebarTitle": "查询 SLS 项目列表" } }, "responses": { @@ -13163,7 +12366,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/SLSProjectsResponse" } } } @@ -13171,7 +12374,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": [ + "project-a", + "project-b" + ] } } } @@ -13194,29 +12400,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CancelStatusPageMigrationRequest" + "$ref": "#/components/schemas/SLSProjectsRequest" }, "example": { - "job_id": "01KP0311872NVYFRRQ82FW0001" + "id": 10, + "query": "", + "offset": 0, + "size": 50 } } } } } }, - "/monit/rule/list/basic": { + "/monit/datasource/update": { "post": { - "operationId": "monit-rule-read-list", - "summary": "查询告警规则列表", - "description": "返回指定文件夹下所有告警规则的基础信息。如需完整规则详情,请调用 `POST /monit/rule/info`。", + "operationId": "monit-datasource-write-update", + "summary": "更新数据源", + "description": "更新已有数据源,需提供 `id` 及待修改的字段。", "tags": [ - "Monitors/告警规则" + "Monitors/告警数据源" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |\n\n## 使用说明\n\n- 将 `folder_id` 设为 `0` 可列出当前用户有权查看的所有文件夹下的规则。\n- `triggered` 字段表示该规则当前是否有活跃告警。", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **数据源管理**(`monit`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/monitors/data-sources/monit-datasource-write-update", "metadata": { - "sidebarTitle": "查询告警规则列表" + "sidebarTitle": "更新数据源" } }, "responses": { @@ -13233,7 +12442,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleBasicListResponse" + "$ref": "#/components/schemas/DataSourceItem" } } } @@ -13241,17 +12450,14 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - { - "id": 50001, - "folder_id": 100, - "name": "CPU 过高", - "ds_type": "prometheus", - "enabled": true, - "triggered": true, - "created_at": 1710000000 - } - ] + "data": { + "id": 10, + "type_ident": "prometheus", + "name": "生产 Prometheus v2", + "enabled": true, + "edge_cluster_name": "default", + "updated_at": 1712100000 + } } } } @@ -13274,29 +12480,39 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleListRequest" + "$ref": "#/components/schemas/DataSourceUpsertRequest" }, "example": { - "folder_id": 100 + "id": 10, + "type_ident": "prometheus", + "name": "生产 Prometheus v2", + "note": "已更新", + "address": "http://prometheus-v2.example.com:9090", + "edge_cluster_name": "default", + "payload": { + "prometheus": { + "basic_auth_enabled": false + } + } } } } } } }, - "/monit/rule/info": { + "/monit/preview/sync": { "post": { - "operationId": "monit-rule-read-info", - "summary": "查看告警规则详情", - "description": "通过 ID 返回告警规则的完整配置,包括规则查询、阈值和通知设置。", + "operationId": "monit-preview-sync", + "summary": "同步预览数据源查询", + "description": "同步执行数据源查询并返回原始结果,用于在保存前预览告警规则表达式的效果。", "tags": [ - "Monitors/告警规则" + "Monitors/通用工具" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **60 次/分钟**;**10 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `ds_type` 须与数据源类型匹配,如 `prometheus`、`loki`。\n- `ds_name` 为账户中配置的数据源显示名称。\n- `delay_seconds` 将查询窗口向前偏移指定秒数,用于补偿数据摄入延迟。\n- 响应体为数据源返回的原始 JSON,其结构随数据源类型而异。", + "href": "/zh/api-reference/monitors/monitor-utilities/monit-preview-sync", "metadata": { - "sidebarTitle": "查看告警规则详情" + "sidebarTitle": "同步预览数据源查询" } }, "responses": { @@ -13313,7 +12529,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertRuleInfoResponse" + "$ref": "#/components/schemas/PreviewSyncResponse" } } } @@ -13322,18 +12538,11 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "id": 50001, - "folder_id": 100, - "name": "CPU 过高", - "ds_type": "prometheus", - "ds_list": [ - "prometheus*" - ], - "enabled": true, - "cron_pattern": "* * * * *", - "channel_ids": [ - 20001 - ] + "status": "success", + "data": { + "resultType": "vector", + "result": [] + } } } } @@ -13357,29 +12566,70 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleIDRequest" + "$ref": "#/components/schemas/PreviewSyncRequest" }, "example": { - "id": 50001 + "ds_type": "prometheus", + "ds_name": "生产 Prometheus", + "expr": "rate(http_requests_total[5m])", + "delay_seconds": 0 } } } } } }, - "/monit/rule/create": { + "/monit/query/diagnose": { "post": { - "operationId": "monit-rule-write-create", - "summary": "创建告警规则", - "description": "创建新的告警规则,返回带有分配 ID 的已创建规则。", + "operationId": "monit-read-query-diagnose", + "summary": "数据源诊断", + "description": "执行同步诊断查询(Loki/VictoriaLogs 使用 `log_patterns`,Prometheus 使用 `metric_trends`)。Flashduty AI SRE 用于日志模式聚类与时间序列趋势分析。长耗时——最长可达 35 秒。", "tags": [ - "Monitors/告警规则" + "Monitors/诊断分析" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- `name`、`ds_type`、`cron_pattern` 和 `rule_configs.queries` 为必填项。\n- `ds_list`(支持通配符)或 `ds_ids` 必须有一个非空。\n- `cron_pattern` 使用标准 5 字段 cron 语法。\n- `channel_ids` 可为空,告警将通过全局集成路由。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-create", + "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | **600 次/分钟**;**10 次/秒** 每账户 |\n| 权限 | 任意有效的 `app_key`(只读;不受特定权限分类约束) |\n\n## 使用说明\n\n- 这是诊断 / RCA 接口,而非原始数据查询接口——如需查看明细行,请配合 `/monit/query/rows` 使用。\n- `operation` 由 `ds_type` 推导:`loki` / `victorialogs` → `log_patterns`,`prometheus` → `metric_trends`。其他数据源必须显式传入 `operation`。\n- `methods` 选择要执行的分析方法;省略时,`log_patterns` 默认为 `pattern_snapshot + pattern_compare(previous_window)`,`metric_trends` 默认为 `single_window_shape + window_compare(previous_window)`。\n- `time_range` 单位为 Unix 秒;缺失或无效时默认最近 15 分钟;窗口宽度超过 6 小时将被拒绝。\n- 请求通过 WebSocket 转发至 `monit-edge`。长耗时:边缘侧执行可能耗时约 30 秒,叠加 webapi 开销。客户端超时应至少设置为 **35 秒**。\n- `options.*` 由边缘侧设置上限(`max_logs_scanned` ≤ 50 000,`max_patterns` ≤ 50,`examples_per_pattern` ≤ 3,`step_seconds` ∈ [15, 300],`max_series` ≤ 200,`topk` ≤ 50,`timeout_seconds` ≤ 30)。\n- 与 `/monit/query/rows` 一样存在两层错误:边缘侧执行错误以 HTTP 200 返回,响应体中带 `error` 对象——务必同时检查两层。\n- 日志样例在返回前会经过基础脱敏处理,响应中会带 `warnings: [\"examples redacted\"]`。不可作为原始日志使用。", + "href": "/zh/api-reference/monitors/diagnostics/monit-read-query-diagnose", "metadata": { - "sidebarTitle": "创建告警规则" + "sidebarTitle": "数据源诊断" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DiagnoseRequest" + }, + "example": { + "account_id": 10001, + "ds_type": "victorialogs", + "ds_name": "vmlogs-read", + "operation": "log_patterns", + "time_range": { + "start": 1776847544, + "end": 1776849344 + }, + "methods": [ + { + "name": "pattern_snapshot" + }, + { + "name": "pattern_compare", + "baseline": "same_window_yesterday" + } + ], + "input": { + "query": "_stream:{status='500'}" + }, + "options": { + "max_logs_scanned": 10000, + "max_patterns": 20, + "examples_per_pattern": 2, + "timeout_seconds": 25 + } + } + } } }, "responses": { @@ -13396,7 +12646,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertRule" + "$ref": "#/components/schemas/DiagnoseResponse" } } } @@ -13405,85 +12655,111 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "id": 50001, - "folder_id": 100, - "name": "CPU 过高", - "ds_type": "prometheus", - "created_at": 1712000000 - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertRule" - }, - "example": { - "folder_id": 100, - "name": "CPU 过高", - "ds_type": "prometheus", - "ds_list": [ - "prometheus*" - ], - "enabled": true, - "cron_pattern": "* * * * *", - "channel_ids": [ - 20001 - ], - "rule_configs": { - "queries": [ - { - "name": "A", - "expr": "avg(cpu_usage_idle) < 10" - } - ], - "check_threshold": { - "enabled": true, - "critical": "A", - "alerting_check_times": 1, - "recovery_check_times": 1, - "push_recovery_event": true, - "recovery": { - "mode": "invert" - } + "operation": "log_patterns", + "ds_type": "victorialogs", + "ds_name": "vmlogs-read", + "query": "_stream:{status='500'}", + "window": { + "start": 1776847544, + "end": 1776849344 + }, + "results": [ + { + "method": "pattern_snapshot", + "window": { + "start": 1776847544, + "end": 1776849344 + }, + "summary": { + "logs_scanned": 405, + "baseline_logs_scanned": 0, + "current_truncated": false, + "baseline_truncated": false, + "patterns_total": 2, + "returned_patterns": 2, + "new_patterns": 0, + "surging_patterns": 0, + "surging_threshold": { + "change_ratio_min": 3, + "count_min": 5 + } + }, + "patterns": [ + { + "pattern_hash": "239fa5da", + "template": "POST /api/v/orders/ HTTP/", + "count": 213, + "first_seen": 1776847562, + "last_seen": 1776849336, + "severity": "unknown", + "approximate": false, + "sources": [ + { + "field": "pod", + "value": "order-api-7f69d8d9b6-m4x9n", + "count": 130 + } + ], + "examples": [ + "POST /api/v/orders/ HTTP/" + ] + } + ], + "warnings": [ + "examples redacted" + ] + } + ] } } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" } } } }, - "/monit/rule/update": { + "/monit/query/rows": { "post": { - "operationId": "monit-rule-write-update", - "summary": "更新告警规则", - "description": "替换已有告警规则的完整配置,所有字段将被覆盖。", + "operationId": "monit-read-query-rows", + "summary": "查询数据源原始行", + "description": "对已配置的数据源执行同步即席查询并返回原始行。供 Flashduty AI SRE 及 UI 预览使用。请求通过 WebSocket 转发至 monit-edge,由其对底层数据源(Prometheus / Loki / VictoriaLogs / SLS / MySQL / Postgres / Oracle / ClickHouse / Elasticsearch)执行查询。", "tags": [ - "Monitors/告警规则" + "Monitors/诊断分析" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- `id` 为必填项。其他字段与 `POST /monit/rule/create` 的规则相同。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-update", + "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | **600 次/分钟**;**10 次/秒** 每账户 |\n| 权限 | 任意有效的 `app_key`(只读;不受特定权限分类约束) |\n\n## 使用说明\n\n- 请求通过 WebSocket 转发至 `monit-edge`;`ds_type` + `ds_name` 指定的数据源必须已在调用方账户下存在。\n- 请求体中的 `account_id` 为可选;若提供,必须与已认证账户一致,否则拒绝。\n- 存在两层错误:webapi 层失败使用标准错误信封返回,而 `monit-edge` 执行查询时抛出的错误以 HTTP 200 返回,并在响应体中携带 `error` 对象。除 HTTP 状态外,务必同时检查响应体中的 `error`。\n- monit-edge 强制行数上限;过大结果集会返回 `error.message = \"too many rows\"`。请收窄时间范围或在数据源端聚合。\n- `args` 是一个多态 `string→string` 映射,原样转发。语义取决于 `ds_type`(SLS 需要 `sls.project` + `sls.logstore`;Loki / VictoriaLogs 原始模式需要通过 `*.start`/`*.end` 或 `*.timespan.value`/`*.timespan.unit` 指定时间范围;Prometheus 与 SQL 类数据源忽略该字段)。各数据源的键列表见 monit-webapi query-api 文档。", + "href": "/zh/api-reference/monitors/diagnostics/monit-read-query-rows", "metadata": { - "sidebarTitle": "更新告警规则" + "sidebarTitle": "查询数据源原始行" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryRowsRequest" + }, + "example": { + "account_id": 10001, + "ds_type": "prometheus", + "ds_name": "prod-prom", + "expr": "up", + "delay_seconds": 30 + } + } } }, "responses": { @@ -13500,7 +12776,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertRule" + "$ref": "#/components/schemas/QueryRowsResponse" } } } @@ -13508,10 +12784,18 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "id": 50001, - "updated_at": 1712100000 - } + "data": [ + { + "fields": { + "__name__": "up", + "instance": "10.0.0.1:9100", + "job": "node" + }, + "values": { + "__value__": 1 + } + } + ] } } } @@ -13528,51 +12812,22 @@ "500": { "$ref": "#/components/responses/ServerError" } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertRule" - }, - "example": { - "id": 50001, - "folder_id": 100, - "name": "CPU 过高 v2", - "ds_type": "prometheus", - "ds_list": [ - "prometheus*" - ], - "enabled": true, - "cron_pattern": "* * * * *", - "rule_configs": { - "queries": [ - { - "name": "A", - "expr": "avg(cpu_usage_idle) < 5" - } - ] - } - } - } - } } } }, - "/monit/rule/delete": { + "/monit/rule/audit/detail": { "post": { - "operationId": "monit-rule-write-delete", - "summary": "删除告警规则", - "description": "通过 ID 删除单条告警规则。", + "operationId": "monit-rule-read-audit-detail", + "summary": "查看规则审计快照", + "description": "返回审计记录(包含 `content` 字段,即该时间点规则配置的 JSON 字符串快照)。", "tags": [ "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |\n\n## 使用说明\n\n- 传入来自 `POST /monit/rule/audits` 的审计记录 `id`(非规则 `id`)。\n- `content` 为 JSON 字符串,解析后可获得完整的规则快照。", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-audit-detail", "metadata": { - "sidebarTitle": "删除告警规则" + "sidebarTitle": "查看规则审计快照" } }, "responses": { @@ -13589,7 +12844,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleEmptyResponse" + "$ref": "#/components/schemas/AlertRuleAudit" } } } @@ -13597,7 +12852,16 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "id": 9001, + "account_id": 10023, + "alert_rule_id": 50001, + "action": "update", + "content": "{\"id\":50001,\"name\":\"CPU 过高\"}", + "creator_id": 80011, + "creator_name": "Alice", + "created_at": 1712000000 + } } } } @@ -13620,29 +12884,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleIDRequest" + "$ref": "#/components/schemas/AuditRecordIDRequest" }, "example": { - "id": 50001 + "id": 9001 } } } } } }, - "/monit/rule/delete/batch": { + "/monit/rule/audits": { "post": { - "operationId": "monit-rule-write-delete-batch", - "summary": "批量删除告警规则", - "description": "在单次请求中删除多条告警规则。", + "operationId": "monit-rule-read-audits", + "summary": "查询规则变更历史", + "description": "返回告警规则的变更历史(审计记录)。", "tags": [ "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **30 次/分钟**;**5 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-delete-batch", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-audits", "metadata": { - "sidebarTitle": "批量删除告警规则" + "sidebarTitle": "查询规则变更历史" } }, "responses": { @@ -13659,7 +12923,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleEmptyResponse" + "$ref": "#/components/schemas/RuleAuditListResponse" } } } @@ -13667,7 +12931,17 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": [ + { + "id": 9001, + "account_id": 10023, + "alert_rule_id": 50001, + "action": "update", + "creator_id": 80011, + "creator_name": "Alice", + "created_at": 1712000000 + } + ] } } } @@ -13690,32 +12964,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleIDsRequest" + "$ref": "#/components/schemas/RuleIDRequest" }, "example": { - "ids": [ - 50001, - 50002 - ] + "id": 50001 } } } } } }, - "/monit/rule/update/fields": { + "/monit/rule/counter/channel": { "post": { - "operationId": "monit-rule-write-fields-update", - "summary": "批量更新规则字段", - "description": "一次性更新多条告警规则的特定字段,仅应用 `fields` 列表中指定的字段。", + "operationId": "monit-rule-read-counter-channel", + "summary": "按协作空间查询规则统计", + "description": "返回一个对象,key 为协作空间名称,value 为将告警路由到该协作空间的规则数量。若协作空间名称无法解析,则以协作空间 ID(字符串形式)作为 key。", "tags": [ "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- 在 `fields` 数组中指定要更新的字段名,如 `[\"enabled\", \"channel_ids\"]`。\n- 仅更新指定字段,其他字段保持不变。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-fields-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-counter-channel", "metadata": { - "sidebarTitle": "批量更新规则字段" + "sidebarTitle": "按协作空间查询规则统计" } }, "responses": { @@ -13732,7 +13003,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleNameMessageListResponse" + "$ref": "#/components/schemas/RuleCounterChannelResponse" } } } @@ -13740,16 +13011,9 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - { - "name": "CPU 过高", - "message": "" - }, - { - "name": "磁盘告警", - "message": "" - } - ] + "data": { + "生产": 8 + } } } } @@ -13772,36 +13036,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleFieldsUpdateRequest" + "$ref": "#/components/schemas/RuleEmptyRequest" }, - "example": { - "ids": [ - 50001, - 50002 - ], - "fields": [ - "enabled" - ], - "enabled": false - } + "example": {} } } } } }, - "/monit/rule/import": { + "/monit/rule/counter/node": { "post": { - "operationId": "monit-rule-write-import", - "summary": "导入告警规则", - "description": "从 JSON 数组导入一条或多条告警规则,返回每条规则的导入结果(成功或失败)。", + "operationId": "monit-rule-read-counter-node", + "summary": "按文件夹节点查询规则统计", + "description": "返回一个对象,key 为顶层文件夹名称,value 为该文件夹及其子孙下的规则总数。", "tags": [ "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **20 次/分钟**;**2 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- 请求体为规则导出对象的 JSON 数组(与 `POST /monit/rule/export` 输出兼容)。\n- 每个对象必须包含 `folder_id`、`ds_type` 以及 `ds_list` 或 `ds_ids` 之一。\n- 部分规则可能失败(如名称重复),请检查每条结果的状态。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-import", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-counter-node", "metadata": { - "sidebarTitle": "导入告警规则" + "sidebarTitle": "按文件夹节点查询规则统计" } }, "responses": { @@ -13818,7 +13073,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleImportResponse" + "$ref": "#/components/schemas/RuleCounterNodeResponse" } } } @@ -13826,12 +13081,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - { - "name": "CPU 过高", - "message": "" - } - ] + "data": { + "生产环境": 10, + "预发环境": 3 + } } } } @@ -13854,46 +13107,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleImportRequest" + "$ref": "#/components/schemas/RuleEmptyRequest" }, - "example": [ - { - "folder_id": 100, - "name": "CPU 过高", - "ds_type": "prometheus", - "ds_list": [ - "prometheus*" - ], - "enabled": true, - "cron_pattern": "* * * * *", - "rule_configs": { - "queries": [ - { - "name": "A", - "expr": "avg(cpu_usage_idle) < 10" - } - ] - } - } - ] + "example": {} } } } } }, - "/monit/rule/export": { + "/monit/rule/counter/status": { "post": { - "operationId": "monit-rule-read-export", - "summary": "导出告警规则", - "description": "将选定告警规则的配置导出为可移植的 JSON 数组,与 `POST /monit/rule/import` 兼容。", + "operationId": "monit-rule-read-counter-status", + "summary": "查看顶层文件夹规则状态统计", + "description": "返回所有顶层文件夹节点的规则触发状态汇总,用于概览看板。", "tags": [ "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **10 次/分钟**;**1 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-export", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-counter-status", "metadata": { - "sidebarTitle": "导出告警规则" + "sidebarTitle": "查看顶层文件夹规则状态统计" } }, "responses": { @@ -13910,7 +13144,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertRuleExportListResponse" + "$ref": "#/components/schemas/RuleStatusResponse" } } } @@ -13920,13 +13154,10 @@ "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": [ { - "name": "CPU 过高", - "ds_type": "prometheus", - "ds_list": [ - "prometheus*" - ], - "enabled": true, - "cron_pattern": "* * * * *" + "folder_id": 100, + "folder_name": "生产环境", + "rule_total": 10, + "triggered_rule_count": 2 } ] } @@ -13951,31 +13182,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleIDsRequest" + "$ref": "#/components/schemas/RuleEmptyRequest" }, - "example": { - "ids": [ - 50001 - ] - } + "example": {} } } } } }, - "/monit/rule/move": { + "/monit/rule/counter/total": { "post": { - "operationId": "monit-rule-write-move", - "summary": "移动告警规则到文件夹", - "description": "将一条或多条告警规则移动到其他文件夹。", + "operationId": "monit-rule-read-counter-total", + "summary": "查看规则数量时序", + "description": "返回当前账户下规则总数的历史时序数据,每个 `clock` 时间戳对应一个采样。", "tags": [ "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-move", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |\n\n## 使用说明\n\n- 每一项为一次历史快照:`num` 为 `clock`(Unix 时间戳,秒)时刻的规则总数。", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-counter-total", "metadata": { - "sidebarTitle": "移动告警规则到文件夹" + "sidebarTitle": "查看规则数量时序" } }, "responses": { @@ -13992,7 +13219,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleNameMessageListResponse" + "$ref": "#/components/schemas/RuleCounterTotalResponse" } } } @@ -14002,8 +13229,10 @@ "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": [ { - "name": "CPU 过高", - "message": "" + "id": 1, + "account_id": 10023, + "num": 50, + "clock": 1712000000 } ] } @@ -14028,33 +13257,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleMoveRequest" + "$ref": "#/components/schemas/RuleEmptyRequest" }, - "example": { - "ids": [ - 50001, - 50002 - ], - "dest_folder_id": 200 - } + "example": {} } } } } }, - "/monit/rule/status": { + "/monit/rule/create": { "post": { - "operationId": "monit-rule-write-status", - "summary": "查看文件夹下规则触发状态", - "description": "返回指定文件夹节点及其子孙节点下所有规则的触发情况汇总。", + "operationId": "monit-rule-write-create", + "summary": "创建告警规则", + "description": "创建新的告警规则,返回带有分配 ID 的已创建规则。", "tags": [ "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- 将 `folder_id` 设为 `0` 可获取所有文件夹的汇总。\n- 若文件夹包含规则数量过多,为保护系统会跳过计算。", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-status", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- `name`、`ds_type`、`cron_pattern` 和 `rule_configs.queries` 为必填项。\n- `ds_list`(支持通配符)或 `ds_ids` 必须有一个非空。\n- `cron_pattern` 使用标准 5 字段 cron 语法。\n- `channel_ids` 可为空,告警将通过全局集成路由。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-create", "metadata": { - "sidebarTitle": "查看文件夹下规则触发状态" + "sidebarTitle": "创建告警规则" } }, "responses": { @@ -14071,7 +13294,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleStatusResponse" + "$ref": "#/components/schemas/AlertRule" } } } @@ -14079,14 +13302,13 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - { - "folder_id": 100, - "folder_name": "生产环境", - "rule_total": 10, - "triggered_rule_count": 2 - } - ] + "data": { + "id": 50001, + "folder_id": 100, + "name": "CPU 过高", + "ds_type": "prometheus", + "created_at": 1712000000 + } } } } @@ -14109,29 +13331,57 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleFolderIDRequest" + "$ref": "#/components/schemas/AlertRule" }, "example": { - "folder_id": 100 + "folder_id": 100, + "name": "CPU 过高", + "ds_type": "prometheus", + "ds_list": [ + "prometheus*" + ], + "enabled": true, + "cron_pattern": "* * * * *", + "channel_ids": [ + 20001 + ], + "rule_configs": { + "queries": [ + { + "name": "A", + "expr": "avg(cpu_usage_idle) < 10" + } + ], + "check_threshold": { + "enabled": true, + "critical": "A", + "alerting_check_times": 1, + "recovery_check_times": 1, + "push_recovery_event": true, + "recovery": { + "mode": "invert" + } + } + } } } } } } }, - "/monit/rule/audits": { + "/monit/rule/delete": { "post": { - "operationId": "monit-rule-read-audits", - "summary": "查询规则变更历史", - "description": "返回告警规则的变更历史(审计记录)。", + "operationId": "monit-rule-write-delete", + "summary": "删除告警规则", + "description": "通过 ID 删除单条告警规则。", "tags": [ "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-audits", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-delete", "metadata": { - "sidebarTitle": "查询规则变更历史" + "sidebarTitle": "删除告警规则" } }, "responses": { @@ -14148,7 +13398,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleAuditListResponse" + "$ref": "#/components/schemas/RuleEmptyResponse" } } } @@ -14156,17 +13406,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - { - "id": 9001, - "account_id": 10023, - "alert_rule_id": 50001, - "action": "update", - "creator_id": 80011, - "creator_name": "Alice", - "created_at": 1712000000 - } - ] + "data": {} } } } @@ -14199,19 +13439,19 @@ } } }, - "/monit/rule/audit/detail": { + "/monit/rule/delete/batch": { "post": { - "operationId": "monit-rule-read-audit-detail", - "summary": "查看规则审计快照", - "description": "返回审计记录(包含 `content` 字段,即该时间点规则配置的 JSON 字符串快照)。", + "operationId": "monit-rule-write-delete-batch", + "summary": "批量删除告警规则", + "description": "在单次请求中删除多条告警规则。", "tags": [ "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |\n\n## 使用说明\n\n- 传入来自 `POST /monit/rule/audits` 的审计记录 `id`(非规则 `id`)。\n- `content` 为 JSON 字符串,解析后可获得完整的规则快照。", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-audit-detail", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **30 次/分钟**;**5 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-delete-batch", "metadata": { - "sidebarTitle": "查看规则审计快照" + "sidebarTitle": "批量删除告警规则" } }, "responses": { @@ -14228,7 +13468,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AlertRuleAudit" + "$ref": "#/components/schemas/RuleEmptyResponse" } } } @@ -14236,16 +13476,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "id": 9001, - "account_id": 10023, - "alert_rule_id": 50001, - "action": "update", - "content": "{\"id\":50001,\"name\":\"CPU 过高\"}", - "creator_id": 80011, - "creator_name": "Alice", - "created_at": 1712000000 - } + "data": {} } } } @@ -14268,10 +13499,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AuditRecordIDRequest" + "$ref": "#/components/schemas/RuleIDsRequest" }, "example": { - "id": 9001 + "ids": [ + 50001, + 50002 + ] } } } @@ -14354,19 +13588,19 @@ } } }, - "/monit/rule/counter/total": { + "/monit/rule/export": { "post": { - "operationId": "monit-rule-read-counter-total", - "summary": "查看规则数量时序", - "description": "返回当前账户下规则总数的历史时序数据,每个 `clock` 时间戳对应一个采样。", + "operationId": "monit-rule-read-export", + "summary": "导出告警规则", + "description": "将选定告警规则的配置导出为可移植的 JSON 数组,与 `POST /monit/rule/import` 兼容。", "tags": [ "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |\n\n## 使用说明\n\n- 每一项为一次历史快照:`num` 为 `clock`(Unix 时间戳,秒)时刻的规则总数。", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-counter-total", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **10 次/分钟**;**1 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-export", "metadata": { - "sidebarTitle": "查看规则数量时序" + "sidebarTitle": "导出告警规则" } }, "responses": { @@ -14383,7 +13617,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleCounterTotalResponse" + "$ref": "#/components/schemas/AlertRuleExportListResponse" } } } @@ -14393,10 +13627,13 @@ "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": [ { - "id": 1, - "account_id": 10023, - "num": 50, - "clock": 1712000000 + "name": "CPU 过高", + "ds_type": "prometheus", + "ds_list": [ + "prometheus*" + ], + "enabled": true, + "cron_pattern": "* * * * *" } ] } @@ -14421,27 +13658,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleEmptyRequest" + "$ref": "#/components/schemas/RuleIDsRequest" }, - "example": {} + "example": { + "ids": [ + 50001 + ] + } } } } } }, - "/monit/rule/counter/node": { + "/monit/rule/import": { "post": { - "operationId": "monit-rule-read-counter-node", - "summary": "按文件夹节点查询规则统计", - "description": "返回一个对象,key 为顶层文件夹名称,value 为该文件夹及其子孙下的规则总数。", + "operationId": "monit-rule-write-import", + "summary": "导入告警规则", + "description": "从 JSON 数组导入一条或多条告警规则,返回每条规则的导入结果(成功或失败)。", "tags": [ "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-counter-node", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **20 次/分钟**;**2 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- 请求体为规则导出对象的 JSON 数组(与 `POST /monit/rule/export` 输出兼容)。\n- 每个对象必须包含 `folder_id`、`ds_type` 以及 `ds_list` 或 `ds_ids` 之一。\n- 部分规则可能失败(如名称重复),请检查每条结果的状态。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-import", "metadata": { - "sidebarTitle": "按文件夹节点查询规则统计" + "sidebarTitle": "导入告警规则" } }, "responses": { @@ -14458,7 +13699,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleCounterNodeResponse" + "$ref": "#/components/schemas/RuleImportResponse" } } } @@ -14466,10 +13707,12 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "生产环境": 10, - "预发环境": 3 - } + "data": [ + { + "name": "CPU 过高", + "message": "" + } + ] } } } @@ -14492,27 +13735,46 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleEmptyRequest" + "$ref": "#/components/schemas/RuleImportRequest" }, - "example": {} + "example": [ + { + "folder_id": 100, + "name": "CPU 过高", + "ds_type": "prometheus", + "ds_list": [ + "prometheus*" + ], + "enabled": true, + "cron_pattern": "* * * * *", + "rule_configs": { + "queries": [ + { + "name": "A", + "expr": "avg(cpu_usage_idle) < 10" + } + ] + } + } + ] } } } } }, - "/monit/rule/counter/channel": { + "/monit/rule/info": { "post": { - "operationId": "monit-rule-read-counter-channel", - "summary": "按协作空间查询规则统计", - "description": "返回一个对象,key 为协作空间名称,value 为将告警路由到该协作空间的规则数量。若协作空间名称无法解析,则以协作空间 ID(字符串形式)作为 key。", + "operationId": "monit-rule-read-info", + "summary": "查看告警规则详情", + "description": "通过 ID 返回告警规则的完整配置,包括规则查询、阈值和通知设置。", "tags": [ "Monitors/告警规则" ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-counter-channel", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-info", "metadata": { - "sidebarTitle": "按协作空间查询规则统计" + "sidebarTitle": "查看告警规则详情" } }, "responses": { @@ -14529,7 +13791,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleCounterChannelResponse" + "$ref": "#/components/schemas/AlertRuleInfoResponse" } } } @@ -14538,7 +13800,18 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "生产": 8 + "id": 50001, + "folder_id": 100, + "name": "CPU 过高", + "ds_type": "prometheus", + "ds_list": [ + "prometheus*" + ], + "enabled": true, + "cron_pattern": "* * * * *", + "channel_ids": [ + 20001 + ] } } } @@ -14562,27 +13835,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleEmptyRequest" + "$ref": "#/components/schemas/RuleIDRequest" }, - "example": {} + "example": { + "id": 50001 + } } } } } }, - "/monit/rule/counter/status": { + "/monit/rule/list/basic": { "post": { - "operationId": "monit-rule-read-counter-status", - "summary": "查看顶层文件夹规则状态统计", - "description": "返回所有顶层文件夹节点的规则触发状态汇总,用于概览看板。", + "operationId": "monit-rule-read-list", + "summary": "查询告警规则列表", + "description": "返回指定文件夹下所有告警规则的基础信息。如需完整规则详情,请调用 `POST /monit/rule/info`。", "tags": [ "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |", - "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-counter-status", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则查看**(`monit`) |\n\n## 使用说明\n\n- 将 `folder_id` 设为 `0` 可列出当前用户有权查看的所有文件夹下的规则。\n- `triggered` 字段表示该规则当前是否有活跃告警。", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-read-list", "metadata": { - "sidebarTitle": "查看顶层文件夹规则状态统计" + "sidebarTitle": "查询告警规则列表" } }, "responses": { @@ -14599,7 +13874,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RuleStatusResponse" + "$ref": "#/components/schemas/RuleBasicListResponse" } } } @@ -14609,10 +13884,13 @@ "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": [ { + "id": 50001, "folder_id": 100, - "folder_name": "生产环境", - "rule_total": 10, - "triggered_rule_count": 2 + "name": "CPU 过高", + "ds_type": "prometheus", + "enabled": true, + "triggered": true, + "created_at": 1710000000 } ] } @@ -14637,27 +13915,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleEmptyRequest" + "$ref": "#/components/schemas/RuleListRequest" }, - "example": {} + "example": { + "folder_id": 100 + } } } } } }, - "/monit/datasource/list": { + "/monit/rule/move": { "post": { - "operationId": "monit-datasource-read-list", - "summary": "查询数据源列表", - "description": "返回当前账户下的所有数据源,可通过 `type_ident` 过滤类型。", + "operationId": "monit-rule-write-move", + "summary": "移动告警规则到文件夹", + "description": "将一条或多条告警规则移动到其他文件夹。", "tags": [ - "Monitors/告警数据源" + "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **数据源查看**(`monit`) |\n\n## 使用说明\n\n- 省略 `type_ident` 可返回所有类型的数据源。\n- 列表响应中不返回敏感凭证字段(密码、密钥)。", - "href": "/zh/api-reference/monitors/data-sources/monit-datasource-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-move", "metadata": { - "sidebarTitle": "查询数据源列表" + "sidebarTitle": "移动告警规则到文件夹" } }, "responses": { @@ -14674,7 +13954,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DataSourceListResponse" + "$ref": "#/components/schemas/RuleNameMessageListResponse" } } } @@ -14684,15 +13964,8 @@ "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": [ { - "id": 10, - "account_id": 10023, - "type_ident": "prometheus", - "name": "生产 Prometheus", - "enabled": true, - "note": "生产环境 Prometheus", - "address": "http://prometheus.example.com:9090", - "edge_cluster_name": "default", - "updated_at": 1712000000 + "name": "CPU 过高", + "message": "" } ] } @@ -14717,29 +13990,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceListRequest" + "$ref": "#/components/schemas/RuleMoveRequest" }, "example": { - "type": "prometheus" + "ids": [ + 50001, + 50002 + ], + "dest_folder_id": 200 } } } } } }, - "/monit/datasource/info": { + "/monit/rule/status": { "post": { - "operationId": "monit-datasource-read-info", - "summary": "查看数据源详情", - "description": "通过 ID 获取单个数据源的完整信息,包括 `payload` 配置。", + "operationId": "monit-rule-write-status", + "summary": "查看文件夹下规则触发状态", + "description": "返回指定文件夹节点及其子孙节点下所有规则的触发情况汇总。", "tags": [ - "Monitors/告警数据源" + "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **数据源查看**(`monit`) |", - "href": "/zh/api-reference/monitors/data-sources/monit-datasource-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- 将 `folder_id` 设为 `0` 可获取所有文件夹的汇总。\n- 若文件夹包含规则数量过多,为保护系统会跳过计算。", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-status", "metadata": { - "sidebarTitle": "查看数据源详情" + "sidebarTitle": "查看文件夹下规则触发状态" } }, "responses": { @@ -14756,7 +14033,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DataSourceItem" + "$ref": "#/components/schemas/RuleStatusResponse" } } } @@ -14764,25 +14041,14 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "id": 10, - "account_id": 10023, - "type_ident": "prometheus", - "name": "生产 Prometheus", - "enabled": true, - "note": "生产环境 Prometheus", - "address": "http://prometheus.example.com:9090", - "payload": { - "prometheus": { - "basic_auth_enabled": false, - "basic_auth_username": "", - "basic_auth_password": "", - "tls_skip_verify": false - } - }, - "edge_cluster_name": "default", - "updated_at": 1712000000 - } + "data": [ + { + "folder_id": 100, + "folder_name": "生产环境", + "rule_total": 10, + "triggered_rule_count": 2 + } + ] } } } @@ -14805,29 +14071,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IDRequest" + "$ref": "#/components/schemas/RuleFolderIDRequest" }, "example": { - "id": 10 + "folder_id": 100 } } } } } }, - "/monit/datasource/create": { + "/monit/rule/update": { "post": { - "operationId": "monit-datasource-write-create", - "summary": "创建数据源", - "description": "创建新的监控数据源,`payload` 中须包含对应类型的配置块。", + "operationId": "monit-rule-write-update", + "summary": "更新告警规则", + "description": "替换已有告警规则的完整配置,所有字段将被覆盖。", "tags": [ - "Monitors/告警数据源" + "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **数据源管理**(`monit`) |\n\n## 使用说明\n\n- `type_ident` 必须为以下之一:`prometheus`、`loki`、`mysql`、`oracle`、`postgres`、`clickhouse`、`elasticsearch`、`sls`、`victorialogs`。\n- `edge_cluster_name` 指定使用该数据源进行规则评估的 Monitors Edge 集群。\n- 对于 `elasticsearch`,`payload.elasticsearch.deployment` 须设为 `cloud` 或 `self-managed`。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/monitors/data-sources/monit-datasource-write-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- `id` 为必填项。其他字段与 `POST /monit/rule/create` 的规则相同。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-update", "metadata": { - "sidebarTitle": "创建数据源" + "sidebarTitle": "更新告警规则" } }, "responses": { @@ -14844,7 +14110,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DataSourceItem" + "$ref": "#/components/schemas/AlertRule" } } } @@ -14853,12 +14119,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "id": 10, - "type_ident": "prometheus", - "name": "生产 Prometheus", - "enabled": true, - "edge_cluster_name": "default", - "updated_at": 1712000000 + "id": 50001, + "updated_at": 1712100000 } } } @@ -14882,18 +14144,25 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceUpsertRequest" + "$ref": "#/components/schemas/AlertRule" }, "example": { - "type_ident": "prometheus", - "name": "生产 Prometheus", - "note": "生产环境 Prometheus", - "address": "http://prometheus.example.com:9090", - "edge_cluster_name": "default", - "payload": { - "prometheus": { - "basic_auth_enabled": false - } + "id": 50001, + "folder_id": 100, + "name": "CPU 过高 v2", + "ds_type": "prometheus", + "ds_list": [ + "prometheus*" + ], + "enabled": true, + "cron_pattern": "* * * * *", + "rule_configs": { + "queries": [ + { + "name": "A", + "expr": "avg(cpu_usage_idle) < 5" + } + ] } } } @@ -14901,19 +14170,19 @@ } } }, - "/monit/datasource/update": { + "/monit/rule/update/fields": { "post": { - "operationId": "monit-datasource-write-update", - "summary": "更新数据源", - "description": "更新已有数据源,需提供 `id` 及待修改的字段。", + "operationId": "monit-rule-write-fields-update", + "summary": "批量更新规则字段", + "description": "一次性更新多条告警规则的特定字段,仅应用 `fields` 列表中指定的字段。", "tags": [ - "Monitors/告警数据源" + "Monitors/告警规则" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **数据源管理**(`monit`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/monitors/data-sources/monit-datasource-write-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **告警规则管理**(`monit`) |\n\n## 使用说明\n\n- 在 `fields` 数组中指定要更新的字段名,如 `[\"enabled\", \"channel_ids\"]`。\n- 仅更新指定字段,其他字段保持不变。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/monitors/alert-rules/monit-rule-write-fields-update", "metadata": { - "sidebarTitle": "更新数据源" + "sidebarTitle": "批量更新规则字段" } }, "responses": { @@ -14930,7 +14199,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DataSourceItem" + "$ref": "#/components/schemas/RuleNameMessageListResponse" } } } @@ -14938,14 +14207,16 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "id": 10, - "type_ident": "prometheus", - "name": "生产 Prometheus v2", - "enabled": true, - "edge_cluster_name": "default", - "updated_at": 1712100000 - } + "data": [ + { + "name": "CPU 过高", + "message": "" + }, + { + "name": "磁盘告警", + "message": "" + } + ] } } } @@ -14968,39 +14239,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceUpsertRequest" + "$ref": "#/components/schemas/RuleFieldsUpdateRequest" }, "example": { - "id": 10, - "type_ident": "prometheus", - "name": "生产 Prometheus v2", - "note": "已更新", - "address": "http://prometheus-v2.example.com:9090", - "edge_cluster_name": "default", - "payload": { - "prometheus": { - "basic_auth_enabled": false - } - } + "ids": [ + 50001, + 50002 + ], + "fields": [ + "enabled" + ], + "enabled": false } } } } } }, - "/monit/datasource/delete": { + "/monit/store/ruleset/create": { "post": { - "operationId": "monit-datasource-write-delete", - "summary": "删除数据源", - "description": "通过 ID 删除数据源。引用该数据源的告警规则需提前更新或删除。", + "operationId": "monit-store-ruleset-create", + "summary": "创建规则集", + "description": "在规则仓库中创建新的规则集。", "tags": [ - "Monitors/告警数据源" + "Monitors/规则集" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **数据源管理**(`monit`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/monitors/data-sources/monit-datasource-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **规则仓库管理**(`monit`) |\n\n## 使用说明\n\n- `open_flag`:`0` 仅创建者可见,`1` 账户内共享,`2` 公开。\n- `payload` 为必填 JSON 字符串,包含告警规则定义。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/monitors/rule-sets/monit-store-ruleset-create", "metadata": { - "sidebarTitle": "删除数据源" + "sidebarTitle": "创建规则集" } }, "responses": { @@ -15017,7 +14285,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/StoreRulesetItem" } } } @@ -15025,7 +14293,14 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "id": 1, + "type_ident": "prometheus", + "note": "CPU 用量告警", + "open_flag": 1, + "created_at": 1712000000, + "updated_at": 1712000000 + } } } } @@ -15048,29 +14323,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IDRequest" + "$ref": "#/components/schemas/StoreRulesetUpsertRequest" }, "example": { - "id": 10 + "type_ident": "prometheus", + "note": "CPU 用量告警", + "open_flag": 1, + "payload": "[{\"prom_ql\":\"rate(cpu_usage[5m]) > 0.8\"}]" } } } } } }, - "/monit/datasource/sls/projects": { + "/monit/store/ruleset/delete": { "post": { - "operationId": "monit-datasource-read-sls-projects", - "summary": "查询 SLS 项目列表", - "description": "列出指定 SLS 数据源中可用的阿里云日志服务(SLS)项目。", + "operationId": "monit-store-ruleset-delete", + "summary": "删除规则集", + "description": "通过 ID 从规则仓库中删除规则集。", "tags": [ - "Monitors/告警数据源" + "Monitors/规则集" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **数据源查看**(`monit`) |\n\n## 使用说明\n\n- `id` 指定的数据源类型必须为 `sls`。\n- 使用 `query` 按名称前缀过滤项目,使用 `offset` 和 `size` 分页。", - "href": "/zh/api-reference/monitors/data-sources/monit-datasource-read-sls-projects", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **规则仓库管理**(`monit`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/monitors/rule-sets/monit-store-ruleset-delete", "metadata": { - "sidebarTitle": "查询 SLS 项目列表" + "sidebarTitle": "删除规则集" } }, "responses": { @@ -15087,7 +14365,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SLSProjectsResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -15095,10 +14373,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - "project-a", - "project-b" - ] + "data": {} } } } @@ -15121,32 +14396,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SLSProjectsRequest" + "$ref": "#/components/schemas/IDRequest" }, "example": { - "id": 10, - "query": "", - "offset": 0, - "size": 50 + "id": 1 } } } } } }, - "/monit/datasource/sls/logstores": { + "/monit/store/ruleset/info": { "post": { - "operationId": "monit-datasource-read-sls-logstores", - "summary": "查询 SLS 日志库列表", - "description": "列出指定 SLS 数据源中某个项目下的日志库。", + "operationId": "monit-store-ruleset-info", + "summary": "查看规则集详情", + "description": "获取规则集的完整信息,包括 `payload`(JSON 字符串形式的告警规则定义)。", "tags": [ - "Monitors/告警数据源" + "Monitors/规则集" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **数据源查看**(`monit`) |\n\n## 使用说明\n\n- `id` 指定的数据源类型必须为 `sls`。\n- 通过 `project` 指定要列出日志库的 SLS 项目。", - "href": "/zh/api-reference/monitors/data-sources/monit-datasource-read-sls-logstores", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **规则仓库查看**(`monit`) |", + "href": "/zh/api-reference/monitors/rule-sets/monit-store-ruleset-info", "metadata": { - "sidebarTitle": "查询 SLS 日志库列表" + "sidebarTitle": "查看规则集详情" } }, "responses": { @@ -15163,7 +14435,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SLSLogstoresResponse" + "$ref": "#/components/schemas/StoreRulesetItem" } } } @@ -15171,10 +14443,18 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - "logstore-1", - "logstore-2" - ] + "data": { + "id": 1, + "type_ident": "prometheus", + "note": "CPU 用量告警", + "open_flag": 2, + "payload": "[{\"prom_ql\":\"...\"}]", + "creator_account_id": 10023, + "creator_id": 80011, + "creator_name": "Alice", + "created_at": 1710000000, + "updated_at": 1712000000 + } } } } @@ -15197,13 +14477,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SLSLogstoresRequest" + "$ref": "#/components/schemas/IDRequest" }, "example": { - "id": 10, - "project": "project-a", - "offset": 0, - "size": 50 + "id": 1 } } } @@ -15292,19 +14569,19 @@ } } }, - "/monit/store/ruleset/info": { + "/monit/store/ruleset/update": { "post": { - "operationId": "monit-store-ruleset-info", - "summary": "查看规则集详情", - "description": "获取规则集的完整信息,包括 `payload`(JSON 字符串形式的告警规则定义)。", + "operationId": "monit-store-ruleset-update", + "summary": "更新规则集", + "description": "更新已有规则集的备注、共享标志及 payload。", "tags": [ "Monitors/规则集" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **规则仓库查看**(`monit`) |", - "href": "/zh/api-reference/monitors/rule-sets/monit-store-ruleset-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **规则仓库管理**(`monit`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/monitors/rule-sets/monit-store-ruleset-update", "metadata": { - "sidebarTitle": "查看规则集详情" + "sidebarTitle": "更新规则集" } }, "responses": { @@ -15331,15 +14608,9 @@ "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { "id": 1, - "type_ident": "prometheus", - "note": "CPU 用量告警", + "note": "更新后的 CPU 告警", "open_flag": 2, - "payload": "[{\"prom_ql\":\"...\"}]", - "creator_account_id": 10023, - "creator_id": 80011, - "creator_name": "Alice", - "created_at": 1710000000, - "updated_at": 1712000000 + "updated_at": 1712100000 } } } @@ -15363,29 +14634,46 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IDRequest" + "$ref": "#/components/schemas/StoreRulesetUpdateRequest" }, "example": { - "id": 1 + "id": 1, + "note": "更新后的 CPU 告警", + "open_flag": 2, + "payload": "[{\"prom_ql\":\"rate(cpu_usage[5m]) > 0.9\"}]" } } } } } }, - "/monit/store/ruleset/create": { + "/monit/targets": { "post": { - "operationId": "monit-store-ruleset-create", - "summary": "创建规则集", - "description": "在规则仓库中创建新的规则集。", + "operationId": "monit-read-targets-list", + "summary": "监控对象列表", + "description": "列出当前租户下被 monit-agent 路由投影所观测到的监控对象。支持 `target_locator` 前缀搜索与游标分页。用于为 `/monit/tools/catalog` 与 `/monit/tools/invoke` 选择 `target_locator`。", "tags": [ - "Monitors/规则集" + "Monitors/诊断分析" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **规则仓库管理**(`monit`) |\n\n## 使用说明\n\n- `open_flag`:`0` 仅创建者可见,`1` 账户内共享,`2` 公开。\n- `payload` 为必填 JSON 字符串,包含告警规则定义。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/monitors/rule-sets/monit-store-ruleset-create", + "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | **600 次/分钟**;**10 次/秒** 每账户 |\n| 权限 | 任意有效的 `app_key`(只读;不受特定权限分类约束) |\n\n## 使用说明\n\n- 这是一个 **UI 投影视图**,不是 `/monit/tools/invoke` 所依赖的实时数据源。列表中存在不代表对应监控对象当前可被调用。\n- `keyword` 是对 `target_locator` 的**前缀匹配**(仅 ASCII,不含空白,不含 `|`,最长 256 字节)。v1 不支持子串搜索。\n- `limit` 默认 50,最大 200。分页基于游标:将上次响应中的 `next_cursor` 传入即可拉取下一页;`next_cursor` 为空或缺失表示已到末页。\n- 重置 `keyword`、`limit` 或租户上下文时必须重置 `cursor`;切勿在不同筛选条件之间复用游标。\n- `total` 是当前 `(account_id, keyword)` 组合下未受游标影响的匹配总数,跨页保持稳定。\n- 字段中暴露 `cluster_name` / `edge_ipport` 供排障使用;`updated_at` 表示\"最近一次被观测到\",而非实时在线指标。", + "href": "/zh/api-reference/monitors/diagnostics/monit-read-targets-list", "metadata": { - "sidebarTitle": "创建规则集" + "sidebarTitle": "监控对象列表" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TargetsListRequest" + }, + "example": { + "keyword": "db-prod", + "limit": 50 + } + } } }, "responses": { @@ -15402,7 +14690,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StoreRulesetItem" + "$ref": "#/components/schemas/TargetsListResponse" } } } @@ -15411,12 +14699,18 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "id": 1, - "type_ident": "prometheus", - "note": "CPU 用量告警", - "open_flag": 1, - "created_at": 1712000000, - "updated_at": 1712000000 + "items": [ + { + "target_kind": "host", + "target_locator": "db-prod-01", + "agent_version": "2.0.0", + "cluster_name": "edge-a", + "edge_ipport": "10.0.0.1:19090", + "updated_at": 1710000000 + } + ], + "total": 120, + "next_cursor": "eyJ0YXJnZXRfbG9jYXRvciI6ImRiLXByb2QtMDEiLCJpZCI6MTIzNDV9" } } } @@ -15434,39 +14728,38 @@ "500": { "$ref": "#/components/responses/ServerError" } + } + } + }, + "/monit/tools/catalog": { + "post": { + "operationId": "monit-read-tools-catalog", + "summary": "查询监控对象工具能力清单", + "description": "根据 `target_locator`(host、mysql 等)查询该监控对象上 monit-agent 当前暴露的工具能力。返回每个工具的名称、描述以及 JSON-Schema `input_schema`。配合 `/monit/tools/invoke` 驱动 AI-SRE 的工具调用。", + "tags": [ + "Monitors/诊断分析" + ], + "x-mint": { + "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | **600 次/分钟**;**10 次/秒** 每账户 |\n| 权限 | 任意有效的 `app_key`(只读;不受特定权限分类约束) |\n\n## 使用说明\n\n- 使用 `target_locator` 标识监控对象;`target_kind` 可选,省略时自动推断。内置的 target kind 包括 `host` 与 `mysql`。\n- 若同一 locator 匹配多个 kind,响应为 HTTP 200,`data.error.code = \"ambiguous_target_kind\"`,并附带 `target_kinds` 列表——请带上显式的 `target_kind` 重试。\n- 工具能力清单是*候选能力*视图,并非执行保证。目标 Agent 可能在拿到清单与发起调用之间下线,本地 Agent 策略也可能在调用时拦截某些工具。\n- 设置 `include_output_shape: true` 可额外返回每个工具的 `output_shape`。默认为 `false`,以便为 LLM 消费保持响应精简。\n- 业务错误(`target_unavailable`、`unknown_toolset_hash`、`ambiguous_target_kind`)以 HTTP 200 返回,`data.error` 非空。只有协议 / 鉴权 / 内部错误才使用标准错误信封。", + "href": "/zh/api-reference/monitors/diagnostics/monit-read-tools-catalog", + "metadata": { + "sidebarTitle": "查询监控对象工具能力清单" + } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StoreRulesetUpsertRequest" + "$ref": "#/components/schemas/ToolCatalogRequest" }, "example": { - "type_ident": "prometheus", - "note": "CPU 用量告警", - "open_flag": 1, - "payload": "[{\"prom_ql\":\"rate(cpu_usage[5m]) > 0.8\"}]" + "account_id": 10001, + "target_locator": "web-01", + "include_output_shape": true } } } - } - } - }, - "/monit/store/ruleset/update": { - "post": { - "operationId": "monit-store-ruleset-update", - "summary": "更新规则集", - "description": "更新已有规则集的备注、共享标志及 payload。", - "tags": [ - "Monitors/规则集" - ], - "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **规则仓库管理**(`monit`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/monitors/rule-sets/monit-store-ruleset-update", - "metadata": { - "sidebarTitle": "更新规则集" - } }, "responses": { "200": { @@ -15482,7 +14775,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/StoreRulesetItem" + "$ref": "#/components/schemas/ToolCatalogResponse" } } } @@ -15491,10 +14784,42 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "id": 1, - "note": "更新后的 CPU 告警", - "open_flag": 2, - "updated_at": 1712100000 + "target": { + "kind": "host", + "locator": "web-01" + }, + "tools": [ + { + "name": "os.overview", + "target_kind": "host", + "description": "Returns a bounded overview of host health (CPU, memory, disk, network, top processes).", + "input_schema": { + "type": "object", + "additionalProperties": false, + "properties": {} + }, + "output_shape": { + "type": "object", + "required": [ + "data", + "summary", + "truncated" + ], + "properties": { + "data": { + "type": "object" + }, + "summary": { + "type": "string" + }, + "truncated": { + "type": "object" + } + } + } + } + ], + "error": null } } } @@ -15512,39 +14837,50 @@ "500": { "$ref": "#/components/responses/ServerError" } + } + } + }, + "/monit/tools/invoke": { + "post": { + "operationId": "monit-read-tools-invoke", + "summary": "调用监控对象工具", + "description": "在单个监控对象上并发调用至多 8 个 monit-agent 工具。结果按入参 `tools` 数组顺序返回。长耗时——单个工具在 Agent 上有自己的超时,整体请求可能耗时数十秒。", + "tags": [ + "Monitors/诊断分析" + ], + "x-mint": { + "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | **600 次/分钟**;**10 次/秒** 每账户 |\n| 权限 | 任意有效的 `app_key`(只读;不受特定权限分类约束) |\n\n## 使用说明\n\n- 单次调用至多 **8** 个工具(`MaxToolsPerInvoke`);超出需在客户端拆分。8 个工具的上限与单监控对象 Agent 的并发能力对齐。\n- 工具在 Agent 上并行执行;webapi 返回的 `results[]` 与请求中的 `tools[]` 顺序对齐。\n- 长耗时:客户端超时至少设置 **35 秒**。该接口面向 AI-SRE / 人工排障流程,不适用于交互式 UI。\n- 请求级错误(`target_unavailable`、`ambiguous_target_kind`、`unknown_toolset_hash`、`forward_failed`)以 HTTP 200 返回,`data.error` 不为空,`data.results = []`。\n- 单工具失败以 HTTP 200 返回,`data.error = null`,`results[i].error` 被填充——务必同时检查**三层**(外层信封 `error`、`data.error`、再到每个 `results[i].error`)。\n- 每条结果带两个耗时字段:`agent_elapsed_ms`(Agent 自报,不含网络)与 `e2e_elapsed_ms`(webapi 观测的端到端)。两者差距较大表示网络 / 边缘侧慢,而非工具执行慢。\n- 按 `/monit/tools/catalog` 返回的 `input_schema` 构造 `tools[].params`。对于无参工具,务必显式传 `params: {}`。", + "href": "/zh/api-reference/monitors/diagnostics/monit-read-tools-invoke", + "metadata": { + "sidebarTitle": "调用监控对象工具" + } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StoreRulesetUpdateRequest" + "$ref": "#/components/schemas/ToolInvokeRequest" }, "example": { - "id": 1, - "note": "更新后的 CPU 告警", - "open_flag": 2, - "payload": "[{\"prom_ql\":\"rate(cpu_usage[5m]) > 0.9\"}]" + "account_id": 10001, + "target_locator": "web-01", + "tools": [ + { + "tool": "os.overview", + "params": {} + }, + { + "tool": "net.tcp_ping", + "params": { + "host": "10.0.0.10", + "port": 3306 + } + } + ] } } } - } - } - }, - "/monit/store/ruleset/delete": { - "post": { - "operationId": "monit-store-ruleset-delete", - "summary": "删除规则集", - "description": "通过 ID 从规则仓库中删除规则集。", - "tags": [ - "Monitors/规则集" - ], - "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **规则仓库管理**(`monit`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/monitors/rule-sets/monit-store-ruleset-delete", - "metadata": { - "sidebarTitle": "删除规则集" - } }, "responses": { "200": { @@ -15560,7 +14896,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ToolInvokeResponse" } } } @@ -15568,7 +14904,44 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "target": { + "kind": "host", + "locator": "web-01" + }, + "results": [ + { + "tool": "os.overview", + "tool_version": "0.5.0", + "data": { + "data": { + "sample_interval_sec": 3, + "degraded": false, + "degradation_reasons": [] + }, + "summary": "os.overview ...", + "truncated": { + "truncated": false + } + }, + "error": null, + "agent_elapsed_ms": 3120, + "e2e_elapsed_ms": 3188 + }, + { + "tool": "net.tcp_ping", + "tool_version": "0.5.0", + "data": null, + "error": { + "code": "target_unreachable", + "message": "dial tcp 10.0.0.10:3306: i/o timeout" + }, + "agent_elapsed_ms": 0, + "e2e_elapsed_ms": 2008 + } + ], + "error": null + } } } } @@ -15585,35 +14958,22 @@ "500": { "$ref": "#/components/responses/ServerError" } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IDRequest" - }, - "example": { - "id": 1 - } - } - } } } }, - "/rum/application/list": { + "/person/infos": { "post": { - "operationId": "rum-application-read-list", - "summary": "查询应用列表", - "description": "返回当前用户可访问的 RUM 应用分页列表。", + "operationId": "personInfos", + "summary": "批量获取人员信息", + "description": "根据 ID 批量返回成员或账户的资料信息。", "tags": [ - "RUM/应用管理" + "平台/成员管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 使用 `is_my_team` 可过滤当前用户所在团队的应用。\n- 默认每页 20 条,最大 100 条。\n- `orderby` 支持 `created_at` 或 `updated_at`。", - "href": "/zh/api-reference/rum/applications/rum-application-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/platform/members/person-infos", "metadata": { - "sidebarTitle": "查询应用列表" + "sidebarTitle": "批量获取人员信息" } }, "responses": { @@ -15630,7 +14990,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationListResponse" + "$ref": "#/components/schemas/PersonInfosResponse" } } } @@ -15639,65 +14999,29 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "has_next_page": true, - "total": 7, "items": [ { "account_id": 2451002751131, - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "flashcat-rum", - "type": "browser", - "client_token": "a3cea433a8685a398cdfd68f54a45e06131", - "team_id": 2477033058131, - "is_private": true, - "no_ip": true, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": false, - "open_type": "", - "endpoint": "" - }, - "status": "enabled", - "created_by": 4441703362131, - "updated_by": 3790925372131, - "created_at": 1746673831462, - "updated_at": 1773398630657 - }, - { - "account_id": 2451002751131, - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "type": "browser", - "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", - "team_id": 2477033058131, - "is_private": false, - "no_ip": false, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 5962711836131, - 5967875767131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": true, - "open_type": "popup", - "endpoint": "https://www.tracing.com/${trace_id}" - }, - "status": "enabled", - "created_by": 2476444212131, - "updated_by": 3122470302131, - "created_at": 1742958482000, - "updated_at": 1772096392711 + "person_id": 2476444212131, + "person_name": "Alice", + "avatar": "/image/avatar1.png", + "locale": "zh-CN", + "time_zone": "Asia/Shanghai", + "email": "alice@example.com", + "phone_verified": false, + "email_verified": true, + "as": "member", + "status": "enabled" + }, + { + "account_id": 2451002751131, + "person_id": 3790925372131, + "person_name": "Bob", + "email": "bob@example.com", + "phone_verified": false, + "email_verified": true, + "as": "member", + "status": "enabled" } ] } @@ -15723,32 +15047,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationListRequest" + "$ref": "#/components/schemas/PersonInfosRequest" }, "example": { - "p": 1, - "limit": 20, - "query": "", - "is_my_team": false + "person_ids": [ + 2476444212131, + 3790925372131 + ] } } } } } }, - "/rum/application/info": { + "/role/delete": { "post": { - "operationId": "rum-application-read-info", - "summary": "查看应用详情", - "description": "通过 `application_id` 获取单个 RUM 应用的完整信息。", + "operationId": "role-write-delete", + "summary": "删除角色", + "description": "永久删除自定义角色并从所有成员处撤销授权。", "tags": [ - "RUM/应用管理" + "平台/角色与权限" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/rum/applications/rum-application-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **角色管理**(`organization`) |\n\n## 使用说明\n\n- 内置角色无法删除。\n- 持有该角色的所有成员将立即失去其权限。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/platform/roles-permissions/role-write-delete", "metadata": { - "sidebarTitle": "查看应用详情" + "sidebarTitle": "删除角色" } }, "responses": { @@ -15765,7 +15089,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationItem" + "$ref": "#/components/schemas/PlatformEmptyObject" } } } @@ -15773,34 +15097,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "account_id": 2451002751131, - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "flashcat-rum", - "type": "browser", - "client_token": "a3cea433a8685a398cdfd68f54a45e06131", - "team_id": 2477033058131, - "is_private": true, - "no_ip": true, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": false, - "open_type": "", - "endpoint": "" - }, - "status": "enabled", - "created_by": 4441703362131, - "updated_by": 3790925372131, - "created_at": 1746673831462, - "updated_at": 1773398630657 - } + "data": {} } } } @@ -15811,6 +15108,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -15823,29 +15123,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationIDRequest" + "$ref": "#/components/schemas/RoleIDRequest" }, "example": { - "application_id": "WoyQQ3BohkdtPivubEvE8o" + "role_id": 150 } } } } } }, - "/rum/application/infos": { + "/role/disable": { "post": { - "operationId": "rum-application-read-infos", - "summary": "批量查询应用详情", - "description": "通过 ID 列表批量获取多个 RUM 应用的详情。", + "operationId": "role-write-disable", + "summary": "禁用角色", + "description": "禁用自定义角色,使其停止授予权限。", "tags": [ - "RUM/应用管理" + "平台/角色与权限" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 每次请求最多传入 200 个 ID。", - "href": "/zh/api-reference/rum/applications/rum-application-read-infos", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **角色管理**(`organization`) |\n\n## 使用说明\n\n- 持有该角色的成员将立即失去其权限。\n- 只有自定义角色可被禁用。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/platform/roles-permissions/role-write-disable", "metadata": { - "sidebarTitle": "批量查询应用详情" + "sidebarTitle": "禁用角色" } }, "responses": { @@ -15862,7 +15162,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationInfosResponse" + "$ref": "#/components/schemas/PlatformEmptyObject" } } } @@ -15870,67 +15170,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "account_id": 2451002751131, - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "type": "browser", - "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", - "team_id": 2477033058131, - "is_private": false, - "no_ip": false, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 5962711836131, - 5967875767131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": true, - "open_type": "popup", - "endpoint": "https://www.tracing.com/${trace_id}" - }, - "status": "enabled", - "created_by": 2476444212131, - "updated_by": 3122470302131, - "created_at": 1742958482000, - "updated_at": 1772096392711 - }, - { - "account_id": 2451002751131, - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "flashcat-rum", - "type": "browser", - "client_token": "a3cea433a8685a398cdfd68f54a45e06131", - "team_id": 2477033058131, - "is_private": true, - "no_ip": true, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": false, - "open_type": "", - "endpoint": "" - }, - "status": "enabled", - "created_by": 4441703362131, - "updated_by": 3790925372131, - "created_at": 1746673831462, - "updated_at": 1773398630657 - } - ] - } + "data": {} } } } @@ -15941,6 +15181,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -15953,32 +15196,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationInfosRequest" + "$ref": "#/components/schemas/RoleIDRequest" }, "example": { - "application_ids": [ - "eWbr4xk3ZRnLabRa6unqwD", - "WoyQQ3BohkdtPivubEvE8o" - ] + "role_id": 150 } } } } } }, - "/rum/application/create": { + "/role/enable": { "post": { - "operationId": "rum-application-write-create", - "summary": "创建应用", - "description": "创建新的 RUM 应用,返回生成的 `application_id` 和 `client_token`。", + "operationId": "role-write-enable", + "summary": "启用角色", + "description": "重新启用已被禁用的自定义角色。", "tags": [ - "RUM/应用管理" + "平台/角色与权限" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- `type` 须为以下之一:`browser`、`ios`、`android`、`react-native`、`flutter`、`kotlin-multiplatform`、`roku`、`unity`。\n- `client_token` 自动生成,用于初始化 RUM SDK。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/rum/applications/rum-application-write-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **角色管理**(`organization`) |\n\n## 使用说明\n\n- 只有自定义角色可以被启用/禁用,内置角色始终保持启用状态。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/platform/roles-permissions/role-write-enable", "metadata": { - "sidebarTitle": "创建应用" + "sidebarTitle": "启用角色" } }, "responses": { @@ -15995,7 +15235,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationCreateResponse" + "$ref": "#/components/schemas/PlatformEmptyObject" } } } @@ -16003,11 +15243,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "application_id": "qLpu24Dz4CAzWsESPbJYWA", - "application_name": "我的 Web 应用", - "client_token": "e090078724855a4ca168c3884880dfbc131" - } + "data": {} } } } @@ -16018,6 +15254,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -16030,32 +15269,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationCreateRequest" + "$ref": "#/components/schemas/RoleIDRequest" }, "example": { - "application_name": "我的 Web 应用", - "type": "browser", - "team_id": 2477033058131, - "is_private": false + "role_id": 150 } } } } } }, - "/rum/application/update": { + "/role/info": { "post": { - "operationId": "rum-application-write-update", - "summary": "更新应用", - "description": "更新已有 RUM 应用,除 `application_id` 外均为可选,仅更新提供的字段。", + "operationId": "role-read-info", + "summary": "查看角色详情", + "description": "按角色 ID 返回单个角色的详细信息。", "tags": [ - "RUM/应用管理" + "平台/角色与权限" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/rum/applications/rum-application-write-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/platform/roles-permissions/role-read-info", "metadata": { - "sidebarTitle": "更新应用" + "sidebarTitle": "查看角色详情" } }, "responses": { @@ -16072,7 +15308,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/RoleItem" } } } @@ -16080,7 +15316,20 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "role_id": 2, + "role_name": "账户管理员", + "description": "拥有所有权限的账户管理员。", + "status": "enabled", + "permission_ids": [ + 101, + 102, + 201 + ], + "editable": false, + "created_at": 1700000000, + "updated_at": 1700000000 + } } } } @@ -16103,36 +15352,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationUpdateRequest" + "$ref": "#/components/schemas/RoleInfoRequest" }, "example": { - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "我的 Web 应用 v2", - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 - ] - } + "role_id": 2 } } } } } }, - "/rum/application/delete": { + "/role/list": { "post": { - "operationId": "rum-application-write-delete", - "summary": "删除应用", - "description": "通过 `application_id` 删除 RUM 应用。", + "operationId": "role-read-list", + "summary": "查看角色列表", + "description": "返回当前账户下所有自定义及内置角色。", "tags": [ - "RUM/应用管理" + "平台/角色与权限" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/rum/applications/rum-application-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 内置角色(`editable: false`)不可修改或删除。", + "href": "/zh/api-reference/platform/roles-permissions/role-read-list", "metadata": { - "sidebarTitle": "删除应用" + "sidebarTitle": "查看角色列表" } }, "responses": { @@ -16149,7 +15391,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/RoleListResponse" } } } @@ -16157,7 +15399,21 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "total": 3, + "items": [ + { + "role_id": 2, + "role_name": "账户管理员", + "description": "", + "status": "enabled", + "permission_ids": [], + "editable": false, + "created_at": 1700000000, + "updated_at": 1700000000 + } + ] + } } } } @@ -16180,29 +15436,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationIDRequest" + "$ref": "#/components/schemas/RoleListRequest" }, "example": { - "application_id": "qLpu24Dz4CAzWsESPbJYWA" + "orderby": "created_at", + "asc": false } } } } } }, - "/rum/issue/list": { + "/role/member/grant": { "post": { - "operationId": "rum-issue-read-list", - "summary": "查询 Issue 列表", - "description": "返回符合过滤条件的 RUM 异常追踪 Issue 分页列表。", + "operationId": "role-write-grant-role", + "summary": "授予成员账户权限", + "description": "将角色授予一个或多个成员,赋予其该角色包含的权限。", "tags": [ - "RUM/RUM 问题跟踪" + "平台/角色与权限" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `start_time` 和 `end_time` 为毫秒时间戳,最大范围 183 天。\n- `statuses` 按状态过滤,可选值:`for_review`、`reviewed`、`ignored`、`resolved`。\n- `orderby` 支持:`created_at`、`updated_at`、`session_count`、`error_count`。\n- 使用 `dql` 或 `sql` 进行高级过滤,两者不可同时使用。", - "href": "/zh/api-reference/rum/issues/rum-issue-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **角色管理**(`organization`) |\n\n## 使用说明\n\n- 每次最多传入 100 个成员 ID。\n- 已持有该角色的成员会被静默跳过。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/platform/roles-permissions/role-write-grant-role", "metadata": { - "sidebarTitle": "查询 Issue 列表" + "sidebarTitle": "授予成员账户权限" } }, "responses": { @@ -16219,7 +15476,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumIssueListResponse" + "$ref": "#/components/schemas/PlatformEmptyObject" } } } @@ -16227,88 +15484,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "team_id": 2477033058131, - "issue_id": "NHEacQHi2DhXqobr9qPQz9", - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "service": "fd-console", - "status": "for_review", - "error_count": 752, - "session_count": 381, - "is_crash": false, - "age": 5078684, - "resolved_at": 0, - "resolved_by": 0, - "created_at": 1770883154944, - "updated_at": 1775961914595, - "first_seen": { - "timestamp": 1770883154944, - "version": "1.0.0" - }, - "last_seen": { - "timestamp": 1775961839090, - "version": "1.0.0" - }, - "error": { - "message": "Script error.", - "type": "Error" - }, - "suspected_cause": { - "source": "auto", - "value": "code.exception", - "reason": "错误信息 'Script error.' 通常表示 JavaScript 中的未处理异常。", - "person_id": 0 - }, - "versions": [ - "1.0.0" - ], - "severity": "Info" - }, - { - "team_id": 2477033058131, - "issue_id": "H8kZSmxiE7EgdyD4fCyyNa", - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "service": "fd-console", - "status": "for_review", - "error_count": 3, - "session_count": 1, - "is_crash": false, - "age": 48, - "resolved_at": 0, - "resolved_by": 0, - "created_at": 1775189479566, - "updated_at": 1775191284163, - "first_seen": { - "timestamp": 1775189479566, - "version": "1.0.0" - }, - "last_seen": { - "timestamp": 1775189527762, - "version": "1.0.0" - }, - "error": { - "message": "API ERROR: We encountered an internal error | POST /api/access/logout", - "type": "Error" - }, - "suspected_cause": { - "source": "auto", - "value": "api.failed_request", - "reason": "错误信息表明 POST /api/access/logout 请求时服务端发生内部错误。", - "person_id": 0 - }, - "versions": [ - "1.0.0" - ], - "severity": "Info" - } - ], - "has_next_page": true, - "total": 111 - } + "data": {} } } } @@ -16319,6 +15495,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -16331,39 +15510,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumIssueListRequest" + "$ref": "#/components/schemas/RoleGrantRequest" }, "example": { - "start_time": 1772611200000, - "end_time": 1775961914595, - "application_ids": [ - "eWbr4xk3ZRnLabRa6unqwD" - ], - "statuses": [ - "for_review" + "member_ids": [ + 80011, + 80012 ], - "p": 1, - "limit": 20, - "orderby": "updated_at" + "role_id": 150 } } } } } }, - "/rum/issue/info": { + "/role/member/revoke": { "post": { - "operationId": "rum-issue-read-info", - "summary": "查看 Issue 详情", - "description": "通过 `issue_id` 获取单个 Issue 的完整信息。", + "operationId": "role-write-revoke-role", + "summary": "解除成员账户权限", + "description": "从一个或多个成员处撤销角色授权。", "tags": [ - "RUM/RUM 问题跟踪" + "平台/角色与权限" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/rum/issues/rum-issue-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **角色管理**(`organization`) |\n\n## 使用说明\n\n- 未持有该角色的成员会被静默跳过。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/platform/roles-permissions/role-write-revoke-role", "metadata": { - "sidebarTitle": "查看 Issue 详情" + "sidebarTitle": "解除成员账户权限" } }, "responses": { @@ -16380,7 +15553,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumIssueItem" + "$ref": "#/components/schemas/PlatformEmptyObject" } } } @@ -16388,44 +15561,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "team_id": 2477033058131, - "issue_id": "NHEacQHi2DhXqobr9qPQz9", - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "service": "fd-console", - "status": "for_review", - "error_count": 752, - "session_count": 381, - "is_crash": false, - "age": 5078684, - "resolved_at": 0, - "resolved_by": 0, - "created_at": 1770883154944, - "updated_at": 1775961914595, - "first_seen": { - "timestamp": 1770883154944, - "version": "1.0.0" - }, - "last_seen": { - "timestamp": 1775961839090, - "version": "1.0.0" - }, - "error": { - "message": "Script error.", - "type": "Error" - }, - "suspected_cause": { - "source": "auto", - "value": "code.exception", - "reason": "错误信息 'Script error.' 通常表示 JavaScript 中的未处理异常。", - "person_id": 0 - }, - "versions": [ - "1.0.0" - ], - "severity": "Info" - } + "data": {} } } } @@ -16436,6 +15572,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -16448,29 +15587,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumIssueIDRequest" + "$ref": "#/components/schemas/RoleGrantRequest" }, "example": { - "issue_id": "NHEacQHi2DhXqobr9qPQz9" + "member_ids": [ + 80011 + ], + "role_id": 150 } } } } } }, - "/rum/issue/update": { + "/role/permission/factor/list": { "post": { - "operationId": "rum-issue-write-update", - "summary": "更新 Issue", - "description": "更新 Issue 的状态或疑似原因。", + "operationId": "role-read-list-permission-factor", + "summary": "查看权限因子集合", + "description": "返回所有权限因子(API、按钮、菜单、URL、访问),可按类型过滤。", "tags": [ - "RUM/RUM 问题跟踪" + "平台/角色与权限" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `status` 可选值:`for_review`、`reviewed`、`ignored`、`resolved`。\n- `suspected_cause` 可选值:`api.failed_request`、`network.error`、`code.exception`、`code.invalid_object_access`、`code.invalid_argument`、`unknown`。\n- 将 `status` 设为 `resolved` 会同时记录 `resolved_at` 和 `resolved_by`;从 resolved 切回其他状态则会清空这两个字段。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/rum/issues/rum-issue-write-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 权限因子是每个权限的细粒度控制项。\n- `factor_types` 可选值:`api`、`button`、`visit`、`menu`、`url`。", + "href": "/zh/api-reference/platform/roles-permissions/role-read-list-permission-factor", "metadata": { - "sidebarTitle": "更新 Issue" + "sidebarTitle": "查看权限因子集合" } }, "responses": { @@ -16487,7 +15629,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/PermissionFactorListResponse" } } } @@ -16495,7 +15637,12 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": [ + { + "factor_name": "template:read:info", + "factor_type": "api" + } + ] } } } @@ -16518,30 +15665,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumIssueUpdateRequest" + "$ref": "#/components/schemas/PermissionFactorListRequest" }, "example": { - "issue_id": "NHEacQHi2DhXqobr9qPQz9", - "status": "resolved" + "factor_types": [ + "api" + ] } } } } } }, - "/sourcemap/list": { + "/role/permission/list": { "post": { - "operationId": "sourcemap-read-list", - "summary": "查询 Sourcemap 列表", - "description": "分页返回已上传的 Sourcemap 文件列表,可按平台类型、服务和版本过滤。", + "operationId": "role-read-list-permission", + "summary": "查看角色权限集合", + "description": "返回所有可用权限,可按角色 ID 过滤仅返回指定角色已授予的权限。", "tags": [ - "RUM/RUM Sourcemap" + "平台/角色与权限" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `start_time` 和 `end_time` 为必填字段,均使用 Unix 时间戳(**毫秒**),最大时间跨度 365 天。\n- `type` 字段用于选择平台:`browser`(JavaScript)、`android` 或 `ios`。省略时默认为 `browser`。\n- 默认每页 20 条,最大 100 条,默认按 `created_at` 倒序排列。\n- Android 平台可用 `build_id` 匹配 Gradle 插件的构建标识;iOS 平台可用 `uuid` 匹配 dSYM bundle UUID。", - "href": "/zh/api-reference/rum/sourcemaps/sourcemap-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 传入 `role_ids` 可过滤只返回指定角色已授予的权限。\n- 传入 `with_all: true` 可返回全部权限,并在每项中通过 `is_granted` 标记是否已授予。", + "href": "/zh/api-reference/platform/roles-permissions/role-read-list-permission", "metadata": { - "sidebarTitle": "查询 Sourcemap 列表" + "sidebarTitle": "查看角色权限集合" } }, "responses": { @@ -16558,7 +15706,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SourcemapListResponse" + "$ref": "#/components/schemas/RolePermissionListResponse" } } } @@ -16567,19 +15715,16 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 3, "items": [ { - "key": "browser/my-web-app/1.0.0/main.js.map", - "type": "browser", - "service": "my-web-app", - "version": "1.0.0", - "size": 204800, - "git_repository_url": "https://github.com/example/my-web-app", - "git_commit_sha": "abc1234def5678", - "created_at": 1712700000, - "updated_at": 1712700000, - "metadata": {} + "id": 501, + "permission_name": "模板查看", + "permission_type": "read", + "description": "查看通知模板", + "class": "On-call", + "scope": "on-call", + "status": "enabled", + "is_granted": true } ] } @@ -16605,36 +15750,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SourcemapListRequest" + "$ref": "#/components/schemas/RolePermissionListRequest" }, "example": { - "start_time": 1712000000000, - "end_time": 1712700000000, - "type": "browser", - "services": [ - "my-web-app" + "role_ids": [ + 150 ], - "p": 1, - "limit": 20 + "with_all": true } } } } } }, - "/member/info": { + "/role/upsert": { "post": { - "operationId": "memberInfo", - "summary": "获取当前成员信息", - "description": "返回当前会话成员的完整资料。", + "operationId": "role-write-upsert", + "summary": "创建或更新角色", + "description": "创建新的自定义角色或更新已有角色,更新时传入 `role_id`。", "tags": [ - "平台/成员管理" + "平台/角色与权限" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/platform/members/member-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **角色管理**(`organization`) |\n\n## 使用说明\n\n- 省略 `role_id`(或置为 0)表示创建;传入已有 ID 表示更新。\n- `role_name` 须为 1–39 个字符且在账户内唯一。\n- `permission_ids` 会完整替换角色的权限集合。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/platform/roles-permissions/role-write-upsert", "metadata": { - "sidebarTitle": "获取当前成员信息" + "sidebarTitle": "创建或更新角色" } }, "responses": { @@ -16651,7 +15792,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberInfoResponse" + "$ref": "#/components/schemas/RoleUpsertResponse" } } } @@ -16660,28 +15801,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "account_avatar": "", - "account_email": "alice@example.com", - "account_id": 2451002751131, - "account_locale": "en-US", - "account_name": "Acme Corp", - "account_role_ids": [ - 6 - ], - "account_time_zone": "Asia/Shanghai", - "avatar": "/image/avatar1.png", - "country_code": "CN", - "created_at": 1701399971, - "domain": "acme", - "email": "alice@example.com", - "email_verified": true, - "is_external": false, - "locale": "zh-CN", - "member_id": 2476444212131, - "member_name": "Alice", - "phone": "+86185****0300", - "phone_verified": true, - "time_zone": "Asia/Shanghai" + "role_id": 150, + "role_name": "值班管理员" } } } @@ -16693,6 +15814,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -16705,27 +15829,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberInfoRequest" + "$ref": "#/components/schemas/RoleUpsertRequest" }, - "example": {} + "example": { + "role_name": "值班管理员", + "description": "管理值班排班和故障处理。", + "permission_ids": [ + 501, + 502 + ] + } } } } } }, - "/member/list": { + "/route/info": { "post": { - "operationId": "memberList", - "summary": "查询成员列表", - "description": "返回组织成员的分页列表。", + "operationId": "routeInfo", + "summary": "获取路由规则详情", + "description": "获取指定集成的路由规则配置。当集成尚未配置路由规则时返回 null。", "tags": [ - "平台/成员管理" + "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/platform/members/member-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/route-info", "metadata": { - "sidebarTitle": "查询成员列表" + "sidebarTitle": "获取路由规则详情" } }, "responses": { @@ -16742,7 +15873,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberListResponse" + "$ref": "#/components/schemas/RouteItem" } } } @@ -16751,50 +15882,51 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "p": 1, - "limit": 5, - "total": 148, - "items": [ + "integration_id": 6113996590131, + "cases": [ { - "account_id": 2451002751131, - "member_id": 5068740052131, - "member_name": "Bob", - "country_code": "", - "phone": "+86151****6519", - "email": "bob@example.com", - "phone_verified": true, - "email_verified": true, - "avatar": "", - "status": "enabled", - "account_role_ids": [ - 2, - 6 + "if": [ + { + "key": "labels.check", + "oper": "IN", + "vals": [ + "cpu.idle<20%" + ] + } ], - "created_at": 1752030749, - "updated_at": 1775962064, - "ref_id": "", - "is_external": false + "channel_ids": [ + 2533748993131 + ], + "fallthrough": false, + "routing_mode": "standard" }, { - "account_id": 2451002751131, - "member_id": 2476444212131, - "member_name": "Alice", - "country_code": "CN", - "phone": "+86185****0300", - "email": "alice@example.com", - "phone_verified": true, - "email_verified": true, - "avatar": "/image/avatar1.png", - "status": "enabled", - "account_role_ids": [ - 6 + "if": [ + { + "key": "severity", + "oper": "IN", + "vals": [ + "Warning" + ] + } ], - "created_at": 1701399971, - "updated_at": 1775809507, - "ref_id": "", - "is_external": false + "channel_ids": null, + "fallthrough": false, + "routing_mode": "name_mapping", + "name_mapping_label": "labels.service" } - ] + ], + "default": { + "channel_ids": [ + 3521074710131 + ] + }, + "status": "enabled", + "version": 6, + "updated_by": 3790925372131, + "creator_id": 3790925372131, + "created_at": 1774606136, + "updated_at": 1774606136 } } } @@ -16818,30 +15950,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberListRequest" + "$ref": "#/components/schemas/RouteInfoRequest" }, "example": { - "p": 1, - "limit": 5 + "integration_id": 6113996590131 } } } } } }, - "/member/delete": { + "/route/list": { "post": { - "operationId": "memberDelete", - "summary": "删除成员", - "description": "通过 ID、邮箱、手机号或名称从组织中移除成员。", + "operationId": "routeList", + "summary": "查询路由规则列表", + "description": "返回指定集成的路由规则列表。未配置路由规则的集成将不出现在响应中。", "tags": [ - "平台/成员管理" + "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **成员管理**(`organization`) |\n\n## 使用说明\n\n- 默认情况下(`is_force=false`),系统会检查该成员是否被其他资源引用(如分派策略、值班表等)。如果存在引用,接口将返回错误码 `ReferenceExist` 并在 `data.refs` 中返回引用列表。设置 `is_force=true` 可跳过引用检查,直接强制删除。\n- 通过 SSO 同步且 SSO 配置了成员不可编辑(`sso_user_non_editable=true`)的成员,无法通过此接口删除。需要先在 SSO 配置中关闭该限制。\n- 此操作会记录审计日志。", - "href": "/zh/api-reference/platform/members/member-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) 或 **集成中心管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/route-list", "metadata": { - "sidebarTitle": "删除成员" + "sidebarTitle": "查询路由规则列表" } }, "responses": { @@ -16858,7 +15989,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberEmptyObject" + "$ref": "#/components/schemas/ListRoutesResponse" } } } @@ -16866,7 +15997,42 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "integration_id": 6113996590131, + "cases": [ + { + "if": [ + { + "key": "labels.check", + "oper": "IN", + "vals": [ + "cpu.idle<20%" + ] + } + ], + "channel_ids": [ + 2533748993131 + ], + "fallthrough": false, + "routing_mode": "standard" + } + ], + "default": { + "channel_ids": [ + 3521074710131 + ] + }, + "status": "enabled", + "version": 6, + "updated_by": 3790925372131, + "creator_id": 3790925372131, + "created_at": 1774606136, + "updated_at": 1774606136 + } + ] + } } } } @@ -16889,29 +16055,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberDeleteRequest" + "$ref": "#/components/schemas/ListRoutesRequest" }, "example": { - "member_id": 5068740052131 + "integration_ids": [ + 6113996590131, + 6113996590132 + ] } } } } } }, - "/member/invite": { + "/route/upsert": { "post": { - "operationId": "memberInvite", - "summary": "邀请成员", - "description": "通过邮箱或手机号批量邀请新成员加入组织。", + "operationId": "routeUpsert", + "summary": "创建或更新路由规则", + "description": "创建或更新集成的路由规则,将告警导向特定协作空间。`cases` 与 `default` 至少需要提供其一。", "tags": [ - "平台/成员管理" + "On-call/协作空间" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **成员管理**(`organization`) |", - "href": "/zh/api-reference/platform/members/member-invite", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/channels/route-upsert", "metadata": { - "sidebarTitle": "邀请成员" + "sidebarTitle": "创建或更新路由规则" } }, "responses": { @@ -16928,7 +16097,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberInviteResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -16936,14 +16105,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "member_id": 5068740052131, - "member_name": "Charlie" - } - ] - } + "data": {} } } } @@ -16966,39 +16128,52 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberInviteRequest" + "$ref": "#/components/schemas/UpsertRouteRequest" }, "example": { - "members": [ + "integration_id": 6113996590131, + "cases": [ { - "member_name": "Charlie", - "email": "charlie@example.com", - "locale": "en-US", - "time_zone": "Asia/Shanghai", - "role_ids": [ - 6 - ] + "if": [ + { + "key": "severity", + "oper": "IN", + "vals": [ + "Critical" + ] + } + ], + "channel_ids": [ + 3521074710131 + ], + "fallthrough": false, + "routing_mode": "standard" } - ] + ], + "default": { + "channel_ids": [ + 3521074710131 + ] + } } } } } } }, - "/member/role/grant": { + "/rum/application/create": { "post": { - "operationId": "memberGrantRole", - "summary": "授予成员角色", - "description": "为成员添加角色授权。", + "operationId": "rum-application-write-create", + "summary": "创建应用", + "description": "创建新的 RUM 应用,返回生成的 `application_id` 和 `client_token`。", "tags": [ - "平台/成员管理" + "RUM/应用管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **成员管理**(`organization`) |", - "href": "/zh/api-reference/platform/members/member-grant-role", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- `type` 须为以下之一:`browser`、`ios`、`android`、`react-native`、`flutter`、`kotlin-multiplatform`、`roku`、`unity`。\n- `client_token` 自动生成,用于初始化 RUM SDK。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/rum/applications/rum-application-write-create", "metadata": { - "sidebarTitle": "授予成员角色" + "sidebarTitle": "创建应用" } }, "responses": { @@ -17015,7 +16190,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberEmptyObject" + "$ref": "#/components/schemas/RumApplicationCreateResponse" } } } @@ -17023,7 +16198,11 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "application_id": "qLpu24Dz4CAzWsESPbJYWA", + "application_name": "我的 Web 应用", + "client_token": "e090078724855a4ca168c3884880dfbc131" + } } } } @@ -17046,32 +16225,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberRoleGrantRequest" + "$ref": "#/components/schemas/RumApplicationCreateRequest" }, "example": { - "member_id": 5068740052131, - "role_ids": [ - 6 - ] + "application_name": "我的 Web 应用", + "type": "browser", + "team_id": 2477033058131, + "is_private": false } } } } } }, - "/member/role/revoke": { + "/rum/application/delete": { "post": { - "operationId": "memberRevokeRole", - "summary": "解除成员角色", - "description": "移除成员的角色授权。", + "operationId": "rum-application-write-delete", + "summary": "删除应用", + "description": "通过 `application_id` 删除 RUM 应用。", "tags": [ - "平台/成员管理" + "RUM/应用管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **成员管理**(`organization`) |", - "href": "/zh/api-reference/platform/members/member-revoke-role", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/rum/applications/rum-application-write-delete", "metadata": { - "sidebarTitle": "解除成员角色" + "sidebarTitle": "删除应用" } }, "responses": { @@ -17088,7 +16267,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberEmptyObject" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -17119,32 +16298,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberRoleRevokeRequest" + "$ref": "#/components/schemas/RumApplicationIDRequest" }, "example": { - "member_id": 5068740052131, - "role_ids": [ - 6 - ] + "application_id": "qLpu24Dz4CAzWsESPbJYWA" } } } } } }, - "/member/role/update": { + "/rum/application/info": { "post": { - "operationId": "memberUpdateRole", - "summary": "更新成员角色", - "description": "一次性替换成员的全部角色授权。", + "operationId": "rum-application-read-info", + "summary": "查看应用详情", + "description": "通过 `application_id` 获取单个 RUM 应用的完整信息。", "tags": [ - "平台/成员管理" + "RUM/应用管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **成员管理**(`organization`) |", - "href": "/zh/api-reference/platform/members/member-update-role", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/rum/applications/rum-application-read-info", "metadata": { - "sidebarTitle": "更新成员角色" + "sidebarTitle": "查看应用详情" } }, "responses": { @@ -17161,7 +16337,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberEmptyObject" + "$ref": "#/components/schemas/RumApplicationItem" } } } @@ -17169,7 +16345,34 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "account_id": 2451002751131, + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "flashcat-rum", + "type": "browser", + "client_token": "a3cea433a8685a398cdfd68f54a45e06131", + "team_id": 2477033058131, + "is_private": true, + "no_ip": true, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": false, + "open_type": "", + "endpoint": "" + }, + "status": "enabled", + "created_by": 4441703362131, + "updated_by": 3790925372131, + "created_at": 1746673831462, + "updated_at": 1773398630657 + } } } } @@ -17192,33 +16395,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MemberRoleUpdateRequest" + "$ref": "#/components/schemas/RumApplicationIDRequest" }, "example": { - "member_id": 5068740052131, - "role_ids": [ - 2, - 6 - ] + "application_id": "WoyQQ3BohkdtPivubEvE8o" } } } } } }, - "/member/info/reset": { + "/rum/application/infos": { "post": { - "operationId": "memberResetInfo", - "summary": "重置成员信息", - "description": "批量更新当前成员的多个资料字段。", + "operationId": "rum-application-read-infos", + "summary": "批量查询应用详情", + "description": "通过 ID 列表批量获取多个 RUM 应用的详情。", "tags": [ - "平台/成员管理" + "RUM/应用管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/platform/members/member-reset-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 每次请求最多传入 200 个 ID。", + "href": "/zh/api-reference/rum/applications/rum-application-read-infos", "metadata": { - "sidebarTitle": "重置成员信息" + "sidebarTitle": "批量查询应用详情" } }, "responses": { @@ -17235,7 +16434,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MemberEmptyObject" + "$ref": "#/components/schemas/RumApplicationInfosResponse" } } } @@ -17243,55 +16442,115 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemberResetInfoRequest" - }, - "example": { - "member_id": 2476444212131, - "member_name": "Alice", - "locale": "zh-CN", - "time_zone": "Asia/Shanghai" + "data": { + "items": [ + { + "account_id": 2451002751131, + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "type": "browser", + "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", + "team_id": 2477033058131, + "is_private": false, + "no_ip": false, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 5962711836131, + 5967875767131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": true, + "open_type": "popup", + "endpoint": "https://www.tracing.com/${trace_id}" + }, + "status": "enabled", + "created_by": 2476444212131, + "updated_by": 3122470302131, + "created_at": 1742958482000, + "updated_at": 1772096392711 + }, + { + "account_id": 2451002751131, + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "flashcat-rum", + "type": "browser", + "client_token": "a3cea433a8685a398cdfd68f54a45e06131", + "team_id": 2477033058131, + "is_private": true, + "no_ip": true, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": false, + "open_type": "", + "endpoint": "" + }, + "status": "enabled", + "created_by": 4441703362131, + "updated_by": 3790925372131, + "created_at": 1746673831462, + "updated_at": 1773398630657 + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RumApplicationInfosRequest" + }, + "example": { + "application_ids": [ + "eWbr4xk3ZRnLabRa6unqwD", + "WoyQQ3BohkdtPivubEvE8o" + ] } } } } } }, - "/person/infos": { + "/rum/application/list": { "post": { - "operationId": "personInfos", - "summary": "批量获取人员信息", - "description": "根据 ID 批量返回成员或账户的资料信息。", + "operationId": "rum-application-read-list", + "summary": "查询应用列表", + "description": "返回当前用户可访问的 RUM 应用分页列表。", "tags": [ - "平台/成员管理" + "RUM/应用管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/platform/members/person-infos", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 使用 `is_my_team` 可过滤当前用户所在团队的应用。\n- 默认每页 20 条,最大 100 条。\n- `orderby` 支持 `created_at` 或 `updated_at`。", + "href": "/zh/api-reference/rum/applications/rum-application-read-list", "metadata": { - "sidebarTitle": "批量获取人员信息" + "sidebarTitle": "查询应用列表" } }, "responses": { @@ -17308,7 +16567,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PersonInfosResponse" + "$ref": "#/components/schemas/RumApplicationListResponse" } } } @@ -17317,29 +16576,65 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "has_next_page": true, + "total": 7, "items": [ { "account_id": 2451002751131, - "person_id": 2476444212131, - "person_name": "Alice", - "avatar": "/image/avatar1.png", - "locale": "zh-CN", - "time_zone": "Asia/Shanghai", - "email": "alice@example.com", - "phone_verified": false, - "email_verified": true, - "as": "member", - "status": "enabled" + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "flashcat-rum", + "type": "browser", + "client_token": "a3cea433a8685a398cdfd68f54a45e06131", + "team_id": 2477033058131, + "is_private": true, + "no_ip": true, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": false, + "open_type": "", + "endpoint": "" + }, + "status": "enabled", + "created_by": 4441703362131, + "updated_by": 3790925372131, + "created_at": 1746673831462, + "updated_at": 1773398630657 }, { "account_id": 2451002751131, - "person_id": 3790925372131, - "person_name": "Bob", - "email": "bob@example.com", - "phone_verified": false, - "email_verified": true, - "as": "member", - "status": "enabled" + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "type": "browser", + "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", + "team_id": 2477033058131, + "is_private": false, + "no_ip": false, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 5962711836131, + 5967875767131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": true, + "open_type": "popup", + "endpoint": "https://www.tracing.com/${trace_id}" + }, + "status": "enabled", + "created_by": 2476444212131, + "updated_by": 3122470302131, + "created_at": 1742958482000, + "updated_at": 1772096392711 } ] } @@ -17365,32 +16660,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PersonInfosRequest" + "$ref": "#/components/schemas/RumApplicationListRequest" }, "example": { - "person_ids": [ - 2476444212131, - 3790925372131 - ] + "p": 1, + "limit": 20, + "query": "", + "is_my_team": false } } } } } }, - "/team/info": { + "/rum/application/update": { "post": { - "operationId": "team-read-info", - "summary": "查看团队详情", - "description": "按 ID、名称或外部引用 ID 返回单个团队的详细信息。", + "operationId": "rum-application-write-update", + "summary": "更新应用", + "description": "更新已有 RUM 应用,除 `application_id` 外均为可选,仅更新提供的字段。", "tags": [ - "平台/团队管理" + "RUM/应用管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `team_id`、`team_name`、`ref_id` 三者至少提供一个。", - "href": "/zh/api-reference/platform/teams/team-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/rum/applications/rum-application-write-update", "metadata": { - "sidebarTitle": "查看团队详情" + "sidebarTitle": "更新应用" } }, "responses": { @@ -17407,7 +16702,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TeamItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -17415,24 +16710,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "account_id": 10023, - "team_id": 1001, - "team_name": "后端 SRE", - "description": "后端可靠性工程团队", - "status": "enabled", - "updated_by_name": "alice", - "updated_by": 80011, - "creator_id": 80011, - "creator_name": "alice", - "created_at": 1710000000, - "updated_at": 1712000000, - "person_ids": [ - 80011, - 80012 - ], - "ref_id": "" - } + "data": {} } } } @@ -17455,29 +16733,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TeamInfoRequest" + "$ref": "#/components/schemas/RumApplicationUpdateRequest" }, "example": { - "team_id": 1001 + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "我的 Web 应用 v2", + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 + ] + } } } } } } }, - "/team/infos": { + "/rum/application/webhook/test": { "post": { - "operationId": "team-read-infos", - "summary": "批量查看团队信息", - "description": "一次请求按 ID 列表批量返回多个团队的基本信息。", + "operationId": "rum-application-webhook-test", + "summary": "测试应用 Webhook", + "description": "发送一条 RUM 告警样例事件,用于验证应用的 Webhook URL。", "tags": [ - "平台/团队管理" + "RUM/应用管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 每次最多传入 100 个团队 ID。", - "href": "/zh/api-reference/platform/teams/team-read-infos", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- 接口会先校验 URL,再发送样例事件。\n- 投递失败时仍返回 HTTP 200,但 `ok=false`,错误原因在 `message` 中。", + "href": "/zh/api-reference/rum/applications/rum-application-webhook-test", "metadata": { - "sidebarTitle": "批量查看团队信息" + "sidebarTitle": "测试应用 Webhook" } }, "responses": { @@ -17494,7 +16779,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TeamInfosResponse" + "$ref": "#/components/schemas/RumWebhookTestResponse" } } } @@ -17503,23 +16788,9 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ - { - "team_id": 1001, - "team_name": "后端 SRE", - "person_ids": [ - 80011, - 80012 - ] - }, - { - "team_id": 1002, - "team_name": "前端", - "person_ids": [ - 80013 - ] - } - ] + "ok": true, + "status_code": 200, + "message": "ok" } } } @@ -17543,32 +16814,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TeamInfosRequest" + "$ref": "#/components/schemas/RumWebhookTestRequest" }, "example": { - "team_ids": [ - 1001, - 1002 - ] + "application_id": "rum-app-prod", + "webhook_url": "https://hooks.example.com/rum-alerts" } } } } } }, - "/team/list": { + "/rum/issue/info": { "post": { - "operationId": "team-read-list", - "summary": "查看团队列表", - "description": "分页返回当前账户下的团队列表。", + "operationId": "rum-issue-read-info", + "summary": "查看 Issue 详情", + "description": "通过 `issue_id` 获取单个 Issue 的完整信息。", "tags": [ - "平台/团队管理" + "RUM/RUM 问题跟踪" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 传入 `person_id` 可过滤返回指定人员所属的团队。\n- 默认 p=1、limit=20。", - "href": "/zh/api-reference/platform/teams/team-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/rum/issues/rum-issue-read-info", "metadata": { - "sidebarTitle": "查看团队列表" + "sidebarTitle": "查看 Issue 详情" } }, "responses": { @@ -17585,7 +16854,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TeamListResponse" + "$ref": "#/components/schemas/RumIssueItem" } } } @@ -17594,28 +16863,42 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "p": 1, - "limit": 20, - "total": 5, - "items": [ - { - "account_id": 10023, - "team_id": 1001, - "team_name": "后端 SRE", - "status": "enabled", - "creator_id": 80011, - "created_at": 1710000000, - "updated_at": 1712000000, - "person_ids": [ - 80011 - ], - "description": "", - "updated_by_name": "", - "updated_by": 0, - "creator_name": "alice", - "ref_id": "" - } - ] + "team_id": 2477033058131, + "issue_id": "NHEacQHi2DhXqobr9qPQz9", + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "service": "fd-console", + "status": "for_review", + "error_count": 752, + "session_count": 381, + "is_crash": false, + "age": 5078684, + "resolved_at": 0, + "resolved_by": 0, + "created_at": 1770883154944, + "updated_at": 1775961914595, + "first_seen": { + "timestamp": 1770883154944, + "version": "1.0.0" + }, + "last_seen": { + "timestamp": 1775961839090, + "version": "1.0.0" + }, + "error": { + "message": "Script error.", + "type": "Error" + }, + "suspected_cause": { + "source": "auto", + "value": "code.exception", + "reason": "错误信息 'Script error.' 通常表示 JavaScript 中的未处理异常。", + "person_id": 0 + }, + "versions": [ + "1.0.0" + ], + "severity": "Info" } } } @@ -17639,32 +16922,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TeamListRequest" + "$ref": "#/components/schemas/RumIssueIDRequest" }, "example": { - "p": 1, - "limit": 20, - "orderby": "created_at", - "asc": false + "issue_id": "NHEacQHi2DhXqobr9qPQz9" } } } } } }, - "/team/upsert": { + "/rum/issue/list": { "post": { - "operationId": "team-write-upsert", - "summary": "变更团队信息", - "description": "创建新团队或更新已有团队,更新时传入 `team_id`。", + "operationId": "rum-issue-read-list", + "summary": "查询 Issue 列表", + "description": "返回符合过滤条件的 RUM 异常追踪 Issue 分页列表。", "tags": [ - "平台/团队管理" + "RUM/RUM 问题跟踪" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **团队管理**(`organization`) |\n\n## 使用说明\n\n- 省略 `team_id`(或置为 0)表示创建新团队;传入已有 ID 表示更新。\n- `team_name` 须为 1–39 个字符且在账户内唯一。\n- 传入 `person_ids` 可设置团队成员,会替换整个成员列表。\n- 传入 `emails` 或 `phones` 可邀请尚未注册的成员。\n- `ref_id` 是供第三方 HR 系统集成使用的外部标识。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/platform/teams/team-write-upsert", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `start_time` 和 `end_time` 为毫秒时间戳,最大范围 183 天。\n- `statuses` 按状态过滤,可选值:`for_review`、`reviewed`、`ignored`、`resolved`。\n- `orderby` 支持:`created_at`、`updated_at`、`session_count`、`error_count`。\n- 使用 `dql` 或 `sql` 进行高级过滤,两者不可同时使用。", + "href": "/zh/api-reference/rum/issues/rum-issue-read-list", "metadata": { - "sidebarTitle": "变更团队信息" + "sidebarTitle": "查询 Issue 列表" } }, "responses": { @@ -17681,7 +16961,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TeamUpsertResponse" + "$ref": "#/components/schemas/RumIssueListResponse" } } } @@ -17690,8 +16970,86 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "team_id": 1001, - "team_name": "后端 SRE" + "items": [ + { + "team_id": 2477033058131, + "issue_id": "NHEacQHi2DhXqobr9qPQz9", + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "service": "fd-console", + "status": "for_review", + "error_count": 752, + "session_count": 381, + "is_crash": false, + "age": 5078684, + "resolved_at": 0, + "resolved_by": 0, + "created_at": 1770883154944, + "updated_at": 1775961914595, + "first_seen": { + "timestamp": 1770883154944, + "version": "1.0.0" + }, + "last_seen": { + "timestamp": 1775961839090, + "version": "1.0.0" + }, + "error": { + "message": "Script error.", + "type": "Error" + }, + "suspected_cause": { + "source": "auto", + "value": "code.exception", + "reason": "错误信息 'Script error.' 通常表示 JavaScript 中的未处理异常。", + "person_id": 0 + }, + "versions": [ + "1.0.0" + ], + "severity": "Info" + }, + { + "team_id": 2477033058131, + "issue_id": "H8kZSmxiE7EgdyD4fCyyNa", + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "service": "fd-console", + "status": "for_review", + "error_count": 3, + "session_count": 1, + "is_crash": false, + "age": 48, + "resolved_at": 0, + "resolved_by": 0, + "created_at": 1775189479566, + "updated_at": 1775191284163, + "first_seen": { + "timestamp": 1775189479566, + "version": "1.0.0" + }, + "last_seen": { + "timestamp": 1775189527762, + "version": "1.0.0" + }, + "error": { + "message": "API ERROR: We encountered an internal error | POST /api/access/logout", + "type": "Error" + }, + "suspected_cause": { + "source": "auto", + "value": "api.failed_request", + "reason": "错误信息表明 POST /api/access/logout 请求时服务端发生内部错误。", + "person_id": 0 + }, + "versions": [ + "1.0.0" + ], + "severity": "Info" + } + ], + "has_next_page": true, + "total": 111 } } } @@ -17703,9 +17061,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -17718,34 +17073,39 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TeamUpsertRequest" + "$ref": "#/components/schemas/RumIssueListRequest" }, "example": { - "team_name": "后端 SRE", - "description": "后端可靠性工程团队", - "person_ids": [ - 80011, - 80012 - ] + "start_time": 1772611200000, + "end_time": 1775961914595, + "application_ids": [ + "eWbr4xk3ZRnLabRa6unqwD" + ], + "statuses": [ + "for_review" + ], + "p": 1, + "limit": 20, + "orderby": "updated_at" } } } } } }, - "/team/delete": { + "/rum/issue/update": { "post": { - "operationId": "team-write-delete", - "summary": "删除团队", - "description": "按 ID、名称或外部引用 ID 永久删除一个团队。", + "operationId": "rum-issue-write-update", + "summary": "更新 Issue", + "description": "更新 Issue 的状态或疑似原因。", "tags": [ - "平台/团队管理" + "RUM/RUM 问题跟踪" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **团队管理**(`organization`) |\n\n## 使用说明\n\n- `team_id`、`team_name`、`ref_id` 三者至少提供一个。\n- 若团队仍被排班、分派策略等资源引用,会返回 `400 ReferenceExist`。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/platform/teams/team-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `status` 可选值:`for_review`、`reviewed`、`ignored`、`resolved`。\n- `suspected_cause` 可选值:`api.failed_request`、`network.error`、`code.exception`、`code.invalid_object_access`、`code.invalid_argument`、`unknown`。\n- 将 `status` 设为 `resolved` 会同时记录 `resolved_at` 和 `resolved_by`;从 resolved 切回其他状态则会清空这两个字段。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/rum/issues/rum-issue-write-update", "metadata": { - "sidebarTitle": "删除团队" + "sidebarTitle": "更新 Issue" } }, "responses": { @@ -17762,7 +17122,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PlatformEmptyObject" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -17781,9 +17141,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -17796,46 +17153,52 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TeamDeleteRequest" + "$ref": "#/components/schemas/RumIssueUpdateRequest" }, "example": { - "team_id": 1001 + "issue_id": "NHEacQHi2DhXqobr9qPQz9", + "status": "resolved" } } } } } }, - "/role/info": { + "/safari/a2a-agent/create": { "post": { - "operationId": "role-read-info", - "summary": "查看角色详情", - "description": "按角色 ID 返回单个角色的详细信息。", + "operationId": "remote-agent-write-create", + "summary": "创建 A2A 智能体", + "description": "通过智能体卡片 URL 注册新的 A2A 远程智能体。", "tags": [ - "平台/角色与权限" + "AI SRE/A2A 智能体" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/platform/roles-permissions/role-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- `card_url` 必须可解析为有效的智能体卡片;无法访问或无效的卡片返回 InvalidParameter。\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-create", "metadata": { - "sidebarTitle": "查看角色详情" + "sidebarTitle": "创建 A2A 智能体" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RoleItem" + "$ref": "#/components/schemas/A2AAgentCreateResponse" } } } @@ -17844,18 +17207,7 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "role_id": 2, - "role_name": "账户管理员", - "description": "拥有所有权限的账户管理员。", - "status": "enabled", - "permission_ids": [ - 101, - 102, - 201 - ], - "editable": false, - "created_at": 1700000000, - "updated_at": 1700000000 + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } @@ -17867,6 +17219,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -17879,46 +17234,57 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleInfoRequest" + "$ref": "#/components/schemas/A2AAgentCreateRequest" }, "example": { - "role_id": 2 + "agent_name": "deploy-bot", + "instructions": "当需要检查部署流水线或给出回滚建议时使用。", + "card_url": "https://agents.example.com/deploy-bot/card", + "auth_type": "bearer", + "streaming": true, + "team_id": 0 } } } } } }, - "/role/list": { + "/safari/a2a-agent/delete": { "post": { - "operationId": "role-read-list", - "summary": "查看角色列表", - "description": "返回当前账户下所有自定义及内置角色。", + "operationId": "remote-agent-write-delete", + "summary": "删除 A2A 智能体", + "description": "按 ID 软删除 A2A 智能体。", "tags": [ - "平台/角色与权限" + "AI SRE/A2A 智能体" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 内置角色(`editable: false`)不可修改或删除。", - "href": "/zh/api-reference/platform/roles-permissions/role-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-delete", "metadata": { - "sidebarTitle": "查看角色列表" + "sidebarTitle": "删除 A2A 智能体" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RoleListResponse" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -17926,21 +17292,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 3, - "items": [ - { - "role_id": 2, - "role_name": "账户管理员", - "description": "", - "status": "enabled", - "permission_ids": [], - "editable": false, - "created_at": 1700000000, - "updated_at": 1700000000 - } - ] - } + "data": null } } } @@ -17951,6 +17303,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -17963,47 +17318,52 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleListRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "orderby": "created_at", - "asc": false + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/role/upsert": { + "/safari/a2a-agent/disable": { "post": { - "operationId": "role-write-upsert", - "summary": "创建或更新角色", - "description": "创建新的自定义角色或更新已有角色,更新时传入 `role_id`。", + "operationId": "remote-agent-write-disable", + "summary": "禁用 A2A 智能体", + "description": "禁用已启用的 A2A 智能体。", "tags": [ - "平台/角色与权限" + "AI SRE/A2A 智能体" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **角色管理**(`organization`) |\n\n## 使用说明\n\n- 省略 `role_id`(或置为 0)表示创建;传入已有 ID 表示更新。\n- `role_name` 须为 1–39 个字符且在账户内唯一。\n- `permission_ids` 会完整替换角色的权限集合。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/platform/roles-permissions/role-write-upsert", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-disable", "metadata": { - "sidebarTitle": "创建或更新角色" + "sidebarTitle": "禁用 A2A 智能体" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RoleUpsertResponse" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -18011,10 +17371,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "role_id": 150, - "role_name": "值班管理员" - } + "data": null } } } @@ -18040,51 +17397,52 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleUpsertRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "role_name": "值班管理员", - "description": "管理值班排班和故障处理。", - "permission_ids": [ - 501, - 502 - ] + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/role/enable": { + "/safari/a2a-agent/enable": { "post": { - "operationId": "role-write-enable", - "summary": "启用角色", - "description": "重新启用已被禁用的自定义角色。", + "operationId": "remote-agent-write-enable", + "summary": "启用 A2A 智能体", + "description": "启用已禁用的 A2A 智能体。", "tags": [ - "平台/角色与权限" + "AI SRE/A2A 智能体" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **角色管理**(`organization`) |\n\n## 使用说明\n\n- 只有自定义角色可以被启用/禁用,内置角色始终保持启用状态。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/platform/roles-permissions/role-write-enable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-enable", "metadata": { - "sidebarTitle": "启用角色" + "sidebarTitle": "启用 A2A 智能体" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PlatformEmptyObject" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -18092,7 +17450,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": null } } } @@ -18118,46 +17476,51 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleIDRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "role_id": 150 + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/role/disable": { + "/safari/a2a-agent/get": { "post": { - "operationId": "role-write-disable", - "summary": "禁用角色", - "description": "禁用自定义角色,使其停止授予权限。", + "operationId": "remote-agent-read-get", + "summary": "查看 A2A 智能体详情", + "description": "按 ID 查看单个 A2A 智能体。", "tags": [ - "平台/角色与权限" + "AI SRE/A2A 智能体" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **角色管理**(`organization`) |\n\n## 使用说明\n\n- 持有该角色的成员将立即失去其权限。\n- 只有自定义角色可被禁用。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/platform/roles-permissions/role-write-disable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", + "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-read-get", "metadata": { - "sidebarTitle": "禁用角色" + "sidebarTitle": "查看 A2A 智能体详情" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PlatformEmptyObject" + "$ref": "#/components/schemas/A2AAgentItem" } } } @@ -18165,7 +17528,29 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "agent_name": "deploy-bot", + "card_url": "https://agents.example.com/deploy-bot/card", + "auth_type": "bearer", + "streaming": true, + "status": "enabled", + "agent_card_name": "Deploy Bot", + "agent_card_skills": [ + "rollback", + "diff" + ], + "card_resolve_timeout": 10, + "task_timeout": 120, + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "instructions": "Remote agent that inspects deployment pipelines." + } } } } @@ -18176,9 +17561,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -18191,46 +17573,51 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleIDRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "role_id": 150 + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/role/delete": { + "/safari/a2a-agent/list": { "post": { - "operationId": "role-write-delete", - "summary": "删除角色", - "description": "永久删除自定义角色并从所有成员处撤销授权。", + "operationId": "remote-agent-read-list", + "summary": "查询 A2A 智能体列表", + "description": "分页查询调用者在账户与团队范围内可见的 A2A 智能体。", "tags": [ - "平台/角色与权限" + "AI SRE/A2A 智能体" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **角色管理**(`organization`) |\n\n## 使用说明\n\n- 内置角色无法删除。\n- 持有该角色的所有成员将立即失去其权限。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/platform/roles-permissions/role-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 分页使用 `offset`/`limit`(而非 `p`/`limit`)。\n", + "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-read-list", "metadata": { - "sidebarTitle": "删除角色" + "sidebarTitle": "查询 A2A 智能体列表" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PlatformEmptyObject" + "$ref": "#/components/schemas/A2AAgentListResponse" } } } @@ -18238,7 +17625,34 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "agent_name": "deploy-bot", + "card_url": "https://agents.example.com/deploy-bot/card", + "auth_type": "bearer", + "streaming": true, + "status": "enabled", + "agent_card_name": "Deploy Bot", + "agent_card_skills": [ + "rollback", + "diff" + ], + "card_resolve_timeout": 10, + "task_timeout": 120, + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "instructions": "Remote agent that inspects deployment pipelines." + } + ], + "total": 1 + } } } } @@ -18249,9 +17663,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -18264,46 +17675,54 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleIDRequest" + "$ref": "#/components/schemas/A2AAgentListRequest" }, "example": { - "role_id": 150 + "offset": 0, + "limit": 20, + "include_account": true } } } } } }, - "/role/permission/list": { + "/safari/a2a-agent/update": { "post": { - "operationId": "role-read-list-permission", - "summary": "查看角色权限集合", - "description": "返回所有可用权限,可按角色 ID 过滤仅返回指定角色已授予的权限。", + "operationId": "remote-agent-write-update", + "summary": "更新 A2A 智能体", + "description": "对 A2A 智能体执行部分更新;省略字段表示不变。", "tags": [ - "平台/角色与权限" + "AI SRE/A2A 智能体" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 传入 `role_ids` 可过滤只返回指定角色已授予的权限。\n- 传入 `with_all: true` 可返回全部权限,并在每项中通过 `is_granted` 标记是否已授予。", - "href": "/zh/api-reference/platform/roles-permissions/role-read-list-permission", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-update", "metadata": { - "sidebarTitle": "查看角色权限集合" + "sidebarTitle": "更新 A2A 智能体" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RolePermissionListResponse" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -18311,20 +17730,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "id": 501, - "permission_name": "模板查看", - "permission_type": "read", - "description": "查看通知模板", - "class": "On-call", - "scope": "on-call", - "status": "enabled", - "is_granted": true - } - ] - } + "data": null } } } @@ -18335,6 +17741,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -18347,32 +17756,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RolePermissionListRequest" + "$ref": "#/components/schemas/A2AAgentUpdateRequest" }, "example": { - "role_ids": [ - 150 - ], - "with_all": true + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", + "instructions": "检查部署流水线并给出回滚步骤。" } } } } } }, - "/role/permission/factor/list": { + "/safari/automation/rule/create": { "post": { - "operationId": "role-read-list-permission-factor", - "summary": "查看权限因子集合", - "description": "返回所有权限因子(API、按钮、菜单、URL、访问),可按类型过滤。", + "operationId": "automation-rule-write-create", + "summary": "创建自动化规则", + "description": "创建一条 AI SRE 自动化规则,可同时配置定时触发与可选的 HTTP 触发。", "tags": [ - "平台/角色与权限" + "AI SRE/自动化" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 权限因子是每个权限的细粒度控制项。\n- `factor_types` 可选值:`api`、`button`、`visit`、`menu`、`url`。", - "href": "/zh/api-reference/platform/roles-permissions/role-read-list-permission-factor", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | **1,000 次/分钟**;**50 次/秒**(按账户) |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `team_id=0` 表示个人规则;传团队 ID 则创建团队规则。\n- 请求里的 `cron_expr` 使用 4 段格式;响应中的 `cron_expr` 会规范化为带前置分钟 `0` 的 5 段形式。\n- 若 `http_post_trigger_enabled=true`,响应会返回一次性的 `http_post_token`,请立即保存,后续查询接口不会再次返回。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。\n", + "href": "/zh/api-reference/ai-sre/automations/automation-rule-write-create", "metadata": { - "sidebarTitle": "查看权限因子集合" + "sidebarTitle": "创建自动化规则" } }, "responses": { @@ -18383,26 +17795,42 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PermissionFactorListResponse" + "$ref": "#/components/schemas/AutomationRuleItem" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - { - "factor_name": "template:read:info", - "factor_type": "api" - } - ] + "request_id": "01J1D8PMZEB54X6E5M9K0JD8TZ", + "data": { + "rule_id": "arule_weekly_insight", + "account_id": 10023, + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": true, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": true, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, + "http_post_token": "sat_live_3Qmz7bKp9f6nR2xT1vHd", + "can_edit": true, + "created_at": 1780272000000, + "updated_at": 1780275600000 + } } } } @@ -18425,31 +17853,42 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PermissionFactorListRequest" + "$ref": "#/components/schemas/AutomationRuleCreateRequest" }, "example": { - "factor_types": [ - "api" - ] + "name": "每周值班洞察", + "team_id": 7, + "enabled": true, + "cron_expr": "9 * * 1", + "schedule_trigger_enabled": true, + "prompt": "回顾上周故障、升级与噪音告警,并输出后续改进建议。", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "http_post_trigger_enabled": true } } } } } }, - "/role/member/grant": { + "/safari/automation/rule/delete": { "post": { - "operationId": "role-write-grant-role", - "summary": "授予成员账户权限", - "description": "将角色授予一个或多个成员,赋予其该角色包含的权限。", + "operationId": "automation-rule-write-delete", + "summary": "删除自动化规则", + "description": "删除一条 AI SRE 自动化规则。删除后未来触发会立即停止。", "tags": [ - "平台/角色与权限" + "AI SRE/自动化" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **角色管理**(`organization`) |\n\n## 使用说明\n\n- 每次最多传入 100 个成员 ID。\n- 已持有该角色的成员会被静默跳过。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/platform/roles-permissions/role-write-grant-role", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | **1,000 次/分钟**;**50 次/秒**(按账户) |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 删除规则后,未来的定时触发与 HTTP 触发都会停止;已有运行历史会由后端保留策略稍后清理。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。\n", + "href": "/zh/api-reference/ai-sre/automations/automation-rule-write-delete", "metadata": { - "sidebarTitle": "授予成员账户权限" + "sidebarTitle": "删除自动化规则" } }, "responses": { @@ -18460,21 +17899,22 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PlatformEmptyObject" + "type": "null", + "description": "成功时固定为 null。" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "request_id": "01J1D8W5SF6G8JQ8Y4S60AV45M", + "data": null } } } @@ -18485,9 +17925,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -18500,33 +17937,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleGrantRequest" + "$ref": "#/components/schemas/AutomationRuleIDRequest" }, "example": { - "member_ids": [ - 80011, - 80012 - ], - "role_id": 150 + "rule_id": "arule_weekly_insight" } } } } } }, - "/role/member/revoke": { + "/safari/automation/rule/get": { "post": { - "operationId": "role-write-revoke-role", - "summary": "解除成员账户权限", - "description": "从一个或多个成员处撤销角色授权。", + "operationId": "automation-rule-read-get", + "summary": "获取自动化规则详情", + "description": "获取一条自动化规则及其已解析的触发器元数据。", "tags": [ - "平台/角色与权限" + "AI SRE/自动化" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **角色管理**(`organization`) |\n\n## 使用说明\n\n- 未持有该角色的成员会被静默跳过。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/platform/roles-permissions/role-write-revoke-role", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | **1,000 次/分钟**;**50 次/秒**(按账户) |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 返回的 `cron_expr` 已规范化为 5 段形式。\n- `http_post_token` 通常不会出现在查询结果中;它只会在创建或轮换 token 后立即返回。\n", + "href": "/zh/api-reference/ai-sre/automations/automation-rule-read-get", "metadata": { - "sidebarTitle": "解除成员账户权限" + "sidebarTitle": "获取自动化规则详情" } }, "responses": { @@ -18537,21 +17975,41 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PlatformEmptyObject" + "$ref": "#/components/schemas/AutomationRuleItem" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "request_id": "01J1D8TANR2PCD3W3EJ0H8Y74M", + "data": { + "rule_id": "arule_weekly_insight", + "account_id": 10023, + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": true, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": true, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, + "can_edit": true, + "created_at": 1780272000000, + "updated_at": 1780275600000 + } } } } @@ -18562,9 +18020,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -18577,32 +18032,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleGrantRequest" + "$ref": "#/components/schemas/AutomationRuleIDRequest" }, "example": { - "member_ids": [ - 80011 - ], - "role_id": 150 + "rule_id": "arule_weekly_insight" } } } } } }, - "/audit/search": { + "/safari/automation/rule/list": { "post": { - "operationId": "audit-read-search", - "summary": "检索审计日志", - "description": "按时间范围返回游标分页的操作审计日志列表。", + "operationId": "automation-rule-read-list", + "summary": "查询自动化规则列表", + "description": "查询当前调用者在个人与团队范围内可见的 AI SRE 自动化规则。", "tags": [ - "平台/审计日志" + "AI SRE/自动化" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **审计查看**(`organization`) |\n\n## 使用说明\n\n- 时间范围必填。最大跨度 90 天,`start_time` 和 `end_time` 均为 Unix 时间戳(**秒**)。\n- 使用上次响应中的 `search_after_ctx` 获取下一页。该 token 是不透明的,请勿手动构造。\n- 可查询的时间窗口受账户许可证限制,超出保留期的查询会静默返回空结果,而不是报错。\n- 默认每页 20 条,最大 99 条。", - "href": "/zh/api-reference/platform/audit-logs/audit-read-search", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | **1,000 次/分钟**;**50 次/秒**(按账户) |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `scope=all` 会返回调用者的个人规则以及其成员身份可见的团队规则;`team_ids` 会在 scope 解析后继续收窄结果。\n- 可用 `enabled` 区分启用与停用规则,而不会改变可见性判断。\n", + "href": "/zh/api-reference/ai-sre/automations/automation-rule-read-list", "metadata": { - "sidebarTitle": "检索审计日志" + "sidebarTitle": "查询自动化规则列表" } }, "responses": { @@ -18613,37 +18070,43 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AuditSearchResponse" + "$ref": "#/components/schemas/AutomationRuleListResponse" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "request_id": "01J1D8Q7M5QR2RM8ZBJW7V1F8N", "data": { - "total": 2, - "search_after_ctx": "", - "docs": [ + "total": 1, + "rules": [ { - "created_at": 1712700123456, + "rule_id": "arule_weekly_insight", "account_id": 10023, - "member_id": 80011, - "member_name": "Alice", - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "ip": "203.0.113.42", - "operation": "template:write:create", - "operation_name": "创建模板", - "body": "{\"template_name\":\"生产默认模板\"}", - "params": [], - "is_dangerous": false, - "is_write": true + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": true, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": true, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, + "can_edit": true, + "created_at": 1780272000000, + "updated_at": 1780275600000 } ] } @@ -18669,35 +18132,40 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AuditSearchRequest" + "$ref": "#/components/schemas/AutomationRuleListRequest" }, "example": { - "start_time": 1712620800, - "end_time": 1712707200, + "p": 1, "limit": 20, - "operations": [ - "template:write:create", - "template:write:delete" - ] + "scope": "team", + "team_ids": [ + 7 + ], + "enabled": true } } } } } }, - "/audit/operation/list": { + "/safari/automation/rule/update": { "post": { - "operationId": "audit-read-operation-list", - "summary": "查看事件类型列表", - "description": "返回所有会记录到审计日志中的操作名称,可用于 `operations` 过滤参数。", + "operationId": "automation-rule-write-update", + "summary": "更新自动化规则", + "description": "局部更新一条 AI SRE 自动化规则,并可选地轮换其 HTTP 触发 token。", "tags": [ - "平台/审计日志" + "AI SRE/自动化" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **审计查看**(`organization`) |\n\n## 使用说明\n\n- 将本接口返回的 `name` 值作为 `POST /audit/search` 的 `operations` 过滤参数使用。\n- `name_cn` 是控制台展示的中文标签;`name` 是用于过滤的稳定字段值。", - "href": "/zh/api-reference/platform/audit-logs/audit-read-operation-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | **1,000 次/分钟**;**50 次/秒**(按账户) |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 只传你想修改的字段。\n- 设置 `rotate_http_post_trigger_token=true` 会签发新的 HTTP 触发 token,旧 token 会立即失效。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。\n", + "href": "/zh/api-reference/ai-sre/automations/automation-rule-write-update", "metadata": { - "sidebarTitle": "查看事件类型列表" + "sidebarTitle": "更新自动化规则" } }, "responses": { @@ -18708,35 +18176,41 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AuditOperationListResponse" + "$ref": "#/components/schemas/AutomationRuleItem" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "request_id": "01J1D8V011TBKCX3T7FPQ4T5W7", "data": { - "items": [ - { - "name": "template:write:create", - "name_cn": "创建模板" - }, - { - "name": "template:write:delete", - "name_cn": "删除模板" - }, - { - "name": "incident:write:acknowledge", - "name_cn": "认领故障" - } - ] + "rule_id": "arule_weekly_insight", + "account_id": 10023, + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": false, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": false, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, + "can_edit": true, + "created_at": 1780272000000, + "updated_at": 1780275600000, + "http_post_token": "sat_live_r1N6m2YQ9sH4v8Pe0KcA" } } } @@ -18760,27 +18234,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AuditOperationListRequest" + "$ref": "#/components/schemas/AutomationRuleUpdateRequest" }, - "example": {} + "example": { + "rule_id": "arule_weekly_insight", + "enabled": false, + "schedule_trigger_enabled": false, + "http_post_trigger_enabled": true, + "rotate_http_post_trigger_token": true + } } } } } }, - "/field/info": { + "/safari/automation/run/list": { "post": { - "operationId": "field-read-info", - "summary": "查看自定义字段", - "description": "按 ID 查询单个故障自定义字段的配置。", + "operationId": "automation-run-read-list", + "summary": "查询自动化执行历史", + "description": "查询某条 AI SRE 自动化规则的执行历史记录。", "tags": [ - "On-call/标签增强" + "AI SRE/自动化" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | 每账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限 | **故障可读** (`on-call`) 或 **故障可管理** (`on-call`) |\n\n## 使用说明\n\n- 仅返回非删除状态的字段;`field_id` 已删除或不存在时会返回 400。\n- `options` 与 `default_value` 的形态随 `field_type` 变化,详见 `FieldItem`。", - "href": "/zh/api-reference/on-call/alert-enrichment/field-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | **1,000 次/分钟**;**50 次/秒**(按账户) |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `started_after_ms` 与 `started_before_ms` 都是 Unix 毫秒时间戳。\n- `trigger_kind` 可区分定时、调试与 HTTP 触发的运行来源。\n", + "href": "/zh/api-reference/ai-sre/automations/automation-run-read-list", "metadata": { - "sidebarTitle": "查看自定义字段" + "sidebarTitle": "查询自动化执行历史" } }, "responses": { @@ -18791,40 +18276,49 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/FieldItem" + "$ref": "#/components/schemas/AutomationRunListResponse" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "request_id": "01J1D8RSGQ3CS2R2ZH4WFPB0D0", "data": { - "account_id": 80001, - "field_id": "66e9d3a4f7c2b04a1c8a91b3", - "field_name": "severity_class", - "display_name": "Severity Class", - "description": "Business severity tier.", - "field_type": "single_select", - "value_type": "string", - "options": [ - "Critical", - "High", - "Medium", - "Low" - ], - "default_value": "Medium", - "status": "enabled", - "creator_id": 80011, - "updated_by": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 + "total": 1, + "runs": [ + { + "run_id": "trun_weekly_20260630", + "kind": "automation_rule", + "account_id": 10023, + "rule_id": "arule_weekly_insight", + "trigger_kind": "schedule", + "occurrence_key": "2026-06-30T01:00:00Z", + "status": "succeeded", + "attempts": 1, + "started_at": 1782781200000, + "completed_at": 1782781685000, + "duration_ms": 485000, + "error_code": "", + "error_message": "", + "stats_json": { + "messages": 128, + "tool_calls": 9 + }, + "result_json": { + "session_id": "sess_hidden_weekly", + "final_event_id": "evt_final_weekly" + }, + "created_at": 1782781200000, + "updated_at": 1782781685000 + } + ] } } } @@ -18848,29 +18342,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FieldInfoRequest" + "$ref": "#/components/schemas/AutomationRunListRequest" }, "example": { - "field_id": "66e9d3a4f7c2b04a1c8a91b3" + "rule_id": "arule_weekly_insight", + "limit": 20, + "status": "succeeded", + "trigger_kind": "schedule", + "started_after_ms": 1780272000000 } } } } } }, - "/field/list": { + "/safari/automation/template/list": { "post": { - "operationId": "field-read-list", - "summary": "查看自定义字段列表", - "description": "返回账号下所有的故障自定义字段。", + "operationId": "automation-template-read-list", + "summary": "查询自动化模板列表", + "description": "查询用于预填新建自动化规则表单的预设模板列表。", "tags": [ - "On-call/标签增强" + "AI SRE/自动化" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | 每账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限 | **故障可读** (`on-call`) 或 **故障可管理** (`on-call`) |\n\n## 使用说明\n\n- 一次性返回全部未删除字段,无分页与 `total`。\n- `query` 同时匹配 `field_name` 与 `display_name`;非法正则会自动转义为字面量子串匹配。", - "href": "/zh/api-reference/on-call/alert-enrichment/field-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | **1,000 次/分钟**;**50 次/秒**(按账户) |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 未传 `locale` 时,后端会先回退到调用者当前界面语言,再加载对应模板文件。\n", + "href": "/zh/api-reference/ai-sre/automations/automation-template-read-list", "metadata": { - "sidebarTitle": "查看自定义字段列表" + "sidebarTitle": "查询自动化模板列表" } }, "responses": { @@ -18881,42 +18384,28 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/FieldListResponse" + "$ref": "#/components/schemas/AutomationTemplateListResponse" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "request_id": "01J1D8QZ3NVJ4H0N1JBBM4WE1R", "data": { - "items": [ + "templates": [ { - "account_id": 80001, - "field_id": "66e9d3a4f7c2b04a1c8a91b3", - "field_name": "severity_class", - "display_name": "Severity Class", - "description": "Business severity tier.", - "field_type": "single_select", - "value_type": "string", - "options": [ - "Critical", - "High", - "Medium", - "Low" - ], - "default_value": "Medium", - "status": "enabled", - "creator_id": 80011, - "updated_by": 80011, - "created_at": 1710000000, - "updated_at": 1710000000 + "name": "每周值班洞察", + "description": "为值班团队生成每周运营报告。", + "icon": "clipboard-list", + "enabled": true, + "prompt": "总结本周故障、升级与噪音告警,并输出值班团队周报。" } ] } @@ -18942,48 +18431,51 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FieldListRequest" + "$ref": "#/components/schemas/AutomationTemplateListRequest" }, "example": { - "orderby": "updated_at", - "asc": false, - "query": "severity" + "locale": "zh-CN" } } } } } }, - "/field/create": { + "/safari/mcp/server/create": { "post": { - "operationId": "field-write-create", - "summary": "创建自定义字段", - "description": "为账号新建一个故障自定义字段。", + "operationId": "mcp-write-server-create", + "summary": "创建 MCP 服务器", + "description": "在账户下注册新的 MCP 服务器(连接器)。", "tags": [ - "On-call/标签增强" + "AI SRE/MCP 服务器" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | 每账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限 | **故障可管理** (`on-call`) |\n\n## 使用说明\n\n- 每个账号最多 **15** 个自定义字段。\n- `field_name` 必须匹配 `^[a-zA-Z_][a-zA-Z0-9_]{0,39}$`,创建后不可更改;`display_name` 在账号内须唯一。\n- 类型规则:`checkbox` 仅支持 `value_type=bool` 且无 `options`;`single_select`/`multi_select` 要求 `value_type=string` 且 `options` 非空且元素唯一;`text` 仅支持 `value_type=string` 且无 `options`。\n- 响应仅包含 `field_id` 与 `field_name`,如需完整对象请调用 `/field/info`。\n- 该接口会被审计日志记录。", - "href": "/zh/api-reference/on-call/alert-enrichment/field-write-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- `command`/`args`/`env` 用于 `stdio`;`url`/`headers` 用于 `sse`/`streamable-http`。\n- 服务器名称在账户内必须唯一,重复将返回 InvalidParameter。\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-create", "metadata": { - "sidebarTitle": "创建自定义字段" + "sidebarTitle": "创建 MCP 服务器" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/CreateFieldResponse" + "$ref": "#/components/schemas/MCPServerItem" } } } @@ -18992,8 +18484,32 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "field_id": "66e9d3a4f7c2b04a1c8a91b3", - "field_name": "severity_class" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ + { + "name": "query", + "description": "Run a PromQL instant query." + }, + { + "name": "query_range", + "description": "Run a PromQL range query." + } + ], + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 } } } @@ -19005,6 +18521,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -19017,57 +18536,56 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateFieldRequest" + "$ref": "#/components/schemas/MCPServerCreateRequest" }, "example": { - "field_name": "severity_class", - "display_name": "Severity Class", - "description": "Business severity tier.", - "field_type": "single_select", - "value_type": "string", - "options": [ - "Critical", - "High", - "Medium", - "Low" - ], - "default_value": "Medium" + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled" } } } } } }, - "/field/update": { + "/safari/mcp/server/delete": { "post": { - "operationId": "field-write-update", - "summary": "变更自定义字段", - "description": "修改已有自定义字段的可变属性。", + "operationId": "mcp-write-server-delete", + "summary": "删除 MCP 服务器", + "description": "按 ID 删除 MCP 服务器。", "tags": [ - "On-call/标签增强" + "AI SRE/MCP 服务器" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | 每账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限 | **故障可管理** (`on-call`) |\n\n## 使用说明\n\n- 仅可修改 `display_name`、`description`、`options`、`default_value`;`field_name`、`field_type`、`value_type` 不可更改。\n- `options` 与 `default_value` 需保持与字段当前类型一致,规则同创建接口。\n- 该接口会被审计日志记录。", - "href": "/zh/api-reference/on-call/alert-enrichment/field-write-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-delete", "metadata": { - "sidebarTitle": "变更自定义字段" + "sidebarTitle": "删除 MCP 服务器" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "type": "object" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -19075,7 +18593,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": null } } } @@ -19086,6 +18604,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -19098,55 +18619,52 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateFieldRequest" + "$ref": "#/components/schemas/MCPServerDeleteRequest" }, "example": { - "field_id": "66e9d3a4f7c2b04a1c8a91b3", - "display_name": "Severity Class", - "description": "Business severity tier.", - "options": [ - "Critical", - "High", - "Medium", - "Low" - ], - "default_value": "Medium" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } } } }, - "/field/delete": { + "/safari/mcp/server/disable": { "post": { - "operationId": "field-write-delete", - "summary": "删除自定义字段", - "description": "删除自定义字段,并异步清理历史故障中的同名字段值。", + "operationId": "mcp-write-server-disable", + "summary": "禁用 MCP 服务器", + "description": "禁用已启用的 MCP 服务器。", "tags": [ - "On-call/标签增强" + "AI SRE/MCP 服务器" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | 每账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限 | **故障可管理** (`on-call`) |\n\n## 使用说明\n\n- 字段会立即标记为已删除;从历史故障中剥离对应值的清理过程在后台执行,数据量大时可能较慢。\n- 仅当 `field_type` 与 `value_type` 完全一致时,才允许复用已删除字段的 `field_name`。\n- 该接口会被审计日志记录。", - "href": "/zh/api-reference/on-call/alert-enrichment/field-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-disable", "metadata": { - "sidebarTitle": "删除自定义字段" + "sidebarTitle": "禁用 MCP 服务器" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "type": "object" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -19154,7 +18672,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": null } } } @@ -19165,6 +18683,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -19177,63 +18698,52 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteFieldRequest" + "$ref": "#/components/schemas/MCPServerStatusRequest" }, "example": { - "field_id": "66e9d3a4f7c2b04a1c8a91b3" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } } } }, - "/monit/query/rows": { + "/safari/mcp/server/enable": { "post": { - "operationId": "monit-read-query-rows", - "summary": "查询数据源原始行", - "description": "对已配置的数据源执行同步即席查询并返回原始行。供 Flashduty AI SRE 及 UI 预览使用。请求通过 WebSocket 转发至 monit-edge,由其对底层数据源(Prometheus / Loki / VictoriaLogs / SLS / MySQL / Postgres / Oracle / ClickHouse / Elasticsearch)执行查询。", + "operationId": "mcp-write-server-enable", + "summary": "启用 MCP 服务器", + "description": "启用已禁用的 MCP 服务器。", "tags": [ - "Monitors/诊断分析" + "AI SRE/MCP 服务器" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | **600 次/分钟**;**10 次/秒** 每账户 |\n| 权限 | 任意有效的 `app_key`(只读;不受特定权限分类约束) |\n\n## 使用说明\n\n- 请求通过 WebSocket 转发至 `monit-edge`;`ds_type` + `ds_name` 指定的数据源必须已在调用方账户下存在。\n- 请求体中的 `account_id` 为可选;若提供,必须与已认证账户一致,否则拒绝。\n- 存在两层错误:webapi 层失败使用标准错误信封返回,而 `monit-edge` 执行查询时抛出的错误以 HTTP 200 返回,并在响应体中携带 `error` 对象。除 HTTP 状态外,务必同时检查响应体中的 `error`。\n- monit-edge 强制行数上限;过大结果集会返回 `error.message = \"too many rows\"`。请收窄时间范围或在数据源端聚合。\n- `args` 是一个多态 `string→string` 映射,原样转发。语义取决于 `ds_type`(SLS 需要 `sls.project` + `sls.logstore`;Loki / VictoriaLogs 原始模式需要通过 `*.start`/`*.end` 或 `*.timespan.value`/`*.timespan.unit` 指定时间范围;Prometheus 与 SQL 类数据源忽略该字段)。各数据源的键列表见 monit-webapi query-api 文档。", - "href": "/zh/api-reference/monitors/diagnostics/monit-read-query-rows", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-enable", "metadata": { - "sidebarTitle": "查询数据源原始行" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryRowsRequest" - }, - "example": { - "account_id": 10001, - "ds_type": "prometheus", - "ds_name": "prod-prom", - "expr": "up", - "delay_seconds": 30 - } - } + "sidebarTitle": "启用 MCP 服务器" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/QueryRowsResponse" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -19241,18 +18751,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": [ - { - "fields": { - "__name__": "up", - "instance": "10.0.0.1:9100", - "job": "node" - }, - "values": { - "__value__": 1 - } - } - ] + "data": null } } } @@ -19263,83 +18762,66 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, "500": { "$ref": "#/components/responses/ServerError" } - } - } - }, - "/monit/query/diagnose": { - "post": { - "operationId": "monit-read-query-diagnose", - "summary": "数据源诊断", - "description": "执行同步诊断查询(Loki/VictoriaLogs 使用 `log_patterns`,Prometheus 使用 `metric_trends`)。Flashduty AI SRE 用于日志模式聚类与时间序列趋势分析。长耗时——最长可达 35 秒。", - "tags": [ - "Monitors/诊断分析" - ], - "x-mint": { - "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | **600 次/分钟**;**10 次/秒** 每账户 |\n| 权限 | 任意有效的 `app_key`(只读;不受特定权限分类约束) |\n\n## 使用说明\n\n- 这是诊断 / RCA 接口,而非原始数据查询接口——如需查看明细行,请配合 `/monit/query/rows` 使用。\n- `operation` 由 `ds_type` 推导:`loki` / `victorialogs` → `log_patterns`,`prometheus` → `metric_trends`。其他数据源必须显式传入 `operation`。\n- `methods` 选择要执行的分析方法;省略时,`log_patterns` 默认为 `pattern_snapshot + pattern_compare(previous_window)`,`metric_trends` 默认为 `single_window_shape + window_compare(previous_window)`。\n- `time_range` 单位为 Unix 秒;缺失或无效时默认最近 15 分钟;窗口宽度超过 6 小时将被拒绝。\n- 请求通过 WebSocket 转发至 `monit-edge`。长耗时:边缘侧执行可能耗时约 30 秒,叠加 webapi 开销。客户端超时应至少设置为 **35 秒**。\n- `options.*` 由边缘侧设置上限(`max_logs_scanned` ≤ 50 000,`max_patterns` ≤ 50,`examples_per_pattern` ≤ 3,`step_seconds` ∈ [15, 300],`max_series` ≤ 200,`topk` ≤ 50,`timeout_seconds` ≤ 30)。\n- 与 `/monit/query/rows` 一样存在两层错误:边缘侧执行错误以 HTTP 200 返回,响应体中带 `error` 对象——务必同时检查两层。\n- 日志样例在返回前会经过基础脱敏处理,响应中会带 `warnings: [\"examples redacted\"]`。不可作为原始日志使用。", - "href": "/zh/api-reference/monitors/diagnostics/monit-read-query-diagnose", - "metadata": { - "sidebarTitle": "数据源诊断" - } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DiagnoseRequest" + "$ref": "#/components/schemas/MCPServerStatusRequest" }, "example": { - "account_id": 10001, - "ds_type": "victorialogs", - "ds_name": "vmlogs-read", - "operation": "log_patterns", - "time_range": { - "start": 1776847544, - "end": 1776849344 - }, - "methods": [ - { - "name": "pattern_snapshot" - }, - { - "name": "pattern_compare", - "baseline": "same_window_yesterday" - } - ], - "input": { - "query": "_stream:{status='500'}" - }, - "options": { - "max_logs_scanned": 10000, - "max_patterns": 20, - "examples_per_pattern": 2, - "timeout_seconds": 25 - } + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } + } + } + }, + "/safari/mcp/server/get": { + "post": { + "operationId": "mcp-read-server-get", + "summary": "查看 MCP 服务器详情", + "description": "查看单个 MCP 服务器并实时探测其工具列表。", + "tags": [ + "AI SRE/MCP 服务器" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 详情接口会实时探测工具;探测失败时设置 `list_error`,请求本身仍成功。\n", + "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-read-server-get", + "metadata": { + "sidebarTitle": "查看 MCP 服务器详情" + } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/DiagnoseResponse" + "$ref": "#/components/schemas/MCPServerItem" } } } @@ -19348,61 +18830,32 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "operation": "log_patterns", - "ds_type": "victorialogs", - "ds_name": "vmlogs-read", - "query": "_stream:{status='500'}", - "window": { - "start": 1776847544, - "end": 1776849344 - }, - "results": [ + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ { - "method": "pattern_snapshot", - "window": { - "start": 1776847544, - "end": 1776849344 - }, - "summary": { - "logs_scanned": 405, - "baseline_logs_scanned": 0, - "current_truncated": false, - "baseline_truncated": false, - "patterns_total": 2, - "returned_patterns": 2, - "new_patterns": 0, - "surging_patterns": 0, - "surging_threshold": { - "change_ratio_min": 3, - "count_min": 5 - } - }, - "patterns": [ - { - "pattern_hash": "239fa5da", - "template": "POST /api/v/orders/ HTTP/", - "count": 213, - "first_seen": 1776847562, - "last_seen": 1776849336, - "severity": "unknown", - "approximate": false, - "sources": [ - { - "field": "pod", - "value": "order-api-7f69d8d9b6-m4x9n", - "count": 130 - } - ], - "examples": [ - "POST /api/v/orders/ HTTP/" - ] - } - ], - "warnings": [ - "examples redacted" - ] + "name": "query", + "description": "Run a PromQL instant query." + }, + { + "name": "query_range", + "description": "Run a PromQL range query." } - ] + ], + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 } } } @@ -19420,54 +18873,57 @@ "500": { "$ref": "#/components/responses/ServerError" } - } - } - }, - "/monit/tools/catalog": { - "post": { - "operationId": "monit-read-tools-catalog", - "summary": "查询监控对象工具能力清单", - "description": "根据 `target_locator`(host、mysql 等)查询该监控对象上 monit-agent 当前暴露的工具能力。返回每个工具的名称、描述以及 JSON-Schema `input_schema`。配合 `/monit/tools/invoke` 驱动 AI-SRE 的工具调用。", - "tags": [ - "Monitors/诊断分析" - ], - "x-mint": { - "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | **600 次/分钟**;**10 次/秒** 每账户 |\n| 权限 | 任意有效的 `app_key`(只读;不受特定权限分类约束) |\n\n## 使用说明\n\n- 使用 `target_locator` 标识监控对象;`target_kind` 可选,省略时自动推断。内置的 target kind 包括 `host` 与 `mysql`。\n- 若同一 locator 匹配多个 kind,响应为 HTTP 200,`data.error.code = \"ambiguous_target_kind\"`,并附带 `target_kinds` 列表——请带上显式的 `target_kind` 重试。\n- 工具能力清单是*候选能力*视图,并非执行保证。目标 Agent 可能在拿到清单与发起调用之间下线,本地 Agent 策略也可能在调用时拦截某些工具。\n- 设置 `include_output_shape: true` 可额外返回每个工具的 `output_shape`。默认为 `false`,以便为 LLM 消费保持响应精简。\n- 业务错误(`target_unavailable`、`unknown_toolset_hash`、`ambiguous_target_kind`)以 HTTP 200 返回,`data.error` 非空。只有协议 / 鉴权 / 内部错误才使用标准错误信封。", - "href": "/zh/api-reference/monitors/diagnostics/monit-read-tools-catalog", - "metadata": { - "sidebarTitle": "查询监控对象工具能力清单" - } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ToolCatalogRequest" + "$ref": "#/components/schemas/MCPServerGetRequest" }, "example": { - "account_id": 10001, - "target_locator": "web-01", - "include_output_shape": true + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } - }, - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" + } + } + }, + "/safari/mcp/server/list": { + "post": { + "operationId": "mcp-read-server-list", + "summary": "查询 MCP 服务器列表", + "description": "分页查询调用者在账户与团队范围内可见的 MCP 服务器。", + "tags": [ + "AI SRE/MCP 服务器" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 列表不含实时工具列表;如需探测工具请单独查询某个服务器。\n", + "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-read-server-list", + "metadata": { + "sidebarTitle": "查询 MCP 服务器列表" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ToolCatalogResponse" + "$ref": "#/components/schemas/MCPServerListResponse" } } } @@ -19476,42 +18932,37 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "target": { - "kind": "host", - "locator": "web-01" - }, - "tools": [ + "total": 1, + "servers": [ { - "name": "os.overview", - "target_kind": "host", - "description": "Returns a bounded overview of host health (CPU, memory, disk, network, top processes).", - "input_schema": { - "type": "object", - "additionalProperties": false, - "properties": {} - }, - "output_shape": { - "type": "object", - "required": [ - "data", - "summary", - "truncated" - ], - "properties": { - "data": { - "type": "object" - }, - "summary": { - "type": "string" - }, - "truncated": { - "type": "object" - } + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ + { + "name": "query", + "description": "Run a PromQL instant query." + }, + { + "name": "query_range", + "description": "Run a PromQL range query." } - } + ], + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 } - ], - "error": null + ] } } } @@ -19529,66 +18980,59 @@ "500": { "$ref": "#/components/responses/ServerError" } - } - } - }, - "/monit/tools/invoke": { - "post": { - "operationId": "monit-read-tools-invoke", - "summary": "调用监控对象工具", - "description": "在单个监控对象上并发调用至多 8 个 monit-agent 工具。结果按入参 `tools` 数组顺序返回。长耗时——单个工具在 Agent 上有自己的超时,整体请求可能耗时数十秒。", - "tags": [ - "Monitors/诊断分析" - ], - "x-mint": { - "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | **600 次/分钟**;**10 次/秒** 每账户 |\n| 权限 | 任意有效的 `app_key`(只读;不受特定权限分类约束) |\n\n## 使用说明\n\n- 单次调用至多 **8** 个工具(`MaxToolsPerInvoke`);超出需在客户端拆分。8 个工具的上限与单监控对象 Agent 的并发能力对齐。\n- 工具在 Agent 上并行执行;webapi 返回的 `results[]` 与请求中的 `tools[]` 顺序对齐。\n- 长耗时:客户端超时至少设置 **35 秒**。该接口面向 AI-SRE / 人工排障流程,不适用于交互式 UI。\n- 请求级错误(`target_unavailable`、`ambiguous_target_kind`、`unknown_toolset_hash`、`forward_failed`)以 HTTP 200 返回,`data.error` 不为空,`data.results = []`。\n- 单工具失败以 HTTP 200 返回,`data.error = null`,`results[i].error` 被填充——务必同时检查**三层**(外层信封 `error`、`data.error`、再到每个 `results[i].error`)。\n- 每条结果带两个耗时字段:`agent_elapsed_ms`(Agent 自报,不含网络)与 `e2e_elapsed_ms`(webapi 观测的端到端)。两者差距较大表示网络 / 边缘侧慢,而非工具执行慢。\n- 按 `/monit/tools/catalog` 返回的 `input_schema` 构造 `tools[].params`。对于无参工具,务必显式传 `params: {}`。", - "href": "/zh/api-reference/monitors/diagnostics/monit-read-tools-invoke", - "metadata": { - "sidebarTitle": "调用监控对象工具" - } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ToolInvokeRequest" + "$ref": "#/components/schemas/MCPServerListRequest" }, "example": { - "account_id": 10001, - "target_locator": "web-01", - "tools": [ - { - "tool": "os.overview", - "params": {} - }, - { - "tool": "net.tcp_ping", - "params": { - "host": "10.0.0.10", - "port": 3306 - } - } - ] + "p": 1, + "limit": 20, + "include_account": true } } } + } + } + }, + "/safari/mcp/server/update": { + "post": { + "operationId": "mcp-write-server-update", + "summary": "更新 MCP 服务器", + "description": "更新 MCP 服务器配置;省略字段表示不变。", + "tags": [ + "AI SRE/MCP 服务器" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- `env`/`headers` 中的脱敏密钥会被保留——回传脱敏值不会覆盖已存储的真实密钥。\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-update", + "metadata": { + "sidebarTitle": "更新 MCP 服务器" + } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ToolInvokeResponse" + "$ref": "#/components/schemas/MCPServerItem" } } } @@ -19597,42 +19041,32 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "target": { - "kind": "host", - "locator": "web-01" - }, - "results": [ + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics, alerts, and rules.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ { - "tool": "os.overview", - "tool_version": "0.5.0", - "data": { - "data": { - "sample_interval_sec": 3, - "degraded": false, - "degradation_reasons": [] - }, - "summary": "os.overview ...", - "truncated": { - "truncated": false - } - }, - "error": null, - "agent_elapsed_ms": 3120, - "e2e_elapsed_ms": 3188 + "name": "query", + "description": "Run a PromQL instant query." }, { - "tool": "net.tcp_ping", - "tool_version": "0.5.0", - "data": null, - "error": { - "code": "target_unreachable", - "message": "dial tcp 10.0.0.10:3306: i/o timeout" - }, - "agent_elapsed_ms": 0, - "e2e_elapsed_ms": 2008 + "name": "query_range", + "description": "Run a PromQL range query." } ], - "error": null + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 } } } @@ -19644,59 +19078,68 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, "500": { "$ref": "#/components/responses/ServerError" } - } - } - }, - "/monit/targets": { - "post": { - "operationId": "monit-read-targets-list", - "summary": "监控对象列表", - "description": "列出当前租户下被 monit-agent 路由投影所观测到的监控对象。支持 `target_locator` 前缀搜索与游标分页。用于为 `/monit/tools/catalog` 与 `/monit/tools/invoke` 选择 `target_locator`。", - "tags": [ - "Monitors/诊断分析" - ], - "x-mint": { - "content": "## 调用限制\n\n| 项 | 值 |\n| ------ | ----- |\n| 速率限制 | **600 次/分钟**;**10 次/秒** 每账户 |\n| 权限 | 任意有效的 `app_key`(只读;不受特定权限分类约束) |\n\n## 使用说明\n\n- 这是一个 **UI 投影视图**,不是 `/monit/tools/invoke` 所依赖的实时数据源。列表中存在不代表对应监控对象当前可被调用。\n- `keyword` 是对 `target_locator` 的**前缀匹配**(仅 ASCII,不含空白,不含 `|`,最长 256 字节)。v1 不支持子串搜索。\n- `limit` 默认 50,最大 200。分页基于游标:将上次响应中的 `next_cursor` 传入即可拉取下一页;`next_cursor` 为空或缺失表示已到末页。\n- 重置 `keyword`、`limit` 或租户上下文时必须重置 `cursor`;切勿在不同筛选条件之间复用游标。\n- `total` 是当前 `(account_id, keyword)` 组合下未受游标影响的匹配总数,跨页保持稳定。\n- 字段中暴露 `cluster_name` / `edge_ipport` 供排障使用;`updated_at` 表示\"最近一次被观测到\",而非实时在线指标。", - "href": "/zh/api-reference/monitors/diagnostics/monit-read-targets-list", - "metadata": { - "sidebarTitle": "监控对象列表" - } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TargetsListRequest" + "$ref": "#/components/schemas/MCPServerUpdateRequest" }, "example": { - "keyword": "db-prod", - "limit": 50 + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "description": "Query Prometheus metrics, alerts, and rules." } } } + } + } + }, + "/safari/session/delete": { + "post": { + "operationId": "session-write-delete", + "summary": "删除会话", + "description": "按 ID 删除会话。", + "tags": [ + "AI SRE/会话" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 需要对该会话拥有管理权限(创建者、账户管理员或所属团队成员)。\n", + "href": "/zh/api-reference/ai-sre/sessions/session-write-delete", + "metadata": { + "sidebarTitle": "删除会话" + } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TargetsListResponse" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -19704,20 +19147,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "target_kind": "host", - "target_locator": "db-prod-01", - "agent_version": "2.0.0", - "cluster_name": "edge-a", - "edge_ipport": "10.0.0.1:19090", - "updated_at": 1710000000 - } - ], - "total": 120, - "next_cursor": "eyJ0YXJnZXRfbG9jYXRvciI6ImRiLXByb2QtMDEiLCJpZCI6MTIzNDV9" - } + "data": null } } } @@ -19734,73 +19164,50 @@ "500": { "$ref": "#/components/responses/ServerError" } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionDeleteRequest" + }, + "example": { + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u" + } + } + } } } }, - "/change/list": { + "/safari/session/export": { "post": { - "operationId": "change-read-list", - "summary": "查询变更列表", - "description": "在指定时间窗口内查询变更记录,支持过滤、搜索与分页。", + "operationId": "session-read-export", + "summary": "导出会话记录", + "description": "以换行分隔的 JSON(NDJSON)流式导出会话的完整事件记录。", "tags": [ - "On-call/变更管理" + "AI SRE/会话" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", - "href": "/zh/api-reference/on-call/changes/change-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 响应为 `application/x-ndjson`——请逐行解析并写入文件,切勿将整段记录读入内存。\n- 第一行始终为 `session_meta` 信封;`include_subagents=true` 会在派发行后内联各子会话的事件流。\n", + "href": "/zh/api-reference/ai-sre/sessions/session-read-export", "metadata": { - "sidebarTitle": "查询变更列表" + "sidebarTitle": "导出会话记录" } }, "responses": { "200": { - "description": "Success", + "description": "流式 NDJSON(application/x-ndjson)。每行一个 JSON 对象,以换行结束。第一行始终为 `session_meta` 信封,其后为会话事件。", "content": { - "application/json": { + "application/x-ndjson": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/ListChangeResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 1, - "has_next_page": false, - "items": [ - { - "change_id": "664a1b2c3d4e5f6a7b8c9d0e", - "account_id": 10001, - "channel_id": 5001, - "channel_name": "Production", - "channel_status": "active", - "integration_id": 362, - "integration_name": "GitHub Deploy", - "title": "Deploy api-server v2.3.1", - "description": "Rolling deploy to production cluster", - "change_key": "deploy-api-server-2311", - "change_status": "Done", - "start_time": 1716962400, - "last_time": 1716962700, - "end_time": 1716963000, - "labels": { - "service": "api-server", - "env": "prod" - }, - "link": "https://github.com/acme/api-server/actions/runs/123" - } - ] - } + "type": "string", + "description": "换行分隔的 JSON 流。请逐行解析,切勿缓冲整个响应体。" } } } @@ -19823,38 +19230,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListChangeRequest" + "$ref": "#/components/schemas/SessionExportRequest" }, "example": { - "start_time": 1716960000, - "end_time": 1717046400, - "p": 1, - "limit": 10, - "integration_ids": [ - 362 - ], - "orderby": "start_time", - "asc": false, - "include_events": false + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "include_subagents": false } } } } } }, - "/incident/war-room/default-observers": { + "/safari/session/get": { "post": { - "operationId": "incident-read-get-war-room-default-observers", - "summary": "查看作战室默认观察者", - "description": "返回开启作战室时建议作为默认观察者的历史响应人。", + "operationId": "session-read-info", + "summary": "查看会话详情", + "description": "查看单个会话,并返回其最近事件的一页(向更早方向分页)。", "tags": [ - "On-call/故障管理" + "AI SRE/会话" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", - "href": "/zh/api-reference/on-call/incidents/incident-read-get-war-room-default-observers", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 使用上一次响应的 `search_after_ctx` 翻阅更早的历史。\n- `limit`(或旧版 `num_recent_events`)限制事件页大小;默认 100,最大 1000。\n", + "href": "/zh/api-reference/ai-sre/sessions/session-read-info", "metadata": { - "sidebarTitle": "查看作战室默认观察者" + "sidebarTitle": "查看会话详情" } }, "responses": { @@ -19865,13 +19269,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/GetWarRoomDefaultObserversResponse" + "$ref": "#/components/schemas/SessionGetResponse" } } } @@ -19880,20 +19284,62 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "observers": [ + "session": { + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "session_name": "Investigate cloud-assistant first heartbeat", + "app_name": "ai-sre", + "entry_kind": "web", + "person_id": "3790925372131", + "team_id": 0, + "is_mine": false, + "can_manage": true, + "status": "enabled", + "incognito": false, + "created_at": 1780367971228, + "updated_at": 1780367993457, + "token_usage": { + "input_tokens": 14948, + "cached_tokens": 11520, + "output_tokens": 888, + "reasoning_tokens": 351 + }, + "current_context_tokens": 14948, + "context_window": 0, + "archived_at": 0, + "pinned_at": 0, + "last_event_at": 1780367992649, + "is_running": false, + "has_unread": true + }, + "events": [ { - "account_id": 10001, - "person_id": 20001, - "person_name": "Alice Chen", - "avatar": "https://cdn.flashcat.cloud/avatar/20001.png", - "email": "alice@acme.com", - "phone": "+8613800000000", - "locale": "zh-CN", - "time_zone": "Asia/Shanghai", - "as": "responder", - "status": "active" + "event_id": "evt_3aZQ9p", + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "author": "user", + "partial": false, + "turn_complete": false, + "status": "normal", + "created_at": 1780367971241 + }, + { + "event_id": "evt_7bWk2r", + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "author": "ai-sre", + "content": { + "role": "model", + "parts": [ + { + "text": "..." + } + ] + }, + "partial": false, + "turn_complete": true, + "status": "normal", + "created_at": 1780367992649 } - ] + ], + "has_more_older": false } } } @@ -19917,29 +19363,35 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetWarRoomDefaultObserversRequest" + "$ref": "#/components/schemas/SessionGetRequest" }, "example": { - "incident_id": "664a1b2c3d4e5f6a7b8c9d0e" + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "num_recent_events": 50 } } } } } }, - "/incident/war-room/add-member": { + "/safari/session/list": { "post": { - "operationId": "incident-write-add-war-room-member", - "summary": "添加作战室成员", - "description": "向与故障集成绑定的 IM 作战室添加一名或多名成员。", + "operationId": "session-read-list", + "summary": "查询会话列表", + "description": "分页查询调用者可见的智能体会话,可按应用、入口、归档状态与团队过滤。", "tags": [ - "On-call/故障管理" + "AI SRE/会话" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", - "href": "/zh/api-reference/on-call/incidents/incident-write-add-war-room-member", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 分页使用 `p`/`limit`(最大 100);`scope` 默认 `all`(本人 + 所属团队)。\n- `is_running` 反映实时运行集合;`has_unread` 按调用者各自计算。\n", + "href": "/zh/api-reference/ai-sre/sessions/session-read-list", "metadata": { - "sidebarTitle": "添加作战室成员" + "sidebarTitle": "查询会话列表" } }, "responses": { @@ -19950,14 +19402,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "type": "string", - "description": "成功时返回字面量 \"ok\"。" + "$ref": "#/components/schemas/SessionListResponse" } } } @@ -19965,16 +19416,47 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": "ok" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" + "data": { + "total": 988, + "sessions": [ + { + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "session_name": "Investigate cloud-assistant first heartbeat", + "app_name": "ai-sre", + "entry_kind": "web", + "person_id": "3790925372131", + "team_id": 0, + "is_mine": false, + "can_manage": true, + "status": "enabled", + "incognito": false, + "created_at": 1780367971228, + "updated_at": 1780367993457, + "token_usage": { + "input_tokens": 14948, + "cached_tokens": 11520, + "output_tokens": 888, + "reasoning_tokens": 351 + }, + "current_context_tokens": 14948, + "context_window": 0, + "archived_at": 0, + "pinned_at": 0, + "last_event_at": 1780367992649, + "is_running": false, + "has_unread": true + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" }, "429": { "$ref": "#/components/responses/TooManyRequests" @@ -19988,34 +19470,37 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AddWarRoomMemberRequest" + "$ref": "#/components/schemas/SessionListRequest" }, "example": { - "integration_id": 362, - "chat_id": "oc_5ce6d572455d361153b7cb51da133945", - "member_ids": [ - 20001, - 20002 - ] + "app_name": "ai-sre", + "limit": 2, + "orderby": "updated_at", + "scope": "all" } } } } } }, - "/template/preview": { + "/safari/skill/delete": { "post": { - "operationId": "template-read-preview", - "summary": "预览模板", - "description": "使用故障数据或模拟数据渲染通知模板并返回结果。", + "operationId": "skill-write-delete", + "summary": "删除技能", + "description": "按 ID 删除技能。", "tags": [ - "On-call/通知模板" + "AI SRE/技能" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **60 次/分钟**;**10 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", - "href": "/zh/api-reference/on-call/notification-templates/template-read-preview", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/skills/skill-write-delete", "metadata": { - "sidebarTitle": "预览模板" + "sidebarTitle": "删除技能" } }, "responses": { @@ -20026,13 +19511,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PreviewTemplateResponse" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -20040,11 +19526,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "success": true, - "content": "Incident Database latency spike is Critical", - "message": "" - } + "data": null } } } @@ -20055,6 +19537,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -20067,31 +19552,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PreviewTemplateRequest" + "$ref": "#/components/schemas/SkillDeleteRequest" }, "example": { - "content": "Incident {{.Title}} is {{.Status}}", - "type": "feishu_app", - "incident_id": "664a1b2c3d4e5f6a7b8c9d0e" + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" } } } } } }, - "/datasource/im/war-room-enabled/list": { + "/safari/skill/disable": { "post": { - "operationId": "im-war-room-enabled-list", - "summary": "查看开启作战室功能的集成", - "description": "查询账户下已开启作战室功能的 IM 集成。", + "operationId": "skill-write-disable", + "summary": "禁用技能", + "description": "禁用已启用的技能,使智能体不再加载。", "tags": [ - "On-call/IM 集成" + "AI SRE/技能" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", - "href": "/zh/api-reference/on-call/integrations/im-war-room-enabled-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 仅可禁用 `enabled` 状态的技能,否则返回 InvalidParameter。\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/skills/skill-write-disable", "metadata": { - "sidebarTitle": "查看开启作战室功能的集成" + "sidebarTitle": "禁用技能" } }, "responses": { @@ -20102,13 +19590,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListWarRoomEnabledResponse" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -20116,35 +19605,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "data_source_id": 362, - "account_id": 10001, - "team_id": 0, - "plugin_id": 101, - "name": "Feishu Ops", - "status": "enabled", - "category": "im", - "plugin_type": "feishu", - "plugin_type_name": "Feishu", - "description": "Feishu war-room integration", - "integration_key": "ik_8f3a2b1c9d0e", - "ref_id": "", - "settings": { - "war_room_enabled": true - }, - "no_editable": false, - "creator_id": 20001, - "updated_by": 20001, - "created_at": 1716962400, - "updated_at": 1716962700, - "last_time": 1716963000, - "exclusive_data_source_id": 0, - "integration_id": 362 - } - ] - } + "data": null } } } @@ -20155,6 +19616,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -20167,27 +19631,34 @@ "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/SkillStatusRequest" }, - "example": {} + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + } } } } } }, - "/status-page/list": { - "get": { - "operationId": "status-page-read-page-list", - "summary": "查询状态页列表", - "description": "查询账户下所有状态页,包含其组件与分组。", + "/safari/skill/enable": { + "post": { + "operationId": "skill-read-enable", + "summary": "启用技能", + "description": "启用已禁用的技能,使智能体可加载。", "tags": [ - "On-call/状态页" + "AI SRE/技能" + ], + "security": [ + { + "AppKeyAuth": [] + } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", - "href": "/zh/api-reference/on-call/status-pages/status-page-read-page-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 仅可启用 `disabled` 状态的技能,否则返回 InvalidParameter。\n", + "href": "/zh/api-reference/ai-sre/skills/skill-read-enable", "metadata": { - "sidebarTitle": "查询状态页列表" + "sidebarTitle": "启用技能" } }, "responses": { @@ -20198,13 +19669,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SuccessEnvelope" + "$ref": "#/components/schemas/ResponseEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListStatusPageResponse" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -20212,53 +19684,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "page_id": 7001, - "name": "Acme Status", - "url_name": "acme", - "type": "public", - "custom_domain": "status.acme.com", - "logo_url": "https://acme.com", - "page_header": "Acme System Status", - "date_view": "calendar", - "display_uptime_mode": "chart_and_percentage", - "custom_links": [ - { - "name": "Home", - "url": "https://acme.com" - } - ], - "contact_info": "mailto:support@acme.com", - "components": [ - { - "component_id": "cmp_001", - "section_id": "sec_001", - "name": "API", - "description": "Core API service", - "available_since_seconds": 1716962400, - "order_id": 1, - "hide_uptime": false, - "hide_all": false - } - ], - "sections": [ - { - "section_id": "sec_001", - "name": "Core Services", - "order_id": 1, - "hide_uptime": false, - "hide_all": false - } - ], - "subscription": { - "email": true, - "im": false - } - } - ] - } + "data": null } } } @@ -20269,41 +19695,54 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, "500": { "$ref": "#/components/responses/ServerError" } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillStatusRequest" + }, + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + } + } + } } } }, - "/account/info": { + "/safari/skill/get": { "post": { - "summary": "查看主体信息", - "description": "返回当前主体(账户)的基本信息与设置。", - "operationId": "account-read-info", + "operationId": "skill-read-get", + "summary": "查看技能详情", + "description": "查看单个技能,包含完整的 SKILL.md 内容。", "tags": [ - "平台/账户设置" + "AI SRE/技能" ], "security": [ { "AppKeyAuth": [] } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - }, - "example": {} - } + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", + "href": "/zh/api-reference/ai-sre/skills/skill-read-get", + "metadata": { + "sidebarTitle": "查看技能详情" } }, "responses": { "200": { - "description": "OK", + "description": "Success", "content": { "application/json": { "schema": { @@ -20315,37 +19754,38 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/AccountInfo" + "$ref": "#/components/schemas/SkillItem" } } } ] }, "example": { - "error_code": 0, + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "account_id": 1001, - "account_name": "acme", - "domain": "acme", - "extra_domains": [ - "acme-corp" + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "account_id": 10023, + "team_id": 0, + "skill_name": "k8s-triage", + "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", + "version": "1.2.0", + "tags": [ + "kubernetes", + "triage" ], - "phone": "138****8000", - "country_code": "86", - "email": "ops@acme.example", - "avatar": "https://cdn.flashcat.cloud/avatar/acme.png", - "locale": "zh-CN", - "time_zone": "Asia/Shanghai", - "created_at": 1716960000, - "restrictions": { - "ips": [ - "203.0.113.0/24" - ], - "email_domains": [ - "acme.example" - ], - "allow_subdomain": true - } + "author": "sre-team", + "tools": [ + "bash", + "mcp:prometheus/query" + ], + "status": "enabled", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "can_edit": true, + "update_available": false, + "is_modified": false, + "content": "---\nname: k8s-triage\ndescription: ...\n---\n# Triage steps" } } } @@ -20361,14 +19801,21 @@ "$ref": "#/components/responses/TooManyRequests" }, "500": { - "$ref": "#/components/responses/InternalError" + "$ref": "#/components/responses/ServerError" } }, - "x-mint": { - "metadata": { - "sidebarTitle": "查看主体信息" - }, - "content": "| 权限 | 描述 |\n| --- | --- |\n| 无 | 无 — 任意有效的 app_key 均可调用此操作。 |\n\n在 [平台 API 参考](/zh/api-reference/platform/account/account-read-info) 中查看此操作。" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillGetRequest" + }, + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + } + } + } } } }, @@ -20477,11 +19924,11 @@ } } }, - "/safari/skill/get": { + "/safari/skill/update": { "post": { - "operationId": "skill-read-get", - "summary": "查看技能详情", - "description": "查看单个技能,包含完整的 SKILL.md 内容。", + "operationId": "skill-write-update", + "summary": "更新技能", + "description": "更新技能的描述或重新分配团队范围。", "tags": [ "AI SRE/技能" ], @@ -20491,10 +19938,112 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", - "href": "/zh/api-reference/ai-sre/skills/skill-read-get", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 仅 `description` 与 `team_id` 可编辑;技能正文需通过重新上传修改。\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/skills/skill-write-update", "metadata": { - "sidebarTitle": "查看技能详情" + "sidebarTitle": "更新技能" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SkillItem" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "account_id": 10023, + "team_id": 0, + "skill_name": "k8s-triage", + "description": "Updated triage runbook.", + "version": "1.2.0", + "tags": [ + "kubernetes", + "triage" + ], + "author": "sre-team", + "tools": [ + "bash", + "mcp:prometheus/query" + ], + "status": "enabled", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "can_edit": true, + "update_available": false, + "is_modified": false + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillUpdateRequest" + }, + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "description": "Updated triage runbook." + } + } + } + } + } + }, + "/safari/skill/upload": { + "post": { + "operationId": "skill-write-upload", + "summary": "上传技能", + "description": "上传技能压缩包(.skill/.zip/.tar.gz/.tgz)以创建或覆盖技能。", + "tags": [ + "AI SRE/技能" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **30 次/分钟**;**3 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 以 `multipart/form-data` 提交,包含 `file` 部分。压缩包最大 100MB。\n- 设置 `replace=true` 可覆盖同名技能。\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/skills/skill-write-upload", + "metadata": { + "sidebarTitle": "上传技能" } }, "responses": { @@ -20542,7 +20091,1075 @@ "can_edit": true, "update_available": false, "is_modified": false, - "content": "---\nname: k8s-triage\ndescription: ...\n---\n# Triage steps" + "created": true + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/SkillUploadRequest" + }, + "example": { + "team_id": 0, + "replace": false + } + } + } + } + } + }, + "/schedule/create": { + "post": { + "operationId": "scheduleCreate", + "summary": "创建值班表", + "description": "创建新的值班表(分派策略值班表)。", + "tags": [ + "On-call/值班排班" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **值班管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/schedules/schedule-create", + "metadata": { + "sidebarTitle": "创建值班表" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/ScheduleIDResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "schedule_id": 6294534917601 + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScheduleUpsertRequest" + }, + "example": { + "schedule_name": "Production On-Call", + "description": "Primary on-call rotation for the production team", + "team_id": 4291079133131, + "layers": [ + { + "layer_name": "Layer 1", + "name": "Layer 1", + "mode": 0, + "weight": 0, + "hidden": 0, + "groups": [ + { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2451002751131 + ] + } + ], + "start": 0, + "end": 0 + }, + { + "group_name": "B", + "name": "B", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2476123212131 + ] + } + ], + "start": 0, + "end": 0 + } + ], + "rotation_unit": "day", + "rotation_value": 1, + "rotation_duration": 86400, + "handoff_time": 0, + "enable_time": 1712000000, + "expire_time": 0, + "restrict_mode": 0, + "restrict_start": 0, + "restrict_end": 0, + "restrict_periods": [], + "day_mask": { + "repeat": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + "fair_rotation": false, + "mask_continuous_enabled": false + } + ], + "notify": { + "advance_in_time": 300, + "fixed_time": null, + "by": { + "follow_preference": true, + "personal_channels": null + }, + "webhooks": null + } + } + } + } + } + } + }, + "/schedule/delete": { + "post": { + "operationId": "scheduleDelete", + "summary": "删除值班表", + "description": "根据 ID 删除一个或多个值班表。", + "tags": [ + "On-call/值班排班" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **值班管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/schedules/schedule-delete", + "metadata": { + "sidebarTitle": "删除值班表" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/ScheduleEmptyObject" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": {} + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScheduleIDsBodyRequest" + }, + "example": { + "schedule_ids": [ + 2001 + ] + } + } + } + } + } + }, + "/schedule/info": { + "post": { + "operationId": "scheduleInfo", + "summary": "获取值班表详情", + "description": "返回值班表的详细信息,并按照指定时间窗口(最多 45 天)返回计算出的值班分层。", + "tags": [ + "On-call/值班排班" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **值班查看**(`on-call`) 或 **值班管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/schedules/schedule-info", + "metadata": { + "sidebarTitle": "获取值班表详情" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/ScheduleItem" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "id": 5789640530410, + "name": "test-000001", + "account_id": 2451002751131, + "group_id": 4291079133131, + "disabled": 0, + "create_at": 1766110836, + "create_by": 2476123212131, + "update_at": 1775205795, + "update_by": 2476123212131, + "layers": [ + { + "account_id": 2451002751131, + "name": "Layer 1", + "schedule_id": 5789640530410, + "hidden": 0, + "mode": 0, + "weight": 0, + "groups": [ + { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 3122470302131 + ] + } + ], + "start": 0, + "end": 0 + }, + { + "group_name": "B", + "name": "B", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2659460982131 + ] + } + ], + "start": 0, + "end": 0 + } + ], + "rotation_duration": 86400, + "handoff_time": 0, + "enable_time": 1767542400, + "expire_time": 0, + "restrict_mode": 0, + "restrict_start": 0, + "restrict_end": 0, + "restrict_periods": [], + "day_mask": { + "repeat": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + "create_at": 1775205795, + "create_by": 2476123212131, + "update_at": 1775205795, + "update_by": 2476123212131, + "layer_name": "Layer 1", + "fair_rotation": false, + "layer_start": 1767542400, + "layer_end": null, + "rotation_unit": "day", + "rotation_value": 1, + "mask_continuous_enabled": false + } + ], + "schedule_layers": [ + { + "layer_name": "Layer 1", + "name": "Layer 1", + "mode": 0, + "schedules": [ + { + "start": 1776009600, + "end": 1776096000, + "group": { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 3122470302131 + ] + } + ], + "start": 1776009600, + "end": 1776096000 + }, + "index": 0 + }, + { + "start": 1776096000, + "end": 1776182400, + "group": { + "group_name": "B", + "name": "B", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2659460982131 + ] + } + ], + "start": 1776096000, + "end": 1776182400 + }, + "index": 0 + } + ] + } + ], + "final_schedule": { + "layer_name": "", + "name": "", + "mode": 0, + "schedules": [ + { + "start": 1776009600, + "end": 1776096000, + "group": { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 3122470302131 + ] + } + ], + "start": 1776009600, + "end": 1776096000 + }, + "index": 0 + } + ] + }, + "notify": { + "advance_in_time": 300, + "fixed_time": null, + "by": { + "follow_preference": false, + "personal_channels": [ + "email" + ] + }, + "webhooks": [ + { + "type": "feishu_app", + "settings": { + "token": "", + "alias": "", + "data_source_id": 5427276014131, + "chat_ids": [ + "oc_60a6dc4c6e4e5cbc4934ef08aa7ff76d" + ], + "verify_token": "", + "sign_secret": "" + } + } + ] + }, + "schedule_id": 5789640530410, + "schedule_name": "test-000001", + "team_id": 4291079133131, + "description": "abc", + "layer_schedules": [ + { + "layer_name": "Layer 1", + "name": "Layer 1", + "mode": 0, + "schedules": [ + { + "start": 1776009600, + "end": 1776096000, + "group": { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 3122470302131 + ] + } + ], + "start": 1776009600, + "end": 1776096000 + }, + "index": 0 + } + ] + } + ], + "status": 0, + "cur_oncall": { + "start": 1775972040, + "end": 1776009600, + "group": { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2451002751131 + ] + } + ], + "start": 1775972040, + "end": 1776009600 + }, + "update_at": 0, + "weight": 0, + "index": 0 + }, + "next_oncall": { + "start": 1776009600, + "end": 1776096000, + "group": { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 3122470302131 + ] + } + ], + "start": 1776009600, + "end": 1776096000 + }, + "update_at": 0, + "weight": 0, + "index": 0 + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScheduleInfoRequest" + }, + "example": { + "schedule_id": 2001, + "start": 1712000000, + "end": 1712086400 + } + } + } + } + } + }, + "/schedule/infos": { + "post": { + "operationId": "scheduleInfos", + "summary": "批量获取值班表", + "description": "根据 ID 列表批量返回值班表信息。", + "tags": [ + "On-call/值班排班" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **值班查看**(`on-call`) 或 **值班管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/schedules/schedule-infos", + "metadata": { + "sidebarTitle": "批量获取值班表" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/ScheduleSelfResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "items": [ + { + "id": 5789640530410, + "name": "test-000001", + "account_id": 2451002751131, + "group_id": 4291079133131, + "disabled": 0, + "create_at": 1766110836, + "create_by": 2476123212131, + "update_at": 1775205795, + "update_by": 2476123212131, + "layers": null, + "schedule_layers": null, + "final_schedule": { + "layer_name": "", + "name": "", + "mode": 0, + "schedules": null + }, + "notify": { + "advance_in_time": 300, + "fixed_time": null, + "by": { + "follow_preference": false, + "personal_channels": [ + "email" + ] + }, + "webhooks": [ + { + "type": "feishu_app", + "settings": { + "token": "", + "alias": "", + "data_source_id": 5427276014131, + "chat_ids": [ + "oc_60a6dc4c6e4e5cbc4934ef08aa7ff76d" + ], + "verify_token": "", + "sign_secret": "" + } + } + ] + }, + "schedule_id": 5789640530410, + "schedule_name": "test-000001", + "team_id": 4291079133131, + "description": "abc", + "layer_schedules": null, + "status": 0, + "cur_oncall": null, + "next_oncall": null + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScheduleIDsRequest" + }, + "example": { + "schedule_ids": [ + 2001, + 2002, + 2003 + ] + } + } + } + } + } + }, + "/schedule/list": { + "post": { + "operationId": "scheduleList", + "summary": "查询值班表列表", + "description": "返回值班表的分页列表。若同时传入 start 与 end(间隔不超过 45 天),响应会包含计算后的排班分层。", + "tags": [ + "On-call/值班排班" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/schedules/schedule-list", + "metadata": { + "sidebarTitle": "查询值班表列表" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/ScheduleListResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "items": [ + { + "id": 5789640530410, + "name": "test-000001", + "account_id": 2451002751131, + "group_id": 4291079133131, + "disabled": 0, + "create_at": 1766110836, + "create_by": 2476123212131, + "update_at": 1775205795, + "update_by": 2476123212131, + "layers": null, + "schedule_layers": null, + "final_schedule": { + "layer_name": "", + "name": "", + "mode": 0, + "schedules": null + }, + "notify": { + "advance_in_time": 300, + "fixed_time": null, + "by": { + "follow_preference": false, + "personal_channels": [ + "email" + ] + }, + "webhooks": [ + { + "type": "feishu_app", + "settings": { + "token": "", + "alias": "", + "data_source_id": 5427276014131, + "chat_ids": [ + "oc_60a6dc4c6e4e5cbc4934ef08aa7ff76d" + ], + "verify_token": "", + "sign_secret": "" + } + } + ] + }, + "schedule_id": 5789640530410, + "schedule_name": "test-000001", + "team_id": 4291079133131, + "description": "abc", + "layer_schedules": null, + "status": 0, + "cur_oncall": null, + "next_oncall": null + }, + { + "id": 5432326025106, + "name": "test-2509300001", + "account_id": 2451002751131, + "group_id": 2477033058131, + "disabled": 0, + "create_at": 1759132037, + "create_by": 2476123212131, + "update_at": 1775207501, + "update_by": 2476123212131, + "layers": null, + "schedule_layers": null, + "final_schedule": { + "layer_name": "", + "name": "", + "mode": 0, + "schedules": null + }, + "notify": { + "advance_in_time": 300, + "fixed_time": null, + "by": { + "follow_preference": true, + "personal_channels": null + }, + "webhooks": null + }, + "schedule_id": 5432326025106, + "schedule_name": "test-2509300001", + "team_id": 2477033058131, + "description": "", + "layer_schedules": null, + "status": 0, + "cur_oncall": null, + "next_oncall": null + } + ], + "total": 41 + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScheduleListRequest" + }, + "example": { + "p": 1, + "limit": 20, + "query": "production", + "is_my_team": true + } + } + } + } + } + }, + "/schedule/preview": { + "post": { + "operationId": "schedulePreview", + "summary": "预览值班表", + "description": "预览值班表配置生成的排班结果,不会持久化。请求体与创建/更新相同,并需要指定 start 和 end 时间窗口(最多 45 天)。", + "tags": [ + "On-call/值班排班" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **60 次/分钟**;**10 次/秒** |\n| 权限要求 | **值班查看**(`on-call`) 或 **值班管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/schedules/schedule-preview", + "metadata": { + "sidebarTitle": "预览值班表" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/ScheduleItem" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "id": null, + "name": null, + "account_id": 0, + "group_id": null, + "disabled": null, + "create_at": 0, + "create_by": 0, + "update_at": 0, + "update_by": 0, + "layers": [ + { + "account_id": 0, + "name": "Layer 1", + "schedule_id": 0, + "hidden": 0, + "mode": 0, + "weight": 0, + "groups": [ + { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2451002751131 + ] + } + ], + "start": 0, + "end": 0 + }, + { + "group_name": "B", + "name": "B", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2476123212131 + ] + } + ], + "start": 0, + "end": 0 + } + ], + "rotation_duration": 86400, + "handoff_time": 0, + "enable_time": 1775980800, + "expire_time": 0, + "restrict_mode": 0, + "restrict_start": 0, + "restrict_end": 0, + "restrict_periods": [], + "day_mask": { + "repeat": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + "create_at": 0, + "create_by": 0, + "update_at": 0, + "update_by": 0, + "layer_name": "Layer 1", + "fair_rotation": false, + "layer_start": 1775980800, + "layer_end": null, + "rotation_unit": "day", + "rotation_value": 1, + "mask_continuous_enabled": false + } + ], + "schedule_layers": [ + { + "layer_name": "Layer 1", + "name": "Layer 1", + "mode": 0, + "schedules": [ + { + "start": 1776009600, + "end": 1776096000, + "group": { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2451002751131 + ] + } + ], + "start": 1776009600, + "end": 1776096000 + }, + "index": 0 + }, + { + "start": 1776096000, + "end": 1776182400, + "group": { + "group_name": "B", + "name": "B", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2476123212131 + ] + } + ], + "start": 1776096000, + "end": 1776182400 + }, + "index": 0 + } + ] + } + ], + "final_schedule": { + "layer_name": "", + "name": "", + "mode": 0, + "schedules": [ + { + "start": 1776009600, + "end": 1776096000, + "group": { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2451002751131 + ] + } + ], + "start": 1776009600, + "end": 1776096000 + }, + "index": 0 + } + ] + }, + "start": 1775980800, + "end": 1776240000, + "notify": null, + "schedule_id": 0, + "schedule_name": null, + "team_id": null, + "description": null, + "layer_schedules": null, + "status": null, + "cur_oncall": null, + "next_oncall": null } } } @@ -20566,51 +21183,94 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillGetRequest" + "$ref": "#/components/schemas/ScheduleUpsertRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "schedule_name": "Preview Schedule", + "start": 1712000000, + "end": 1712086400, + "layers": [ + { + "layer_name": "Layer 1", + "name": "Layer 1", + "mode": 0, + "weight": 0, + "hidden": 0, + "groups": [ + { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2451002751131 + ] + } + ], + "start": 0, + "end": 0 + } + ], + "rotation_unit": "day", + "rotation_value": 1, + "rotation_duration": 86400, + "handoff_time": 0, + "enable_time": 1712000000, + "expire_time": 0, + "restrict_mode": 0, + "restrict_start": 0, + "restrict_end": 0, + "restrict_periods": [], + "day_mask": { + "repeat": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + "fair_rotation": false, + "mask_continuous_enabled": false + } + ] } } } } } }, - "/safari/skill/update": { + "/schedule/self": { "post": { - "operationId": "skill-write-update", - "summary": "更新技能", - "description": "更新技能的描述或重新分配团队范围。", + "operationId": "scheduleSelf", + "summary": "查询我的值班表", + "description": "返回当前用户被分配的值班表列表。", "tags": [ - "AI SRE/技能" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/值班排班" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 仅 `description` 与 `team_id` 可编辑;技能正文需通过重新上传修改。\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/skills/skill-write-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **值班查看**(`on-call`) 或 **值班管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/schedules/schedule-self", "metadata": { - "sidebarTitle": "更新技能" + "sidebarTitle": "查询我的值班表" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SkillItem" + "$ref": "#/components/schemas/ScheduleSelfResponse" } } } @@ -20619,28 +21279,107 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", - "account_id": 10023, - "team_id": 0, - "skill_name": "k8s-triage", - "description": "Updated triage runbook.", - "version": "1.2.0", - "tags": [ - "kubernetes", - "triage" - ], - "author": "sre-team", - "tools": [ - "bash", - "mcp:prometheus/query" - ], - "status": "enabled", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "can_edit": true, - "update_available": false, - "is_modified": false + "items": [ + { + "id": 2539108069860, + "name": "Open Source Q&A", + "account_id": 2451002751131, + "group_id": 2477033058131, + "disabled": 0, + "create_at": 1702623874, + "create_by": 2451002751131, + "update_at": 1710468081, + "update_by": 2476444212131, + "layers": [ + { + "account_id": 2451002751131, + "name": "Rule 1", + "schedule_id": 2539108069860, + "hidden": 0, + "mode": 0, + "weight": 0, + "groups": [ + { + "group_name": "A", + "name": "A", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2476444212131 + ] + } + ], + "start": 0, + "end": 0 + }, + { + "group_name": "B", + "name": "B", + "members": [ + { + "role_id": 0, + "person_ids": [ + 2469167612131 + ] + } + ], + "start": 0, + "end": 0 + } + ], + "rotation_duration": 86400, + "handoff_time": 0, + "enable_time": 1702623874, + "expire_time": 0, + "restrict_mode": 0, + "restrict_start": 0, + "restrict_end": 0, + "restrict_periods": [], + "day_mask": { + "repeat": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + "create_at": 1702623874, + "create_by": 2451002751131, + "update_at": 1710468081, + "update_by": 2476444212131, + "layer_name": "Rule 1", + "fair_rotation": false, + "layer_start": 1702623874, + "layer_end": null, + "rotation_unit": "day", + "rotation_value": 1, + "mask_continuous_enabled": false + } + ], + "schedule_layers": null, + "final_schedule": { + "layer_name": "", + "name": "", + "mode": 0, + "schedules": null + }, + "notify": { + "fixed_time": null, + "by": null, + "webhooks": null + }, + "schedule_id": 2539108069860, + "schedule_name": "Open Source Q&A", + "team_id": 2477033058131, + "description": "", + "layer_schedules": null, + "status": 0, + "cur_oncall": null, + "next_oncall": null + } + ] } } } @@ -20652,9 +21391,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -20667,53 +21403,47 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillUpdateRequest" + "$ref": "#/components/schemas/ScheduleSelfRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", - "description": "Updated triage runbook." + "start": 1712000000, + "end": 1712086400 } } } } } }, - "/safari/skill/delete": { + "/schedule/update": { "post": { - "operationId": "skill-write-delete", - "summary": "删除技能", - "description": "按 ID 删除技能。", + "operationId": "scheduleUpdate", + "summary": "更新值班表", + "description": "更新已有的值班表,需要通过 schedule_id 指定值班表。", "tags": [ - "AI SRE/技能" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/值班排班" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/skills/skill-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **值班管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/schedules/schedule-update", "metadata": { - "sidebarTitle": "删除技能" + "sidebarTitle": "更新值班表" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/ScheduleEmptyObject" } } } @@ -20721,7 +21451,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": {} } } } @@ -20732,9 +21462,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -20747,51 +21474,49 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillDeleteRequest" + "$ref": "#/components/schemas/ScheduleUpsertRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "schedule_id": 2001, + "schedule_name": "Production On-Call (Updated)", + "description": "Updated primary on-call rotation", + "team_id": 4291079133131 } } } } } }, - "/safari/skill/upload": { + "/sourcemap/list": { "post": { - "operationId": "skill-write-upload", - "summary": "上传技能", - "description": "上传技能压缩包(.skill/.zip/.tar.gz/.tgz)以创建或覆盖技能。", + "operationId": "sourcemap-read-list", + "summary": "查询 Sourcemap 列表", + "description": "分页返回已上传的 Sourcemap 文件列表,可按平台类型、服务和版本过滤。", "tags": [ - "AI SRE/技能" - ], - "security": [ - { - "AppKeyAuth": [] - } + "RUM/RUM Sourcemap" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **30 次/分钟**;**3 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 以 `multipart/form-data` 提交,包含 `file` 部分。压缩包最大 100MB。\n- 设置 `replace=true` 可覆盖同名技能。\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/skills/skill-write-upload", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `start_time` 和 `end_time` 为必填字段,均使用 Unix 时间戳(**毫秒**),最大时间跨度 365 天。\n- `type` 字段用于选择平台:`browser`(JavaScript)、`android` 或 `ios`。省略时默认为 `browser`。\n- 默认每页 20 条,最大 100 条,默认按 `created_at` 倒序排列。\n- Android 平台可用 `build_id` 匹配 Gradle 插件的构建标识;iOS 平台可用 `uuid` 匹配 dSYM bundle UUID。", + "href": "/zh/api-reference/rum/sourcemaps/sourcemap-read-list", "metadata": { - "sidebarTitle": "上传技能" + "sidebarTitle": "查询 Sourcemap 列表" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SkillItem" + "$ref": "#/components/schemas/SourcemapListResponse" } } } @@ -20800,110 +21525,22 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", - "account_id": 10023, - "team_id": 0, - "skill_name": "k8s-triage", - "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", - "version": "1.2.0", - "tags": [ - "kubernetes", - "triage" - ], - "author": "sre-team", - "tools": [ - "bash", - "mcp:prometheus/query" - ], - "status": "enabled", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "can_edit": true, - "update_available": false, - "is_modified": false, - "created": true - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/SkillUploadRequest" - }, - "example": { - "team_id": 0, - "replace": false - } - } - } - } - } - }, - "/safari/skill/enable": { - "post": { - "operationId": "skill-read-enable", - "summary": "启用技能", - "description": "启用已禁用的技能,使智能体可加载。", - "tags": [ - "AI SRE/技能" - ], - "security": [ - { - "AppKeyAuth": [] - } - ], - "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 仅可启用 `disabled` 状态的技能,否则返回 InvalidParameter。\n", - "href": "/zh/api-reference/ai-sre/skills/skill-read-enable", - "metadata": { - "sidebarTitle": "启用技能" - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ResponseEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "type": "null", - "description": "成功时恒为 null。" - } + "total": 3, + "items": [ + { + "key": "browser/my-web-app/1.0.0/main.js.map", + "type": "browser", + "service": "my-web-app", + "version": "1.0.0", + "size": 204800, + "git_repository_url": "https://github.com/example/my-web-app", + "git_commit_sha": "abc1234def5678", + "created_at": 1712700000, + "updated_at": 1712700000, + "metadata": {} } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + ] + } } } } @@ -20914,9 +21551,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -20929,52 +21563,53 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillStatusRequest" + "$ref": "#/components/schemas/SourcemapListRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "start_time": 1712000000000, + "end_time": 1712700000000, + "type": "browser", + "services": [ + "my-web-app" + ], + "p": 1, + "limit": 20 } } } } } }, - "/safari/skill/disable": { - "post": { - "operationId": "skill-write-disable", - "summary": "禁用技能", - "description": "禁用已启用的技能,使智能体不再加载。", + "/status-page/change/active/list": { + "get": { + "operationId": "statusPageChangeActiveList", + "summary": "查询状态页活跃事件列表", + "description": "查询状态页指定类型的进行中(非终态)事件列表。", "tags": [ - "AI SRE/技能" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 仅可禁用 `enabled` 状态的技能,否则返回 InvalidParameter。\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/skills/skill-write-disable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/status-pages/status-page-change-active-list", "metadata": { - "sidebarTitle": "禁用技能" + "sidebarTitle": "查询状态页活跃事件列表" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/StatusPageChangeListResponse" } } } @@ -20982,7 +21617,45 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "items": [ + { + "change_id": 5821693893131, + "page_id": 5750613685214, + "type": "incident", + "title": "Web Console Degraded Performance", + "description": "We are currently investigating an issue affecting some services.", + "status": "investigating", + "affected_components": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", + "name": "Web Console", + "available_since_seconds": 1765349358, + "order_id": 1, + "status": "degraded" + } + ], + "start_at_seconds": 1766736878, + "updates": [ + { + "update_id": "01KDCVJQ88SZPHWPTDV2Z2AZW8", + "at_seconds": 1766736876, + "status": "investigating", + "description": "We are currently investigating an issue affecting some services.", + "component_changes": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "component_name": "Web Console", + "status": "degraded" + } + ] + } + ], + "notify_subscribers": true + } + ] + } } } } @@ -20993,9 +21666,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -21003,56 +21673,63 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SkillStatusRequest" - }, - "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" - } - } + "parameters": [ + { + "name": "page_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "状态页 ID。" + }, + { + "name": "type", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "incident", + "maintenance" + ] + }, + "description": "事件类型筛选,必填。仅返回进行中(非终态)事件:incident 含 investigating/identified/monitoring,maintenance 含 scheduled/ongoing。" } - } + ] } }, - "/safari/mcp/server/list": { + "/status-page/change/create": { "post": { - "operationId": "mcp-read-server-list", - "summary": "查询 MCP 服务器列表", - "description": "分页查询调用者在账户与团队范围内可见的 MCP 服务器。", + "operationId": "statusPageChangeCreate", + "summary": "创建状态页事件", + "description": "在状态页上创建新的故障或维护事件。", "tags": [ - "AI SRE/MCP 服务器" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 列表不含实时工具列表;如需探测工具请单独查询某个服务器。\n", - "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-read-server-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面事件管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-change-create", "metadata": { - "sidebarTitle": "查询 MCP 服务器列表" + "sidebarTitle": "创建状态页事件" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerListResponse" + "$ref": "#/components/schemas/StatusPageChangeCreateResponse" } } } @@ -21061,37 +21738,8 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 1, - "servers": [ - { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ - { - "name": "query", - "description": "Run a PromQL instant query." - }, - { - "name": "query_range", - "description": "Run a PromQL range query." - } - ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 - } - ] + "change_id": 6294539747131, + "change_name": "API Test Incident" } } } @@ -21115,53 +21763,64 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerListRequest" + "$ref": "#/components/schemas/CreateStatusPageChangeRequest" }, "example": { - "p": 1, - "limit": 20, - "include_account": true + "page_id": 5750613685214, + "type": "incident", + "title": "Web Console Degraded Performance", + "description": "We are investigating degraded performance affecting the web console.", + "status": "investigating", + "start_at_seconds": 1712000000, + "notify_subscribers": true, + "updates": [ + { + "status": "investigating", + "description": "We are currently investigating an issue affecting some users.", + "component_changes": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "status": "degraded" + } + ] + } + ] } } } } } }, - "/safari/mcp/server/create": { + "/status-page/change/delete": { "post": { - "operationId": "mcp-write-server-create", - "summary": "创建 MCP 服务器", - "description": "在账户下注册新的 MCP 服务器(连接器)。", + "operationId": "statusPageChangeDelete", + "summary": "删除状态页事件", + "description": "删除指定的状态页事件。", "tags": [ - "AI SRE/MCP 服务器" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- `command`/`args`/`env` 用于 `stdio`;`url`/`headers` 用于 `sse`/`streamable-http`。\n- 服务器名称在账户内必须唯一,重复将返回 InvalidParameter。\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面事件管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-change-delete", "metadata": { - "sidebarTitle": "创建 MCP 服务器" + "sidebarTitle": "删除状态页事件" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -21169,34 +21828,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ - { - "name": "query", - "description": "Run a PromQL instant query." - }, - { - "name": "query_range", - "description": "Run a PromQL range query." - } - ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 - } + "data": {} } } } @@ -21207,9 +21839,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -21222,55 +21851,47 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerCreateRequest" + "$ref": "#/components/schemas/DeleteStatusPageChangeRequest" }, "example": { - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled" + "page_id": 5750613685214, + "change_id": 5821693893131 } } } } } }, - "/safari/mcp/server/get": { - "post": { - "operationId": "mcp-read-server-get", - "summary": "查看 MCP 服务器详情", - "description": "查看单个 MCP 服务器并实时探测其工具列表。", + "/status-page/change/info": { + "get": { + "operationId": "statusPageChangeInfo", + "summary": "获取状态页事件详情", + "description": "获取状态页指定事件(故障或维护)的详细信息。", "tags": [ - "AI SRE/MCP 服务器" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 详情接口会实时探测工具;探测失败时设置 `list_error`,请求本身仍成功。\n", - "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-read-server-get", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/status-pages/status-page-change-info", "metadata": { - "sidebarTitle": "查看 MCP 服务器详情" + "sidebarTitle": "获取状态页事件详情" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerItem" + "$ref": "#/components/schemas/StatusPageChangeItem" } } } @@ -21279,32 +21900,53 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ + "change_id": 5821693893131, + "page_id": 5750613685214, + "type": "incident", + "title": "Web Console Degraded Performance", + "description": "The issue has been resolved, and all services are operating normally.\n\nThank you for your patience.", + "status": "resolved", + "affected_components": [ { - "name": "query", - "description": "Run a PromQL instant query." + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", + "name": "Web Console", + "available_since_seconds": 1765349358, + "order_id": 1, + "status": "operational" + } + ], + "start_at_seconds": 1766736878, + "close_at_seconds": 1775529742, + "updates": [ + { + "update_id": "01KDCVJQ88SZPHWPTDV2Z2AZW8", + "at_seconds": 1766736876, + "status": "investigating", + "description": "We are currently investigating an issue affecting some services.", + "component_changes": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "component_name": "Web Console", + "status": "degraded" + } + ] }, { - "name": "query_range", - "description": "Run a PromQL range query." + "update_id": "01KNJX3KW873ZZSRZC14SGFYS3", + "at_seconds": 1775529742, + "status": "resolved", + "description": "The issue has been resolved, and all services are operating normally.", + "component_changes": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "component_name": "Web Console", + "status": "operational" + } + ] } ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 + "notify_subscribers": true } } } @@ -21323,56 +21965,60 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MCPServerGetRequest" - }, - "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" - } - } + "parameters": [ + { + "name": "page_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Status page ID." + }, + { + "name": "change_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Event (change) ID." } - } + ] } }, - "/safari/mcp/server/update": { - "post": { - "operationId": "mcp-write-server-update", - "summary": "更新 MCP 服务器", - "description": "更新 MCP 服务器配置;省略字段表示不变。", + "/status-page/change/list": { + "get": { + "operationId": "statusPageChangeList", + "summary": "查询状态页事件列表", + "description": "查询状态页的事件列表(故障和维护)。", "tags": [ - "AI SRE/MCP 服务器" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- `env`/`headers` 中的脱敏密钥会被保留——回传脱敏值不会覆盖已存储的真实密钥。\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/status-pages/status-page-change-list", "metadata": { - "sidebarTitle": "更新 MCP 服务器" + "sidebarTitle": "查询状态页事件列表" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerItem" + "$ref": "#/components/schemas/StatusPageChangeListResponse" } } } @@ -21381,32 +22027,57 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics, alerts, and rules.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ - { - "name": "query", - "description": "Run a PromQL instant query." - }, + "items": [ { - "name": "query_range", - "description": "Run a PromQL range query." + "change_id": 5821693893131, + "page_id": 5750613685214, + "type": "incident", + "title": "Web Console Degraded Performance", + "description": "The issue has been resolved, and all services are operating normally.", + "status": "resolved", + "affected_components": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", + "name": "Web Console", + "available_since_seconds": 1765349358, + "order_id": 1, + "status": "operational" + } + ], + "start_at_seconds": 1766736878, + "close_at_seconds": 1775529742, + "updates": [ + { + "update_id": "01KDCVJQ88SZPHWPTDV2Z2AZW8", + "at_seconds": 1766736876, + "status": "investigating", + "description": "We are currently investigating an issue affecting some services.", + "component_changes": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "component_name": "Web Console", + "status": "degraded" + } + ] + }, + { + "update_id": "01KNJX3KW873ZZSRZC14SGFYS3", + "at_seconds": 1775529742, + "status": "resolved", + "description": "The issue has been resolved, and all services are operating normally.", + "component_changes": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "component_name": "Web Console", + "status": "operational" + } + ] + } + ], + "notify_subscribers": true } - ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 + ] } } } @@ -21418,9 +22089,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -21428,58 +22096,101 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MCPServerUpdateRequest" - }, - "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "description": "Query Prometheus metrics, alerts, and rules." - } - } - } - } - } - }, - "/safari/mcp/server/delete": { - "post": { - "operationId": "mcp-write-server-delete", - "summary": "删除 MCP 服务器", - "description": "按 ID 删除 MCP 服务器。", - "tags": [ - "AI SRE/MCP 服务器" - ], - "security": [ + "parameters": [ { - "AppKeyAuth": [] + "name": "page_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Status page ID." + }, + { + "name": "start_at_seconds", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Filter events started at or after this unix timestamp (seconds)." + }, + { + "name": "end_at_seconds", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Filter events started at or before this unix timestamp (seconds)." + }, + { + "name": "type", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "incident", + "maintenance" + ] + }, + "description": "Event type filter. Required." + }, + { + "name": "status", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "investigating", + "identified", + "monitoring", + "resolved", + "scheduled", + "ongoing", + "completed" + ] + }, + "description": "Event status filter. Required. Must be a status valid for the given `type` (e.g. `investigating`/`identified`/`monitoring`/`resolved` for incidents; `scheduled`/`ongoing`/`completed` for maintenances)." } + ] + } + }, + "/status-page/change/timeline/create": { + "post": { + "operationId": "statusPageChangeTimelineCreate", + "summary": "创建事件时间线", + "description": "在状态页事件上添加时间线更新。", + "tags": [ + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面事件管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-change-timeline-create", "metadata": { - "sidebarTitle": "删除 MCP 服务器" + "sidebarTitle": "创建事件时间线" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/StatusPageChangeTimelineCreateResponse" } } } @@ -21487,7 +22198,9 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "update_id": "01KP0311872NVYFRRQ82FWXAP4" + } } } } @@ -21498,9 +22211,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -21513,52 +22223,56 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerDeleteRequest" + "$ref": "#/components/schemas/CreateStatusPageChangeTimelineRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" + "page_id": 5750613685214, + "change_id": 5821693893131, + "status": "identified", + "description": "We have identified the root cause and are working on a fix.", + "at_seconds": 1712003600, + "component_changes": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "status": "partial_outage" + } + ] } } } } } }, - "/safari/mcp/server/enable": { + "/status-page/change/timeline/delete": { "post": { - "operationId": "mcp-write-server-enable", - "summary": "启用 MCP 服务器", - "description": "启用已禁用的 MCP 服务器。", + "operationId": "statusPageChangeTimelineDelete", + "summary": "删除事件时间线", + "description": "从状态页事件中删除时间线条目。", "tags": [ - "AI SRE/MCP 服务器" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-enable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面事件管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-change-timeline-delete", "metadata": { - "sidebarTitle": "启用 MCP 服务器" + "sidebarTitle": "删除事件时间线" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -21566,7 +22280,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": {} } } } @@ -21577,9 +22291,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -21592,52 +22303,48 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerStatusRequest" + "$ref": "#/components/schemas/DeleteStatusPageChangeTimelineRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" + "page_id": 5750613685214, + "change_id": 5821693893131, + "update_id": "01KP0311872NVYFRRQ82FWXAP4" } } } } } }, - "/safari/mcp/server/disable": { + "/status-page/change/timeline/update": { "post": { - "operationId": "mcp-write-server-disable", - "summary": "禁用 MCP 服务器", - "description": "禁用已启用的 MCP 服务器。", + "operationId": "statusPageChangeTimelineUpdate", + "summary": "更新事件时间线", + "description": "更新状态页事件的时间线条目。", "tags": [ - "AI SRE/MCP 服务器" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-disable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面事件管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-change-timeline-update", "metadata": { - "sidebarTitle": "禁用 MCP 服务器" + "sidebarTitle": "更新事件时间线" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -21645,7 +22352,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": {} } } } @@ -21656,9 +22363,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -21671,51 +22375,50 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerStatusRequest" + "$ref": "#/components/schemas/UpdateStatusPageChangeTimelineRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" + "page_id": 5750613685214, + "change_id": 5821693893131, + "update_id": "01KP0311872NVYFRRQ82FWXAP4", + "description": "Corrected description: root cause identified in database layer.", + "at_seconds": 1712003600 } } } } } }, - "/safari/a2a-agent/create": { + "/status-page/change/update": { "post": { - "operationId": "remote-agent-write-create", - "summary": "创建 A2A 智能体", - "description": "通过智能体卡片 URL 注册新的 A2A 远程智能体。", + "operationId": "statusPageChangeUpdate", + "summary": "更新状态页事件", + "description": "更新已有状态页事件。", "tags": [ - "AI SRE/A2A 智能体" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- `card_url` 必须可解析为有效的智能体卡片;无法访问或无效的卡片返回 InvalidParameter。\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面事件管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-change-update", "metadata": { - "sidebarTitle": "创建 A2A 智能体" + "sidebarTitle": "更新状态页事件" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/A2AAgentCreateResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -21723,9 +22426,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" - } + "data": {} } } } @@ -21736,9 +22437,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -21751,56 +22449,48 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentCreateRequest" + "$ref": "#/components/schemas/UpdateStatusPageChangeRequest" }, "example": { - "agent_name": "deploy-bot", - "instructions": "当需要检查部署流水线或给出回滚建议时使用。", - "card_url": "https://agents.example.com/deploy-bot/card", - "auth_type": "bearer", - "streaming": true, - "team_id": 0 + "page_id": 5750613685214, + "change_id": 5821693893131, + "title": "Web Console Degraded Performance (Updated)" } } } } } }, - "/safari/a2a-agent/list": { + "/status-page/component/delete": { "post": { - "operationId": "remote-agent-read-list", - "summary": "查询 A2A 智能体列表", - "description": "分页查询调用者在账户与团队范围内可见的 A2A 智能体。", + "operationId": "statusPageComponentDelete", + "summary": "删除状态页组件", + "description": "从状态页删除服务组件。", "tags": [ - "AI SRE/A2A 智能体" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 分页使用 `offset`/`limit`(而非 `p`/`limit`)。\n", - "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-component-delete", "metadata": { - "sidebarTitle": "查询 A2A 智能体列表" + "sidebarTitle": "删除状态页组件" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/A2AAgentListResponse" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -21808,34 +22498,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "agent_name": "deploy-bot", - "card_url": "https://agents.example.com/deploy-bot/card", - "auth_type": "bearer", - "streaming": true, - "status": "enabled", - "agent_card_name": "Deploy Bot", - "agent_card_skills": [ - "rollback", - "diff" - ], - "card_resolve_timeout": 10, - "task_timeout": 120, - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "instructions": "Remote agent that inspects deployment pipelines." - } - ], - "total": 1 - } + "data": {} } } } @@ -21858,53 +22521,49 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentListRequest" + "$ref": "#/components/schemas/DeleteStatusPageComponentRequest" }, "example": { - "offset": 0, - "limit": 20, - "include_account": true + "page_id": 5750613685214, + "component_ids": [ + "01KP032KMN9YFBMPWANJMFZFG1" + ] } } } } } }, - "/safari/a2a-agent/get": { + "/status-page/component/upsert": { "post": { - "operationId": "remote-agent-read-get", - "summary": "查看 A2A 智能体详情", - "description": "按 ID 查看单个 A2A 智能体。", + "operationId": "statusPageComponentUpsert", + "summary": "创建或更新状态页组件", + "description": "在状态页上创建或更新服务组件。", "tags": [ - "AI SRE/A2A 智能体" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", - "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-read-get", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-component-upsert", "metadata": { - "sidebarTitle": "查看 A2A 智能体详情" + "sidebarTitle": "创建或更新状态页组件" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/A2AAgentItem" + "$ref": "#/components/schemas/UpsertStatusPageComponentResponse" } } } @@ -21913,27 +22572,9 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "agent_name": "deploy-bot", - "card_url": "https://agents.example.com/deploy-bot/card", - "auth_type": "bearer", - "streaming": true, - "status": "enabled", - "agent_card_name": "Deploy Bot", - "agent_card_skills": [ - "rollback", - "diff" - ], - "card_resolve_timeout": 10, - "task_timeout": 120, - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "instructions": "Remote agent that inspects deployment pipelines." + "component_ids": [ + "01KP032KMN9YFBMPWANJMFZFG1" + ] } } } @@ -21957,52 +22598,54 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" + "$ref": "#/components/schemas/UpsertStatusPageComponentRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "page_id": 5750613685214, + "components": [ + { + "name": "Web Console", + "description": "Main web interface", + "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", + "order_id": 1 + } + ] } } } } } }, - "/safari/a2a-agent/update": { + "/status-page/create": { "post": { - "operationId": "remote-agent-write-update", - "summary": "更新 A2A 智能体", - "description": "对 A2A 智能体执行部分更新;省略字段表示不变。", + "operationId": "statusPageCreate", + "summary": "创建状态页", + "description": "创建一个新的状态页。", "tags": [ - "AI SRE/A2A 智能体" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-create", "metadata": { - "sidebarTitle": "更新 A2A 智能体" + "sidebarTitle": "创建状态页" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -22010,7 +22653,11 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "page_id": 6294565612043, + "page_name": "My Status Page", + "page_url_name": "my-status-page" + } } } } @@ -22021,9 +22668,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -22036,53 +22680,50 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentUpdateRequest" + "$ref": "#/components/schemas/EmptyRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", - "instructions": "检查部署流水线并给出回滚步骤。" + "name": "My Status Page", + "url_name": "my-status-page", + "type": "public", + "page_header": "Welcome to our status page", + "contact_info": "mailto:support@example.com" } } } } } }, - "/safari/a2a-agent/enable": { + "/status-page/delete": { "post": { - "operationId": "remote-agent-write-enable", - "summary": "启用 A2A 智能体", - "description": "启用已禁用的 A2A 智能体。", + "operationId": "statusPageDelete", + "summary": "删除状态页", + "description": "删除指定的状态页。", "tags": [ - "AI SRE/A2A 智能体" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-enable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-delete", "metadata": { - "sidebarTitle": "启用 A2A 智能体" + "sidebarTitle": "删除状态页" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -22090,7 +22731,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": {} } } } @@ -22101,9 +22742,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -22116,52 +22754,46 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" + "$ref": "#/components/schemas/EmptyRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "page_id": 5750613685214 } } } } } }, - "/safari/a2a-agent/disable": { - "post": { - "operationId": "remote-agent-write-disable", - "summary": "禁用 A2A 智能体", - "description": "禁用已启用的 A2A 智能体。", + "/status-page/info": { + "get": { + "operationId": "statusPageInfo", + "summary": "获取状态页详情", + "description": "获取指定状态页的详细配置信息。", "tags": [ - "AI SRE/A2A 智能体" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-disable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/status-pages/status-page-info", "metadata": { - "sidebarTitle": "禁用 A2A 智能体" + "sidebarTitle": "获取状态页详情" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -22169,86 +22801,50 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" - }, - "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" - } - } - } - } - } - }, - "/safari/a2a-agent/delete": { - "post": { - "operationId": "remote-agent-write-delete", - "summary": "删除 A2A 智能体", - "description": "按 ID 软删除 A2A 智能体。", - "tags": [ - "AI SRE/A2A 智能体" - ], - "security": [ - { - "AppKeyAuth": [] - } - ], - "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-delete", - "metadata": { - "sidebarTitle": "删除 A2A 智能体" - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ResponseEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "type": "null", - "description": "成功时恒为 null。" - } + "data": { + "page_id": 5750613685214, + "name": "Flashduty Status Page", + "url_name": "flashduty-statuspage", + "type": "public", + "custom_domain": "status.example.com", + "logo": "https://cdn.example.com/logo.png", + "favicon": "https://cdn.example.com/favicon.png", + "page_header": "Welcome to our status page", + "page_footer": "2025 Example Corp", + "date_view": "list", + "display_uptime_mode": "chart_and_percentage", + "custom_links": [ + { + "key": "Documentation", + "value": "https://docs.example.com" + } + ], + "contact_info": "mailto:support@example.com", + "components": [ + { + "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", + "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", + "name": "Web Console", + "available_since_seconds": 1765349358, + "order_id": 1 + } + ], + "sections": [ + { + "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", + "name": "Core Services", + "description": "Our core services", + "order_id": 1, + "hide_uptime": false, + "hide_all": false } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + ], + "subscription": { + "email": true, + "im": false + }, + "template_preference": "message" + } } } } @@ -22259,9 +22855,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -22269,39 +22862,32 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" - }, - "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" - } - } + "parameters": [ + { + "name": "page_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + }, + "description": "Status page ID" } - } + ] } }, - "/safari/session/list": { - "post": { - "operationId": "session-read-list", - "summary": "查询会话列表", - "description": "分页查询调用者可见的智能体会话,可按应用、入口、归档状态与团队过滤。", + "/status-page/list": { + "get": { + "operationId": "status-page-read-page-list", + "summary": "查询状态页列表", + "description": "查询账户下所有状态页,包含其组件与分组。", "tags": [ - "AI SRE/会话" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 分页使用 `p`/`limit`(最大 100);`scope` 默认 `all`(本人 + 所属团队)。\n- `is_running` 反映实时运行集合;`has_unread` 按调用者各自计算。\n", - "href": "/zh/api-reference/ai-sre/sessions/session-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", + "href": "/zh/api-reference/on-call/status-pages/status-page-read-page-list", "metadata": { - "sidebarTitle": "查询会话列表" + "sidebarTitle": "查询状态页列表" } }, "responses": { @@ -22312,13 +22898,13 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SessionListResponse" + "$ref": "#/components/schemas/ListStatusPageResponse" } } } @@ -22327,34 +22913,49 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 988, - "sessions": [ + "items": [ { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "session_name": "Investigate cloud-assistant first heartbeat", - "app_name": "ai-sre", - "entry_kind": "web", - "person_id": "3790925372131", - "team_id": 0, - "is_mine": false, - "can_manage": true, - "status": "enabled", - "incognito": false, - "created_at": 1780367971228, - "updated_at": 1780367993457, - "token_usage": { - "input_tokens": 14948, - "cached_tokens": 11520, - "output_tokens": 888, - "reasoning_tokens": 351 - }, - "current_context_tokens": 14948, - "context_window": 0, - "archived_at": 0, - "pinned_at": 0, - "last_event_at": 1780367992649, - "is_running": false, - "has_unread": true + "page_id": 7001, + "name": "Acme Status", + "url_name": "acme", + "type": "public", + "custom_domain": "status.acme.com", + "logo_url": "https://acme.com", + "page_header": "Acme System Status", + "date_view": "calendar", + "display_uptime_mode": "chart_and_percentage", + "custom_links": [ + { + "name": "Home", + "url": "https://acme.com" + } + ], + "contact_info": "mailto:support@acme.com", + "components": [ + { + "component_id": "cmp_001", + "section_id": "sec_001", + "name": "API", + "description": "Core API service", + "available_since_seconds": 1716962400, + "order_id": 1, + "hide_uptime": false, + "hide_all": false + } + ], + "sections": [ + { + "section_id": "sec_001", + "name": "Core Services", + "order_id": 1, + "hide_uptime": false, + "hide_all": false + } + ], + "subscription": { + "email": true, + "im": false + } } ] } @@ -22374,60 +22975,39 @@ "500": { "$ref": "#/components/responses/ServerError" } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SessionListRequest" - }, - "example": { - "app_name": "ai-sre", - "limit": 2, - "orderby": "updated_at", - "scope": "all" - } - } - } } } }, - "/safari/session/get": { + "/status-page/migrate-email-subscribers": { "post": { - "operationId": "session-read-info", - "summary": "查看会话详情", - "description": "查看单个会话,并返回其最近事件的一页(向更早方向分页)。", + "operationId": "statusPageMigrateEmailSubscribers", + "summary": "迁移邮件订阅者", + "description": "启动迁移任务,从 Atlassian Statuspage 将邮件订阅者导入到已有的 Flashduty 状态页。", "tags": [ - "AI SRE/会话" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 使用上一次响应的 `search_after_ctx` 翻阅更早的历史。\n- `limit`(或旧版 `num_recent_events`)限制事件页大小;默认 100,最大 1000。\n", - "href": "/zh/api-reference/ai-sre/sessions/session-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-migrate-email-subscribers", "metadata": { - "sidebarTitle": "查看会话详情" + "sidebarTitle": "迁移邮件订阅者" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SessionGetResponse" + "$ref": "#/components/schemas/StatusPageMigrationStartResponse" } } } @@ -22436,62 +23016,7 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "session": { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "session_name": "Investigate cloud-assistant first heartbeat", - "app_name": "ai-sre", - "entry_kind": "web", - "person_id": "3790925372131", - "team_id": 0, - "is_mine": false, - "can_manage": true, - "status": "enabled", - "incognito": false, - "created_at": 1780367971228, - "updated_at": 1780367993457, - "token_usage": { - "input_tokens": 14948, - "cached_tokens": 11520, - "output_tokens": 888, - "reasoning_tokens": 351 - }, - "current_context_tokens": 14948, - "context_window": 0, - "archived_at": 0, - "pinned_at": 0, - "last_event_at": 1780367992649, - "is_running": false, - "has_unread": true - }, - "events": [ - { - "event_id": "evt_3aZQ9p", - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "author": "user", - "partial": false, - "turn_complete": false, - "status": "normal", - "created_at": 1780367971241 - }, - { - "event_id": "evt_7bWk2r", - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "author": "ai-sre", - "content": { - "role": "model", - "parts": [ - { - "text": "..." - } - ] - }, - "partial": false, - "turn_complete": true, - "status": "normal", - "created_at": 1780367992649 - } - ], - "has_more_older": false + "job_id": "01KP0311872NVYFRRQ82FW0002" } } } @@ -22515,45 +23040,58 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SessionGetRequest" + "$ref": "#/components/schemas/MigrateStatusPageEmailSubscribersRequest" }, "example": { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "num_recent_events": 50 + "api_key": "sk-stsp-xxxxxxxxxxxxxxxxxxxx", + "source_page_id": "abcdefghij", + "target_page_id": 5750613685214 } } } } } }, - "/safari/session/export": { + "/status-page/migrate-structure": { "post": { - "operationId": "session-read-export", - "summary": "导出会话记录", - "description": "以换行分隔的 JSON(NDJSON)流式导出会话的完整事件记录。", + "operationId": "statusPageMigrateStructure", + "summary": "迁移状态页结构", + "description": "启动迁移任务,从 Atlassian Statuspage 导入结构和历史事件到新的 Flashduty 状态页。", "tags": [ - "AI SRE/会话" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 响应为 `application/x-ndjson`——请逐行解析并写入文件,切勿将整段记录读入内存。\n- 第一行始终为 `session_meta` 信封;`include_subagents=true` 会在派发行后内联各子会话的事件流。\n", - "href": "/zh/api-reference/ai-sre/sessions/session-read-export", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-migrate-structure", "metadata": { - "sidebarTitle": "导出会话记录" + "sidebarTitle": "迁移状态页结构" } }, "responses": { "200": { - "description": "流式 NDJSON(application/x-ndjson)。每行一个 JSON 对象,以换行结束。第一行始终为 `session_meta` 信封,其后为会话事件。", + "description": "成功", "content": { - "application/x-ndjson": { + "application/json": { "schema": { - "type": "string", - "description": "换行分隔的 JSON 流。请逐行解析,切勿缓冲整个响应体。" + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/StatusPageMigrationStartResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "job_id": "01KP0311872NVYFRRQ82FW0001" + } } } } @@ -22576,53 +23114,47 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SessionExportRequest" + "$ref": "#/components/schemas/MigrateStatusPageStructureRequest" }, "example": { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "include_subagents": false + "api_key": "sk-stsp-xxxxxxxxxxxxxxxxxxxx", + "source_page_id": "abcdefghij" } } } } } }, - "/safari/session/delete": { + "/status-page/migration/cancel": { "post": { - "operationId": "session-write-delete", - "summary": "删除会话", - "description": "按 ID 删除会话。", + "operationId": "statusPageMigrationCancel", + "summary": "取消状态页迁移", + "description": "取消正在进行的状态页迁移任务。只能取消处于 `running` 状态的任务。", "tags": [ - "AI SRE/会话" - ], - "security": [ - { - "AppKeyAuth": [] - } + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 需要对该会话拥有管理权限(创建者、账户管理员或所属团队成员)。\n", - "href": "/zh/api-reference/ai-sre/sessions/session-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-migration-cancel", "metadata": { - "sidebarTitle": "删除会话" + "sidebarTitle": "取消状态页迁移" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { "allOf": [ { - "$ref": "#/components/schemas/ResponseEnvelope" + "$ref": "#/components/schemas/SuccessEnvelope" }, { "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -22630,7 +23162,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": {} } } } @@ -22653,29 +23185,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SessionDeleteRequest" + "$ref": "#/components/schemas/CancelStatusPageMigrationRequest" }, "example": { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u" + "job_id": "01KP0311872NVYFRRQ82FW0001" } } } } } }, - "/datasource/im/person/try-link": { - "post": { - "operationId": "datasourceImPersonTryLink", - "summary": "尝试关联 IM 人员", - "description": "为指定集成尝试将未绑定成员自动关联到对应的 IM 账号。", + "/status-page/migration/status": { + "get": { + "operationId": "statusPageMigrationStatus", + "summary": "获取迁移状态", + "description": "获取状态页迁移任务的当前状态和进度。", "tags": [ - "On-call/集成中心" + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心管理**(`on-call`) |\n\n## 使用说明\n\n- 服务端使用成员邮箱和手机号在钉钉、飞书或企业微信中查找匹配用户。\n- 如果没有成员可关联,响应中的 `new_linked_person_ids` 为空数组。", - "href": "/zh/api-reference/on-call/integrations/datasource-im-person-try-link", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/status-pages/status-page-migration-status", "metadata": { - "sidebarTitle": "尝试关联 IM 人员" + "sidebarTitle": "获取迁移状态" } }, "responses": { @@ -22692,7 +23224,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/TryLinkPersonResponse" + "$ref": "#/components/schemas/StatusPageMigrationJob" } } } @@ -22701,9 +23233,25 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "new_linked_person_ids": [ - 5348648172131 - ] + "job_id": "01KP0311872NVYFRRQ82FW0001", + "account_id": 2451002751131, + "source_page_id": "abcdefghij", + "target_page_id": 5750613685214, + "phase": "history", + "status": "completed", + "progress": { + "total_steps": 5, + "completed_steps": 5, + "components_imported": 8, + "sections_imported": 3, + "incidents_imported": 12, + "maintenances_imported": 2, + "subscribers_imported": 0, + "templates_imported": 0, + "subscribers_skipped": 0 + }, + "created_at": 1766736878, + "updated_at": 1766740000 } } } @@ -22722,34 +23270,32 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TryLinkPersonRequest" - }, - "example": { - "integration_id": 6113996590131 - } - } + "parameters": [ + { + "name": "job_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + }, + "description": "Migration job ID returned by `migrate-structure` or `migrate-email-subscribers`." } - } + ] } }, - "/incident/post-mortem/init": { + "/status-page/section/delete": { "post": { - "operationId": "postmortem-write-init", - "summary": "初始化故障复盘", - "description": "根据一个或多个故障和模板创建复盘草稿。", + "operationId": "statusPageSectionDelete", + "summary": "删除状态页区域", + "description": "从状态页删除区域。", "tags": [ - "On-call/故障管理" + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |\n\n## 使用说明\n\n- 最多可将 10 个故障关联到同一份复盘报告。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/incidents/postmortem-write-init", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-section-delete", "metadata": { - "sidebarTitle": "初始化故障复盘" + "sidebarTitle": "删除状态页区域" } }, "responses": { @@ -22766,7 +23312,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PostMortemItem" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -22774,45 +23320,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "meta": { - "account_id": 2451002751131, - "title": "Postmortem1", - "status": "published", - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", - "template_id": "post_mortem_default_tmpl_en-us", - "incident_ids": [ - "69bb9233331067560c718ecd" - ], - "media_count": 0, - "author_ids": [ - 2477273692131 - ], - "team_id": 2477033058131, - "channel_id": 3047621227131, - "is_private": false, - "channel_name": "Ops Channel", - "created_at_seconds": 1773900354, - "updated_at_seconds": 1773909012 - }, - "basics": { - "incidents_highest_severity": "Warning", - "incidents_earliest_start_seconds": 1761133512, - "incidents_latest_close_seconds": 1761133632, - "incidents_total_duration_seconds": 120, - "responders": [ - { - "person_id": 3790925372131, - "assigned_at": 1761133515, - "acknowledged_at": 0 - } - ] - }, - "content": { - "content": "{\"type\":\"doc\",\"content\":[]}" - }, - "follow_ups": "" - } + "data": {} } } } @@ -22835,32 +23343,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InitPostMortemRequest" + "$ref": "#/components/schemas/DeleteStatusPageSectionRequest" }, "example": { - "incident_ids": [ - "69bb9233331067560c718ecd" - ], - "template_id": "post_mortem_default_tmpl_en-us" + "page_id": 5750613685214, + "section_ids": [ + "01KP032J1FV2H8DDGN0QSJ1CAR" + ] } } } } } }, - "/incident/post-mortem/basics/reset": { + "/status-page/section/upsert": { "post": { - "operationId": "postmortem-write-reset-basics", - "summary": "更新故障复盘基础信息", - "description": "替换复盘报告中记录的故障基础信息。", + "operationId": "statusPageSectionUpsert", + "summary": "创建或更新状态页区域", + "description": "在状态页上创建或更新区域。", "tags": [ - "On-call/故障管理" + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/incidents/postmortem-write-reset-basics", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-section-upsert", "metadata": { - "sidebarTitle": "更新故障复盘基础信息" + "sidebarTitle": "创建或更新状态页区域" } }, "responses": { @@ -22877,7 +23385,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/UpsertStatusPageSectionResponse" } } } @@ -22885,7 +23393,11 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "section_ids": [ + "01KP032J1FV2H8DDGN0QSJ1CAR" + ] + } } } } @@ -22908,16 +23420,16 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResetPostMortemBasicsRequest" + "$ref": "#/components/schemas/UpsertStatusPageSectionRequest" }, "example": { - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", - "incidents_highest_severity": "Warning", - "incidents_earliest_start_seconds": 1761133512, - "incidents_latest_close_seconds": 1761133632, - "incidents_total_duration_seconds": 120, - "responder_ids": [ - 3790925372131 + "page_id": 5750613685214, + "sections": [ + { + "name": "Core Services", + "description": "Our core services", + "order_id": 1 + } ] } } @@ -22925,19 +23437,19 @@ } } }, - "/incident/post-mortem/status/reset": { - "post": { - "operationId": "postmortem-write-reset-status", - "summary": "更新故障复盘状态", - "description": "将复盘报告设置为草稿或已发布。", + "/status-page/subscriber/export": { + "post": { + "operationId": "statusPageSubscriberExport", + "summary": "导出订阅者", + "description": "以 CSV 附件形式导出状态页的订阅者列表。响应为 `text/csv` 文件,包含列:Method、Recipient、Components、Subscribe All、Locale。", "tags": [ - "On-call/故障管理" + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/incidents/postmortem-write-reset-status", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **10 次/分钟**;**1 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-subscriber-export", "metadata": { - "sidebarTitle": "更新故障复盘状态" + "sidebarTitle": "导出订阅者" } }, "responses": { @@ -22954,7 +23466,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/StatusPageSubscriberExportResponse" } } } @@ -22962,7 +23474,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": "Method,Recipient,Components,Subscribe All,Locale\nemail,alice@example.com,,true,zh-CN\nemail,bob@example.com,,true,en-US" } } } @@ -22985,30 +23497,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResetPostMortemStatusRequest" + "$ref": "#/components/schemas/ExportStatusPageSubscribersRequest" }, "example": { - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", - "status": "published" + "page_id": 5750613685214 } } } } } }, - "/incident/post-mortem/title/reset": { + "/status-page/subscriber/import": { "post": { - "operationId": "postmortem-write-reset-title", - "summary": "更新故障复盘标题", - "description": "替换复盘报告标题。", + "operationId": "statusPageSubscriberImport", + "summary": "批量导入订阅者", + "description": "批量导入状态页的订阅者。", "tags": [ - "On-call/故障管理" + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/incidents/postmortem-write-reset-title", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **20 次/分钟**;**2 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-subscriber-import", "metadata": { - "sidebarTitle": "更新故障复盘标题" + "sidebarTitle": "批量导入订阅者" } }, "responses": { @@ -23056,30 +23567,45 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResetPostMortemTitleRequest" + "$ref": "#/components/schemas/ImportStatusPageSubscribersRequest" }, "example": { - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", - "title": "Production API latency incident" + "page_id": 5750613685214, + "method": "email", + "subscribers": [ + { + "recipient": "alice@example.com", + "all": true, + "locale": "en-US" + }, + { + "recipient": "bob@example.com", + "component_ids": [ + "01KC3GAZ6ZJE40H55GM31RPWZE" + ], + "all": false, + "locale": "zh-CN" + } + ] } } } } } }, - "/incident/post-mortem/follow-ups/reset": { - "post": { - "operationId": "postmortem-write-reset-follow-ups", - "summary": "更新故障复盘后续行动", - "description": "替换复盘报告中的后续行动项。", + "/status-page/subscriber/list": { + "get": { + "operationId": "statusPageSubscriberList", + "summary": "查询状态页订阅者列表", + "description": "查询已订阅状态页通知的用户列表。", "tags": [ - "On-call/故障管理" + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/incidents/postmortem-write-reset-follow-ups", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/status-pages/status-page-subscriber-list", "metadata": { - "sidebarTitle": "更新故障复盘后续行动" + "sidebarTitle": "查询状态页订阅者列表" } }, "responses": { @@ -23096,7 +23622,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/StatusPageSubscriberListResponse" } } } @@ -23104,7 +23630,26 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "total": 2, + "has_next_page": false, + "items": [ + { + "recipient": "alice@example.com", + "method": "email", + "components": [], + "all": true, + "locale": "zh-CN" + }, + { + "recipient": "bob@example.com", + "method": "email", + "components": [], + "all": true, + "locale": "en-US" + } + ] + } } } } @@ -23122,35 +23667,67 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResetPostMortemFollowUpsRequest" - }, - "example": { - "post_mortem_id": "8104935102bf89dc01ac638a5261fe7e", - "follow_ups": "- Add database saturation alert\n- Review cache TTL rollout" - } - } + "parameters": [ + { + "name": "page_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Status page ID." + }, + { + "name": "component_ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "description": "Comma-separated component IDs to filter subscribers by." + }, + { + "name": "p", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "default": 1 + }, + "description": "Page number (1-based)." + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100, + "default": 10 + }, + "description": "Page size (1-100)." } - } + ] } }, - "/incident/post-mortem/template/upsert": { + "/status-page/template/delete": { "post": { - "operationId": "postmortem-write-upsert-template", - "summary": "创建或更新故障复盘模板", - "description": "创建自定义复盘模板,或更新已有模板。", + "operationId": "statusPageTemplateDelete", + "summary": "删除状态页模板", + "description": "删除状态页的事件模板。", "tags": [ - "On-call/故障管理" + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/incidents/postmortem-write-upsert-template", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-template-delete", "metadata": { - "sidebarTitle": "创建或更新故障复盘模板" + "sidebarTitle": "删除状态页模板" } }, "responses": { @@ -23167,7 +23744,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PostMortemTemplate" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -23175,17 +23752,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "account_id": 2451002751131, - "template_id": "post_mortem_default_tmpl_en-us", - "name": "Default post-mortem report", - "description": "Default sections for post-mortem reports.", - "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", - "content_markdown": "## Summary\nDescribe what happened.", - "team_id": 2477033058131, - "created_at_seconds": 1773900000, - "updated_at_seconds": 1773903600 - } + "data": {} } } } @@ -23208,33 +23775,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpsertPostMortemTemplateRequest" + "$ref": "#/components/schemas/DeleteStatusPageTemplateRequest" }, "example": { - "team_id": 2477033058131, - "name": "Production incident template", - "description": "Template for production incident reviews.", - "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", - "content_markdown": "## Summary\nDescribe what happened." + "page_id": 5720156736380, + "type": "pre_defined", + "template_id": "01KP0339G5XDEPM4R86T2B23EP" } } } } } }, - "/incident/post-mortem/template/delete": { - "post": { - "operationId": "postmortem-write-delete-template", - "summary": "删除故障复盘模板", - "description": "删除自定义复盘模板。", + "/status-page/template/list": { + "get": { + "operationId": "statusPageTemplateList", + "summary": "查询状态页模板列表", + "description": "查询状态页的所有事件模板。", "tags": [ - "On-call/故障管理" + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障管理**(`on-call`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/on-call/incidents/postmortem-write-delete-template", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/on-call/status-pages/status-page-template-list", "metadata": { - "sidebarTitle": "删除故障复盘模板" + "sidebarTitle": "查询状态页模板列表" } }, "responses": { @@ -23259,7 +23824,17 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "template_id": "01KC8KP6PHVPSCAB0BTKZBN2HR", + "title": "Service Disruption", + "type": "incident", + "status": "identified", + "description": "We have identified the root cause." + } + ] + } } } } @@ -23277,34 +23852,46 @@ "$ref": "#/components/responses/ServerError" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeletePostMortemTemplateRequest" - }, - "example": { - "template_id": "post_mortem_custom_tmpl_01" - } - } + "parameters": [ + { + "name": "page_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Status page ID." + }, + { + "name": "type", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "pre_defined", + "message" + ] + }, + "description": "Template category. `pre_defined` returns predefined event templates; `message` returns message notification templates." } - } + ] } }, - "/incident/post-mortem/template/list": { + "/status-page/template/upsert": { "post": { - "operationId": "postmortem-read-list-templates", - "summary": "查询故障复盘模板列表", - "description": "返回账号下的内置和自定义故障复盘模板。", + "operationId": "statusPageTemplateUpsert", + "summary": "创建或更新状态页模板", + "description": "创建或更新状态页的事件模板。", "tags": [ - "On-call/故障管理" + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/postmortem-read-list-templates", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-template-upsert", "metadata": { - "sidebarTitle": "查询故障复盘模板列表" + "sidebarTitle": "创建或更新状态页模板" } }, "responses": { @@ -23321,7 +23908,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/ListPostMortemTemplatesResponse" + "$ref": "#/components/schemas/UpsertStatusPageTemplateResponse" } } } @@ -23330,21 +23917,7 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 2, - "has_next_page": false, - "items": [ - { - "account_id": 2451002751131, - "template_id": "post_mortem_default_tmpl_en-us", - "name": "Default post-mortem report", - "description": "Default sections for post-mortem reports.", - "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", - "content_markdown": "## Summary\nDescribe what happened.", - "team_id": 2477033058131, - "created_at_seconds": 1773900000, - "updated_at_seconds": 1773903600 - } - ] + "template_id": "01KP0339G5XDEPM4R86T2B23EP" } } } @@ -23368,32 +23941,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListPostMortemTemplatesRequest" + "$ref": "#/components/schemas/UpsertStatusPageTemplateRequest" }, "example": { - "p": 1, - "limit": 20, - "order_by": "created_at_seconds", - "asc": false + "page_id": 5720156736380, + "type": "pre_defined", + "template": { + "title": "Service Disruption", + "event_type": "incident", + "status": "investigating", + "description": "We are investigating a service disruption affecting some users." + } } } } } } }, - "/incident/post-mortem/template/info": { - "get": { - "operationId": "postmortem-read-template-info", - "summary": "查看故障复盘模板详情", - "description": "按 ID 返回单个故障复盘模板。", + "/status-page/update": { + "post": { + "operationId": "statusPageUpdate", + "summary": "更新状态页", + "description": "更新已有状态页的配置。", "tags": [ - "On-call/故障管理" + "On-call/状态页" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", - "href": "/zh/api-reference/on-call/incidents/postmortem-read-template-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", + "href": "/zh/api-reference/on-call/status-pages/status-page-update", "metadata": { - "sidebarTitle": "查看故障复盘模板详情" + "sidebarTitle": "更新状态页" } }, "responses": { @@ -23410,7 +23987,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PostMortemTemplate" + "$ref": "#/components/schemas/EmptyResponse" } } } @@ -23418,17 +23995,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "account_id": 2451002751131, - "template_id": "post_mortem_default_tmpl_en-us", - "name": "Default post-mortem report", - "description": "Default sections for post-mortem reports.", - "content": "[{\"type\":\"heading\",\"content\":\"Summary\"}]", - "content_markdown": "## Summary\nDescribe what happened.", - "team_id": 2477033058131, - "created_at_seconds": 1773900000, - "updated_at_seconds": 1773903600 - } + "data": {} } } } @@ -23446,32 +24013,37 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "template_id", - "in": "query", - "required": true, - "schema": { - "type": "string" - }, - "description": "Template ID." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmptyRequest" + }, + "example": { + "page_id": 5750613685214, + "name": "Flashduty Status Page (Updated)", + "page_header": "Updated status page header", + "contact_info": "mailto:support@example.com" + } + } } - ] + } } }, - "/monit/preview/sync": { + "/team/delete": { "post": { - "operationId": "monit-preview-sync", - "summary": "同步预览数据源查询", - "description": "同步执行数据源查询并返回原始结果,用于在保存前预览告警规则表达式的效果。", + "operationId": "team-write-delete", + "summary": "删除团队", + "description": "按 ID、名称或外部引用 ID 永久删除一个团队。", "tags": [ - "Monitors/通用工具" + "平台/团队管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **60 次/分钟**;**10 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `ds_type` 须与数据源类型匹配,如 `prometheus`、`loki`。\n- `ds_name` 为账户中配置的数据源显示名称。\n- `delay_seconds` 将查询窗口向前偏移指定秒数,用于补偿数据摄入延迟。\n- 响应体为数据源返回的原始 JSON,其结构随数据源类型而异。", - "href": "/zh/api-reference/monitors/monitor-utilities/monit-preview-sync", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **团队管理**(`organization`) |\n\n## 使用说明\n\n- `team_id`、`team_name`、`ref_id` 三者至少提供一个。\n- 若团队仍被排班、分派策略等资源引用,会返回 `400 ReferenceExist`。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/platform/teams/team-write-delete", "metadata": { - "sidebarTitle": "同步预览数据源查询" + "sidebarTitle": "删除团队" } }, "responses": { @@ -23488,7 +24060,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/PreviewSyncResponse" + "$ref": "#/components/schemas/PlatformEmptyObject" } } } @@ -23496,13 +24068,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "status": "success", - "data": { - "resultType": "vector", - "result": [] - } - } + "data": {} } } } @@ -23513,6 +24079,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -23525,32 +24094,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PreviewSyncRequest" + "$ref": "#/components/schemas/TeamDeleteRequest" }, "example": { - "ds_type": "prometheus", - "ds_name": "生产 Prometheus", - "expr": "rate(http_requests_total[5m])", - "delay_seconds": 0 + "team_id": 1001 } } } } } }, - "/rum/application/webhook/test": { + "/team/info": { "post": { - "operationId": "rum-application-webhook-test", - "summary": "测试应用 Webhook", - "description": "发送一条 RUM 告警样例事件,用于验证应用的 Webhook URL。", + "operationId": "team-read-info", + "summary": "查看团队详情", + "description": "按 ID、名称或外部引用 ID 返回单个团队的详细信息。", "tags": [ - "RUM/应用管理" + "平台/团队管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- 接口会先校验 URL,再发送样例事件。\n- 投递失败时仍返回 HTTP 200,但 `ok=false`,错误原因在 `message` 中。", - "href": "/zh/api-reference/rum/applications/rum-application-webhook-test", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `team_id`、`team_name`、`ref_id` 三者至少提供一个。", + "href": "/zh/api-reference/platform/teams/team-read-info", "metadata": { - "sidebarTitle": "测试应用 Webhook" + "sidebarTitle": "查看团队详情" } }, "responses": { @@ -23567,7 +24133,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumWebhookTestResponse" + "$ref": "#/components/schemas/TeamItem" } } } @@ -23576,9 +24142,22 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "ok": true, - "status_code": 200, - "message": "ok" + "account_id": 10023, + "team_id": 1001, + "team_name": "后端 SRE", + "description": "后端可靠性工程团队", + "status": "enabled", + "updated_by_name": "alice", + "updated_by": 80011, + "creator_id": 80011, + "creator_name": "alice", + "created_at": 1710000000, + "updated_at": 1712000000, + "person_ids": [ + 80011, + 80012 + ], + "ref_id": "" } } } @@ -23602,30 +24181,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumWebhookTestRequest" + "$ref": "#/components/schemas/TeamInfoRequest" }, "example": { - "application_id": "rum-app-prod", - "webhook_url": "https://hooks.example.com/rum-alerts" + "team_id": 1001 } } } } } }, - "/status-page/info": { - "get": { - "operationId": "statusPageInfo", - "summary": "获取状态页详情", - "description": "获取指定状态页的详细配置信息。", + "/team/infos": { + "post": { + "operationId": "team-read-infos", + "summary": "批量查看团队信息", + "description": "一次请求按 ID 列表批量返回多个团队的基本信息。", "tags": [ - "On-call/状态页" + "平台/团队管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/status-pages/status-page-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 每次最多传入 100 个团队 ID。", + "href": "/zh/api-reference/platform/teams/team-read-infos", "metadata": { - "sidebarTitle": "获取状态页详情" + "sidebarTitle": "批量查看团队信息" } }, "responses": { @@ -23642,7 +24220,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/TeamInfosResponse" } } } @@ -23651,48 +24229,23 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "page_id": 5750613685214, - "name": "Flashduty Status Page", - "url_name": "flashduty-statuspage", - "type": "public", - "custom_domain": "status.example.com", - "logo": "https://cdn.example.com/logo.png", - "favicon": "https://cdn.example.com/favicon.png", - "page_header": "Welcome to our status page", - "page_footer": "2025 Example Corp", - "date_view": "list", - "display_uptime_mode": "chart_and_percentage", - "custom_links": [ - { - "key": "Documentation", - "value": "https://docs.example.com" - } - ], - "contact_info": "mailto:support@example.com", - "components": [ + "items": [ { - "component_id": "01KC3GAZ6ZJE40H55GM31RPWZE", - "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", - "name": "Web Console", - "available_since_seconds": 1765349358, - "order_id": 1 - } - ], - "sections": [ + "team_id": 1001, + "team_name": "后端 SRE", + "person_ids": [ + 80011, + 80012 + ] + }, { - "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", - "name": "Core Services", - "description": "Our core services", - "order_id": 1, - "hide_uptime": false, - "hide_all": false + "team_id": 1002, + "team_name": "前端", + "person_ids": [ + 80013 + ] } - ], - "subscription": { - "email": true, - "im": false - }, - "template_preference": "message" + ] } } } @@ -23711,32 +24264,37 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "page_id", - "in": "query", - "required": true, - "schema": { - "type": "string" - }, - "description": "Status page ID" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TeamInfosRequest" + }, + "example": { + "team_ids": [ + 1001, + 1002 + ] + } + } } - ] + } } }, - "/status-page/create": { + "/team/list": { "post": { - "operationId": "statusPageCreate", - "summary": "创建状态页", - "description": "创建一个新的状态页。", + "operationId": "team-read-list", + "summary": "查看团队列表", + "description": "分页返回当前账户下的团队列表。", "tags": [ - "On-call/状态页" + "平台/团队管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 传入 `person_id` 可过滤返回指定人员所属的团队。\n- 默认 p=1、limit=20。", + "href": "/zh/api-reference/platform/teams/team-read-list", "metadata": { - "sidebarTitle": "创建状态页" + "sidebarTitle": "查看团队列表" } }, "responses": { @@ -23753,7 +24311,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/TeamListResponse" } } } @@ -23762,9 +24320,28 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "page_id": 6294565612043, - "page_name": "My Status Page", - "page_url_name": "my-status-page" + "p": 1, + "limit": 20, + "total": 5, + "items": [ + { + "account_id": 10023, + "team_id": 1001, + "team_name": "后端 SRE", + "status": "enabled", + "creator_id": 80011, + "created_at": 1710000000, + "updated_at": 1712000000, + "person_ids": [ + 80011 + ], + "description": "", + "updated_by_name": "", + "updated_by": 0, + "creator_name": "alice", + "ref_id": "" + } + ] } } } @@ -23788,33 +24365,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmptyRequest" + "$ref": "#/components/schemas/TeamListRequest" }, "example": { - "name": "My Status Page", - "url_name": "my-status-page", - "type": "public", - "page_header": "Welcome to our status page", - "contact_info": "mailto:support@example.com" + "p": 1, + "limit": 20, + "orderby": "created_at", + "asc": false } } } } } }, - "/status-page/update": { + "/team/upsert": { "post": { - "operationId": "statusPageUpdate", - "summary": "更新状态页", - "description": "更新已有状态页的配置。", + "operationId": "team-write-upsert", + "summary": "变更团队信息", + "description": "创建新团队或更新已有团队,更新时传入 `team_id`。", "tags": [ - "On-call/状态页" + "平台/团队管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **团队管理**(`organization`) |\n\n## 使用说明\n\n- 省略 `team_id`(或置为 0)表示创建新团队;传入已有 ID 表示更新。\n- `team_name` 须为 1–39 个字符且在账户内唯一。\n- 传入 `person_ids` 可设置团队成员,会替换整个成员列表。\n- 传入 `emails` 或 `phones` 可邀请尚未注册的成员。\n- `ref_id` 是供第三方 HR 系统集成使用的外部标识。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/platform/teams/team-write-upsert", "metadata": { - "sidebarTitle": "更新状态页" + "sidebarTitle": "变更团队信息" } }, "responses": { @@ -23831,7 +24407,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/TeamUpsertResponse" } } } @@ -23839,7 +24415,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "team_id": 1001, + "team_name": "后端 SRE" + } } } } @@ -23850,6 +24429,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -23862,32 +24444,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmptyRequest" + "$ref": "#/components/schemas/TeamUpsertRequest" }, "example": { - "page_id": 5750613685214, - "name": "Flashduty Status Page (Updated)", - "page_header": "Updated status page header", - "contact_info": "mailto:support@example.com" + "team_name": "后端 SRE", + "description": "后端可靠性工程团队", + "person_ids": [ + 80011, + 80012 + ] } } } } } }, - "/status-page/delete": { + "/template/create": { "post": { - "operationId": "statusPageDelete", - "summary": "删除状态页", - "description": "删除指定的状态页。", + "operationId": "template-write-create", + "summary": "创建模板", + "description": "创建一个新的通知模板。", "tags": [ - "On-call/状态页" + "On-call/通知模板" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **模板管理**(`on-call`) |\n\n## 使用说明\n\n- `template_name` 必须在账户内唯一,重名会返回 `InvalidParameter`。\n- 服务端会对所有非空通道按 Mock 故障做一次渲染校验,任何通道的语法错误都会导致整个请求返回 `InvalidParameter`。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/notification-templates/template-write-create", "metadata": { - "sidebarTitle": "删除状态页" + "sidebarTitle": "创建模板" } }, "responses": { @@ -23904,7 +24488,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/TemplateCreateResponse" } } } @@ -23912,7 +24496,10 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "template_id": "6605a1b2c3d4e5f6a7b8c9d0", + "template_name": "生产环境默认模板" + } } } } @@ -23935,29 +24522,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EmptyRequest" + "$ref": "#/components/schemas/TemplateCreateRequest" }, "example": { - "page_id": 5750613685214 + "team_id": 0, + "template_name": "生产环境默认模板", + "description": "生产环境故障的默认模板。", + "email": "Incident {{ .IncidentName }} on {{ .Severity }}", + "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}" } } } } } }, - "/status-page/component/upsert": { + "/template/delete": { "post": { - "operationId": "statusPageComponentUpsert", - "summary": "创建或更新状态页组件", - "description": "在状态页上创建或更新服务组件。", + "operationId": "template-write-delete", + "summary": "删除模板", + "description": "按 ID 软删除一个模板。", "tags": [ - "On-call/状态页" + "On-call/通知模板" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-component-upsert", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **模板管理**(`on-call`) |\n\n## 使用说明\n\n- 若模板仍被任何协作空间、分派策略或通知订阅引用,会返回 `400 ReferenceExist`。\n- 删除是软删除(`deleted_at` 被置值),记录仍保留用于审计,但模板不会再出现在列表中。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/notification-templates/template-write-delete", "metadata": { - "sidebarTitle": "创建或更新状态页组件" + "sidebarTitle": "删除模板" } }, "responses": { @@ -23974,7 +24565,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/UpsertStatusPageComponentResponse" + "$ref": "#/components/schemas/EmptyObject" } } } @@ -23982,11 +24573,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "component_ids": [ - "01KP032KMN9YFBMPWANJMFZFG1" - ] - } + "data": {} } } } @@ -23997,6 +24584,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -24009,37 +24599,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpsertStatusPageComponentRequest" + "$ref": "#/components/schemas/TemplateIDRequest" }, "example": { - "page_id": 5750613685214, - "components": [ - { - "name": "Web Console", - "description": "Main web interface", - "section_id": "01KC3FKKX5TSVG6Z3X1QNGF6V2", - "order_id": 1 - } - ] + "template_id": "6605a1b2c3d4e5f6a7b8c9d0" } } } } } }, - "/status-page/component/delete": { + "/template/info": { "post": { - "operationId": "statusPageComponentDelete", - "summary": "删除状态页组件", - "description": "从状态页删除服务组件。", + "operationId": "template-read-info", + "summary": "查看模板详情", + "description": "按 ID 返回单个通知模板。", "tags": [ - "On-call/状态页" + "On-call/通知模板" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-component-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **模板查看**(`on-call`) |\n\n## 使用说明\n\n- 传入 `000000000000000000000001` 作为 `template_id` 可以获取当前账户语种下的系统预置模板。", + "href": "/zh/api-reference/on-call/notification-templates/template-read-info", "metadata": { - "sidebarTitle": "删除状态页组件" + "sidebarTitle": "查看模板详情" } }, "responses": { @@ -24056,7 +24638,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/TemplateItem" } } } @@ -24064,7 +24646,32 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "account_id": 10023, + "team_id": 0, + "template_id": "6605a1b2c3d4e5f6a7b8c9d0", + "template_name": "生产环境默认模板", + "description": "Default template for production incidents.", + "email": "Incident {{ .IncidentName }} on {{ .Severity }}", + "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}", + "voice": "", + "dingtalk": "", + "wecom": "", + "feishu": "", + "feishu_app": "", + "dingtalk_app": "", + "wecom_app": "", + "slack_app": "", + "teams_app": "", + "telegram": "", + "slack": "", + "zoom": "", + "status": "enabled", + "creator_id": 80011, + "updated_by": 80011, + "created_at": 1712700000, + "updated_at": 1712702400 + } } } } @@ -24087,32 +24694,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteStatusPageComponentRequest" + "$ref": "#/components/schemas/TemplateIDRequest" }, "example": { - "page_id": 5750613685214, - "component_ids": [ - "01KP032KMN9YFBMPWANJMFZFG1" - ] + "template_id": "6605a1b2c3d4e5f6a7b8c9d0" } } } } } }, - "/status-page/section/upsert": { + "/template/list": { "post": { - "operationId": "statusPageSectionUpsert", - "summary": "创建或更新状态页区域", - "description": "在状态页上创建或更新区域。", + "operationId": "template-read-list", + "summary": "查询模板列表", + "description": "分页返回当前账户下的通知模板列表。", "tags": [ - "On-call/状态页" + "On-call/通知模板" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-section-upsert", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **模板查看**(`on-call`) 或 **模板管理**(`on-call`) |\n\n## 使用说明\n\n- 默认返回第 1 页、每页 20 条。响应中的 `has_next_page` 可以直接告知是否还有下一页,无需额外计数请求。\n- 当 `is_my_team=true` 时 `team_ids` 字段会被忽略。", + "href": "/zh/api-reference/on-call/notification-templates/template-read-list", "metadata": { - "sidebarTitle": "创建或更新状态页区域" + "sidebarTitle": "查询模板列表" } }, "responses": { @@ -24129,7 +24733,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/UpsertStatusPageSectionResponse" + "$ref": "#/components/schemas/TemplateListResponse" } } } @@ -24138,8 +24742,35 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "section_ids": [ - "01KP032J1FV2H8DDGN0QSJ1CAR" + "total": 47, + "has_next_page": true, + "items": [ + { + "account_id": 10023, + "team_id": 0, + "template_id": "6605a1b2c3d4e5f6a7b8c9d0", + "template_name": "生产环境默认模板", + "description": "Default template for production incidents.", + "email": "Incident {{ .IncidentName }} on {{ .Severity }}", + "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}", + "voice": "", + "dingtalk": "", + "wecom": "", + "feishu": "", + "feishu_app": "", + "dingtalk_app": "", + "wecom_app": "", + "slack_app": "", + "teams_app": "", + "telegram": "", + "slack": "", + "zoom": "", + "status": "enabled", + "creator_id": 80011, + "updated_by": 80011, + "created_at": 1712700000, + "updated_at": 1712702400 + } ] } } @@ -24164,41 +24795,38 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpsertStatusPageSectionRequest" + "$ref": "#/components/schemas/TemplateListRequest" }, "example": { - "page_id": 5750613685214, - "sections": [ - { - "name": "Core Services", - "description": "Our core services", - "order_id": 1 - } - ] + "p": 1, + "limit": 20, + "orderby": "updated_at", + "asc": false, + "is_my_team": false } } } } } }, - "/status-page/section/delete": { + "/template/preview": { "post": { - "operationId": "statusPageSectionDelete", - "summary": "删除状态页区域", - "description": "从状态页删除区域。", + "operationId": "template-read-preview", + "summary": "预览模板", + "description": "使用故障数据或模拟数据渲染通知模板并返回结果。", "tags": [ - "On-call/状态页" + "On-call/通知模板" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-section-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **60 次/分钟**;**10 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", + "href": "/zh/api-reference/on-call/notification-templates/template-read-preview", "metadata": { - "sidebarTitle": "删除状态页区域" + "sidebarTitle": "预览模板" } }, "responses": { "200": { - "description": "成功", + "description": "Success", "content": { "application/json": { "schema": { @@ -24210,7 +24838,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/PreviewTemplateResponse" } } } @@ -24218,7 +24846,11 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "success": true, + "content": "Incident Database latency spike is Critical", + "message": "" + } } } } @@ -24241,32 +24873,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteStatusPageSectionRequest" + "$ref": "#/components/schemas/PreviewTemplateRequest" }, "example": { - "page_id": 5750613685214, - "section_ids": [ - "01KP032J1FV2H8DDGN0QSJ1CAR" - ] + "content": "Incident {{.Title}} is {{.Status}}", + "type": "feishu_app", + "incident_id": "664a1b2c3d4e5f6a7b8c9d0e" } } } } } }, - "/status-page/template/upsert": { + "/template/update": { "post": { - "operationId": "statusPageTemplateUpsert", - "summary": "创建或更新状态页模板", - "description": "创建或更新状态页的事件模板。", + "operationId": "template-write-update", + "summary": "更新模板", + "description": "替换指定模板在所有通道上的内容。", "tags": [ - "On-call/状态页" + "On-call/通知模板" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-template-upsert", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **模板管理**(`on-call`) |\n\n## 使用说明\n\n- 请求中的每个通道字段会覆盖存储值——想清空某通道时,把该字段设置为空字符串即可。\n- 调用者必须对目标模板所属团队拥有数据权限,否则返回 `AccessDenied`。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/on-call/notification-templates/template-write-update", "metadata": { - "sidebarTitle": "创建或更新状态页模板" + "sidebarTitle": "更新模板" } }, "responses": { @@ -24283,7 +24914,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/UpsertStatusPageTemplateResponse" + "$ref": "#/components/schemas/EmptyObject" } } } @@ -24291,9 +24922,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "template_id": "01KP0339G5XDEPM4R86T2B23EP" - } + "data": {} } } } @@ -24304,6 +24933,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -24316,36 +24948,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpsertStatusPageTemplateRequest" + "$ref": "#/components/schemas/TemplateUpdateRequest" }, "example": { - "page_id": 5720156736380, - "type": "pre_defined", - "template": { - "title": "Service Disruption", - "event_type": "incident", - "status": "investigating", - "description": "We are investigating a service disruption affecting some users." - } + "template_id": "6605a1b2c3d4e5f6a7b8c9d0", + "template_name": "生产环境默认模板", + "description": "已更新的描述。", + "email": "Incident {{ .IncidentName }} on {{ .Severity }}", + "sms": "[Flashduty] {{ .IncidentName }} — {{ .Severity }}" } } } } } }, - "/status-page/template/delete": { + "/webhook/history/detail": { "post": { - "operationId": "statusPageTemplateDelete", - "summary": "删除状态页模板", - "description": "删除状态页的事件模板。", + "operationId": "webhookHistoryDetail", + "summary": "获取 Webhook 推送详情", + "description": "获取指定 Webhook 推送尝试的详细请求体和响应信息。", "tags": [ - "On-call/状态页" + "On-call/集成中心" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **状态页面管理**(`on-call`) |", - "href": "/zh/api-reference/on-call/status-pages/status-page-template-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/integrations/webhook-history-detail", "metadata": { - "sidebarTitle": "删除状态页模板" + "sidebarTitle": "获取 Webhook 推送详情" } }, "responses": { @@ -24362,7 +24991,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/WebhookHistoryDetail" } } } @@ -24370,7 +24999,26 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "integration_id": 5321026051131, + "event_id": "20260412Xatt9hrXsgmFkBR78WF655", + "webhook_type": "alert", + "event_type": "a_update", + "channel_id": 2551105804131, + "ref_id": "69da3f0ef77b1b51f40e83cc", + "request_headers": "{\"Content-Type\":\"application/json\"}", + "request_body": "{\"event_type\":\"a_update\",\"event_id\":\"d789d65951c0532ea9b6a1d99b707054\"}", + "endpoint": "https://example.com/webhook", + "attempt": 1, + "duration": 132, + "status": "success", + "status_code": 200, + "response_headers": "{\"Content-Type\":\"application/json\"}", + "response_body": "{\"ok\":true}", + "event_time": "2026-04-12T13:31:11.357472+08:00", + "ref_title": "High CPU Usage on host-01", + "channel_name": "Production Alerts" + } } } } @@ -24393,31 +25041,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteStatusPageTemplateRequest" + "$ref": "#/components/schemas/GetWebhookHistoryDetailRequest" }, "example": { - "page_id": 5720156736380, - "type": "pre_defined", - "template_id": "01KP0339G5XDEPM4R86T2B23EP" + "event_id": "20260412Xatt9hrXsgmFkBR78WF655", + "integration_id": 6113996590131 } } } } } }, - "/status-page/template/list": { - "get": { - "operationId": "statusPageTemplateList", - "summary": "查询状态页模板列表", - "description": "查询状态页的所有事件模板。", + "/webhook/history/list": { + "post": { + "operationId": "webhookHistoryList", + "summary": "查询 Webhook 推送历史", + "description": "查询出站 Webhook 通知的推送历史记录。", "tags": [ - "On-call/状态页" + "On-call/集成中心" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/on-call/status-pages/status-page-template-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **集成中心查看**(`on-call`) |", + "href": "/zh/api-reference/on-call/integrations/webhook-history-list", "metadata": { - "sidebarTitle": "查询状态页模板列表" + "sidebarTitle": "查询 Webhook 推送历史" } }, "responses": { @@ -24434,7 +25081,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/ListWebhookHistoryResponse" } } } @@ -24445,13 +25092,22 @@ "data": { "items": [ { - "template_id": "01KC8KP6PHVPSCAB0BTKZBN2HR", - "title": "Service Disruption", - "type": "incident", - "status": "identified", - "description": "We have identified the root cause." + "integration_id": 5321026051131, + "event_id": "20260412Xatt9hrXsgmFkBR78WF655", + "webhook_type": "alert", + "event_type": "a_update", + "channel_id": 2551105804131, + "ref_id": "69da3f0ef77b1b51f40e83cc", + "endpoint": "https://example.com/webhook", + "attempt": 1, + "duration": 132, + "status": "success", + "status_code": 200, + "event_time": "2026-04-12T13:31:11.357472+08:00" } - ] + ], + "search_after_ctx": "eyJldmVudF90aW1lIjoiMjAyNi0wNC0xMlQxMzoxNToyNi4zODI1NDcrMDg6MDAiLCJldmVudF9pZCI6IjIwMjYwNDEybUdzeFAzZHJwRmZzNFpDUWQycFNEcCJ9", + "total": 346 } } } @@ -24470,31 +25126,23 @@ "$ref": "#/components/responses/ServerError" } }, - "parameters": [ - { - "name": "page_id", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - }, - "description": "Status page ID." - }, - { - "name": "type", - "in": "query", - "required": true, - "schema": { - "type": "string", - "enum": [ - "pre_defined", - "message" - ] - }, - "description": "Template category. `pre_defined` returns predefined event templates; `message` returns message notification templates." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListWebhookHistoryRequest" + }, + "example": { + "limit": 20, + "start_time": 1775116800000, + "end_time": 1775203200000, + "integration_id": 6113996590131, + "status": "success" + } + } } - ] + } } } }, @@ -44045,6 +44693,624 @@ "description": "创建或更新的模板 ID。" } } + }, + "AutomationRuleCreateRequest": { + "type": "object", + "description": "创建一条 AI SRE 自动化规则所需的配置。", + "properties": { + "name": { + "type": "string", + "description": "规则名称。", + "minLength": 1, + "maxLength": 255 + }, + "team_id": { + "type": "integer", + "format": "int64", + "description": "规则归属。`0` 表示个人规则,团队 ID 表示团队规则。", + "minimum": 0 + }, + "enabled": { + "type": "boolean", + "description": "创建后是否立即启用规则。" + }, + "cron_expr": { + "type": "string", + "description": "API 形态的 4 段 cron:小时、日期、月份、星期。" + }, + "schedule_trigger_enabled": { + "type": [ + "boolean", + "null" + ], + "description": "覆盖定时触发器的启用状态;省略时沿用默认启用。" + }, + "prompt": { + "type": "string", + "description": "每次自动化运行时交给 Agent 的任务提示词。", + "minLength": 1 + }, + "environment_kind": { + "type": "string", + "description": "偏好的执行环境;省略时由后端自动选择。", + "enum": [ + "cloud", + "byoc" + ] + }, + "environment_id": { + "type": "string", + "description": "当 `environment_kind` 为 `byoc` 时使用的具体 Runner ID。" + }, + "http_post_trigger_enabled": { + "type": "boolean", + "description": "是否同时启用 HTTP POST 触发器。" + } + }, + "required": [ + "name", + "cron_expr", + "prompt" + ] + }, + "AutomationRuleUpdateRequest": { + "type": "object", + "description": "局部更新一条 AI SRE 自动化规则;省略的字段保持不变。", + "properties": { + "rule_id": { + "type": "string", + "description": "目标自动化规则 ID。" + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "新的规则名称。", + "maxLength": 255 + }, + "team_id": { + "type": [ + "integer", + "null" + ], + "format": "int64", + "description": "把规则移动到新的范围;`0` 表示个人规则。", + "minimum": 0 + }, + "enabled": { + "type": [ + "boolean", + "null" + ], + "description": "启用或停用规则。" + }, + "cron_expr": { + "type": [ + "string", + "null" + ], + "description": "新的 4 段 cron 表达式。" + }, + "schedule_trigger_enabled": { + "type": [ + "boolean", + "null" + ], + "description": "启用或停用定时触发器。" + }, + "prompt": { + "type": [ + "string", + "null" + ], + "description": "新的任务提示词。" + }, + "environment_kind": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cloud", + "byoc" + ] + }, + { + "type": "null" + } + ], + "description": "偏好的执行环境;传 `null` 或省略表示保持不变。" + }, + "environment_id": { + "type": [ + "string", + "null" + ], + "description": "新的 BYOC Runner ID;切换 away from BYOC 时可传空字符串清空。" + }, + "http_post_trigger_enabled": { + "type": [ + "boolean", + "null" + ], + "description": "启用或停用 HTTP POST 触发器。" + }, + "rotate_http_post_trigger_token": { + "type": "boolean", + "description": "轮换 HTTP 触发 token;旧 token 会立即失效。" + } + }, + "required": [ + "rule_id" + ] + }, + "AutomationRuleIDRequest": { + "type": "object", + "description": "按 ID 选择一条自动化规则。", + "properties": { + "rule_id": { + "type": "string", + "description": "自动化规则 ID。" + } + }, + "required": [ + "rule_id" + ] + }, + "AutomationRuleListRequest": { + "type": "object", + "description": "查询自动化规则列表时使用的分页与可见性过滤条件。", + "properties": { + "p": { + "type": "integer", + "description": "页码,从 1 开始。", + "default": 1, + "minimum": 1 + }, + "limit": { + "type": "integer", + "description": "每页条数。", + "default": 20, + "minimum": 1 + }, + "scope": { + "type": "string", + "description": "可见性范围。", + "enum": [ + "all", + "personal", + "team" + ] + }, + "team_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "在 scope 解析后追加的团队过滤条件。" + }, + "include_person": { + "type": [ + "boolean", + "null" + ], + "description": "兼容旧语义;当 `scope` 省略且该值为 `false` 时,仅返回团队规则。" + }, + "enabled": { + "type": [ + "boolean", + "null" + ], + "description": "按启用状态过滤。" + }, + "keyword": { + "type": "string", + "description": "对规则名称做子串匹配。", + "maxLength": 64 + } + } + }, + "AutomationRuleListResponse": { + "type": "object", + "description": "当前调用者可见的自动化规则分页结果。", + "properties": { + "total": { + "type": "integer", + "format": "int64", + "description": "匹配规则总数。" + }, + "rules": { + "type": "array", + "description": "当前页规则。", + "items": { + "$ref": "#/components/schemas/AutomationRuleItem" + } + } + }, + "required": [ + "total", + "rules" + ] + }, + "AutomationTemplateListRequest": { + "type": "object", + "description": "加载自动化模板时可选的 locale 覆盖。", + "properties": { + "locale": { + "type": "string", + "description": "请求的语言环境,例如 `zh-CN` 或 `en-US`。", + "maxLength": 16 + } + } + }, + "AutomationTemplateListResponse": { + "type": "object", + "description": "可用于预填新建自动化规则的预设模板。", + "properties": { + "templates": { + "type": "array", + "description": "当前调用者可用的模板。", + "items": { + "$ref": "#/components/schemas/AutomationTemplateItem" + } + } + }, + "required": [ + "templates" + ] + }, + "AutomationRunListRequest": { + "type": "object", + "description": "查询某条自动化规则运行历史时使用的过滤条件。", + "properties": { + "rule_id": { + "type": "string", + "description": "要查询运行历史的自动化规则 ID。" + }, + "p": { + "type": "integer", + "description": "页码,从 1 开始。", + "default": 1, + "minimum": 1 + }, + "limit": { + "type": "integer", + "description": "每页条数。", + "default": 20, + "minimum": 1 + }, + "status": { + "type": "string", + "description": "按运行状态过滤。", + "enum": [ + "queued", + "running", + "retrying", + "succeeded", + "partial", + "failed", + "skipped", + "abandoned" + ] + }, + "trigger_kind": { + "type": "string", + "description": "按触发来源过滤。", + "enum": [ + "schedule", + "debug", + "http_post" + ] + }, + "started_after_ms": { + "type": "integer", + "format": "int64", + "description": "仅返回开始时间大于等于该 Unix 毫秒时间戳的运行。", + "minimum": 0 + }, + "started_before_ms": { + "type": "integer", + "format": "int64", + "description": "仅返回开始时间小于等于该 Unix 毫秒时间戳的运行。", + "minimum": 0 + } + }, + "required": [ + "rule_id" + ] + }, + "AutomationRunListResponse": { + "type": "object", + "description": "自动化执行历史的分页结果。", + "properties": { + "total": { + "type": "integer", + "format": "int64", + "description": "匹配运行总数。" + }, + "runs": { + "type": "array", + "description": "当前页运行记录。", + "items": { + "$ref": "#/components/schemas/AutomationRunItem" + } + } + }, + "required": [ + "total", + "runs" + ] + }, + "AutomationRuleItem": { + "type": "object", + "description": "一条 AI SRE 自动化规则的公开视图。", + "properties": { + "rule_id": { + "type": "string", + "description": "自动化规则 ID。" + }, + "account_id": { + "type": "integer", + "format": "int64", + "description": "所属账户 ID。" + }, + "team_id": { + "type": "integer", + "format": "int64", + "description": "规则范围。`0` 表示个人规则,`>0` 表示团队规则。" + }, + "owner_id": { + "type": "integer", + "format": "int64", + "description": "规则所有者成员 ID。" + }, + "name": { + "type": "string", + "description": "规则名称。" + }, + "enabled": { + "type": "boolean", + "description": "规则本身是否启用。" + }, + "run_scope": { + "type": "string", + "description": "运行时使用的派生范围。", + "enum": [ + "person", + "team" + ] + }, + "cron_expr": { + "type": "string", + "description": "持久化后的 cron 表达式。4 段 API 输入会在返回时补成前置分钟为 `0` 的 5 段形式。" + }, + "prompt": { + "type": "string", + "description": "每次运行执行的任务提示词。" + }, + "environment_kind": { + "type": "string", + "description": "偏好的执行环境;空字符串表示自动选择。", + "enum": [ + "", + "cloud", + "byoc" + ] + }, + "environment_id": { + "type": "string", + "description": "选定的 BYOC Runner ID;自动选择时为空字符串。" + }, + "schedule_trigger_id": { + "type": "string", + "description": "定时触发器 ID。" + }, + "schedule_trigger_enabled": { + "type": "boolean", + "description": "定时触发器是否启用。" + }, + "http_post_trigger_id": { + "type": "string", + "description": "HTTP POST 触发器 ID。" + }, + "http_post_trigger_url": { + "type": "string", + "description": "相对触发地址;调用时需附带 `Authorization: Bearer `。" + }, + "http_post_trigger_enabled": { + "type": "boolean", + "description": "HTTP POST 触发器是否启用。" + }, + "http_post_token": { + "type": "string", + "description": "一次性明文 HTTP 触发 token;仅在创建或轮换 token 后立即返回。" + }, + "can_edit": { + "type": "boolean", + "description": "当前调用者是否可编辑该规则。" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "规则创建时间,Unix 毫秒时间戳。" + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "规则最后更新时间,Unix 毫秒时间戳。" + } + }, + "required": [ + "rule_id", + "account_id", + "team_id", + "owner_id", + "name", + "enabled", + "run_scope", + "cron_expr", + "prompt", + "environment_kind", + "environment_id", + "schedule_trigger_enabled", + "http_post_trigger_enabled", + "can_edit", + "created_at", + "updated_at" + ] + }, + "AutomationTemplateItem": { + "type": "object", + "description": "后端返回的自动化预设模板。", + "properties": { + "name": { + "type": "string", + "description": "模板名称。" + }, + "description": { + "type": "string", + "description": "模板用途的简要说明。" + }, + "icon": { + "type": "string", + "description": "Mintlify / UI 图标名。" + }, + "enabled": { + "type": "boolean", + "description": "模板当前是否对终端用户开放。" + }, + "prompt": { + "type": "string", + "description": "预填的任务提示词。" + } + }, + "required": [ + "name", + "description", + "icon", + "enabled", + "prompt" + ] + }, + "AutomationRunItem": { + "type": "object", + "description": "自动化规则运行历史中的一条执行记录。", + "properties": { + "run_id": { + "type": "string", + "description": "自动化运行 ID。" + }, + "kind": { + "type": "string", + "description": "运行台账类型。", + "enum": [ + "automation_rule" + ] + }, + "account_id": { + "type": "integer", + "format": "int64", + "description": "所属账户 ID。" + }, + "rule_id": { + "type": "string", + "description": "自动化规则 ID。" + }, + "trigger_kind": { + "type": "string", + "description": "本次运行的触发来源。", + "enum": [ + "schedule", + "debug", + "manual", + "http_post", + "test" + ] + }, + "occurrence_key": { + "type": "string", + "description": "触发事件的幂等键。" + }, + "status": { + "type": "string", + "description": "当前或最终运行状态。", + "enum": [ + "queued", + "running", + "retrying", + "succeeded", + "partial", + "failed", + "skipped", + "abandoned" + ] + }, + "attempts": { + "type": "integer", + "description": "当前运行已尝试次数。" + }, + "started_at": { + "type": "integer", + "format": "int64", + "description": "运行开始时间,Unix 毫秒时间戳。" + }, + "completed_at": { + "type": "integer", + "format": "int64", + "description": "运行结束时间,Unix 毫秒时间戳;运行中时为 `0`。" + }, + "duration_ms": { + "type": "integer", + "format": "int64", + "description": "运行耗时(毫秒);运行中时为 `0`。" + }, + "error_code": { + "type": "string", + "description": "运行级错误码(如有)。" + }, + "error_message": { + "type": "string", + "description": "运行级错误消息(如有)。" + }, + "stats_json": { + "type": "object", + "additionalProperties": true, + "description": "运行过程中记录的任意 JSON 指标。" + }, + "result_json": { + "type": "object", + "additionalProperties": true, + "description": "运行结果的任意 JSON 负载。" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "运行记录创建时间,Unix 毫秒时间戳。" + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "运行记录最后更新时间,Unix 毫秒时间戳。" + } + }, + "required": [ + "run_id", + "kind", + "account_id", + "rule_id", + "trigger_kind", + "occurrence_key", + "status", + "attempts", + "started_at", + "completed_at", + "duration_ms", + "error_code", + "error_message", + "created_at", + "updated_at" + ] } } } diff --git a/api-reference/safari.openapi.en.json b/api-reference/safari.openapi.en.json index 8ddb679..8145389 100644 --- a/api-reference/safari.openapi.en.json +++ b/api-reference/safari.openapi.en.json @@ -17,6 +17,12 @@ } ], "tags": [ + { + "name": "AI SRE/Sessions" + }, + { + "name": "AI SRE/Automations" + }, { "name": "AI SRE/Skills" }, @@ -25,19 +31,16 @@ }, { "name": "AI SRE/A2A agents" - }, - { - "name": "AI SRE/Sessions" } ], "paths": { - "/safari/skill/list": { + "/safari/a2a-agent/create": { "post": { - "operationId": "skill-read-list", - "summary": "List skills", - "description": "List AI SRE skills visible to the caller across account and team scopes, with pagination.", + "operationId": "remote-agent-write-create", + "summary": "Create A2A agent", + "description": "Register a new A2A remote agent from its agent-card URL.", "tags": [ - "AI SRE/Skills" + "AI SRE/A2A agents" ], "security": [ { @@ -45,10 +48,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The `content` field is omitted in list rows; fetch a single skill to read its body.\n", - "href": "/en/api-reference/ai-sre/skills/skill-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- `card_url` must resolve to a valid agent card; an unreachable or invalid card returns InvalidParameter.\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-create", "metadata": { - "sidebarTitle": "List skills" + "sidebarTitle": "Create A2A agent" } }, "responses": { @@ -65,7 +68,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SkillListResponse" + "$ref": "#/components/schemas/A2AAgentCreateResponse" } } } @@ -74,33 +77,7 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 1, - "skills": [ - { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", - "account_id": 10023, - "team_id": 0, - "skill_name": "k8s-triage", - "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", - "version": "1.2.0", - "tags": [ - "kubernetes", - "triage" - ], - "author": "sre-team", - "tools": [ - "bash", - "mcp:prometheus/query" - ], - "status": "enabled", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "can_edit": true, - "update_available": false, - "is_modified": false - } - ] + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } @@ -112,6 +89,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -124,25 +104,28 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillListRequest" + "$ref": "#/components/schemas/A2AAgentCreateRequest" }, "example": { - "p": 1, - "limit": 20, - "include_account": true + "agent_name": "deploy-bot", + "instructions": "Use when deployment pipelines need inspection or rollback advice.", + "card_url": "https://agents.example.com/deploy-bot/card", + "auth_type": "bearer", + "streaming": true, + "team_id": 0 } } } } } }, - "/safari/skill/get": { + "/safari/a2a-agent/delete": { "post": { - "operationId": "skill-read-get", - "summary": "Get skill detail", - "description": "Get one skill including its full SKILL.md content.", + "operationId": "remote-agent-write-delete", + "summary": "Delete A2A agent", + "description": "Soft-delete an A2A agent by ID.", "tags": [ - "AI SRE/Skills" + "AI SRE/A2A agents" ], "security": [ { @@ -150,10 +133,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", - "href": "/en/api-reference/ai-sre/skills/skill-read-get", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-delete", "metadata": { - "sidebarTitle": "Get skill detail" + "sidebarTitle": "Delete A2A agent" } }, "responses": { @@ -170,7 +153,8 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SkillItem" + "type": "null", + "description": "Always null on success." } } } @@ -178,31 +162,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", - "account_id": 10023, - "team_id": 0, - "skill_name": "k8s-triage", - "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", - "version": "1.2.0", - "tags": [ - "kubernetes", - "triage" - ], - "author": "sre-team", - "tools": [ - "bash", - "mcp:prometheus/query" - ], - "status": "enabled", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "can_edit": true, - "update_available": false, - "is_modified": false, - "content": "---\nname: k8s-triage\ndescription: ...\n---\n# Triage steps" - } + "data": null } } } @@ -213,6 +173,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -225,23 +188,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillGetRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/safari/skill/update": { + "/safari/a2a-agent/disable": { "post": { - "operationId": "skill-write-update", - "summary": "Update skill", - "description": "Update a skill's description or reassign its team scope.", + "operationId": "remote-agent-write-disable", + "summary": "Disable A2A agent", + "description": "Disable an enabled A2A agent.", "tags": [ - "AI SRE/Skills" + "AI SRE/A2A agents" ], "security": [ { @@ -249,10 +212,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Only `description` and `team_id` are editable; the skill body is changed by re-uploading.\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/skills/skill-write-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-disable", "metadata": { - "sidebarTitle": "Update skill" + "sidebarTitle": "Disable A2A agent" } }, "responses": { @@ -269,7 +232,8 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SkillItem" + "type": "null", + "description": "Always null on success." } } } @@ -277,30 +241,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", - "account_id": 10023, - "team_id": 0, - "skill_name": "k8s-triage", - "description": "Updated triage runbook.", - "version": "1.2.0", - "tags": [ - "kubernetes", - "triage" - ], - "author": "sre-team", - "tools": [ - "bash", - "mcp:prometheus/query" - ], - "status": "enabled", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "can_edit": true, - "update_available": false, - "is_modified": false - } + "data": null } } } @@ -326,24 +267,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillUpdateRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", - "description": "Updated triage runbook." + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/safari/skill/delete": { + "/safari/a2a-agent/enable": { "post": { - "operationId": "skill-write-delete", - "summary": "Delete skill", - "description": "Delete a skill by ID.", + "operationId": "remote-agent-write-enable", + "summary": "Enable A2A agent", + "description": "Enable a disabled A2A agent.", "tags": [ - "AI SRE/Skills" + "AI SRE/A2A agents" ], "security": [ { @@ -351,10 +291,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/skills/skill-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-enable", "metadata": { - "sidebarTitle": "Delete skill" + "sidebarTitle": "Enable A2A agent" } }, "responses": { @@ -406,23 +346,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillDeleteRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/safari/skill/upload": { + "/safari/a2a-agent/get": { "post": { - "operationId": "skill-write-upload", - "summary": "Upload skill", - "description": "Upload a skill archive (.skill/.zip/.tar.gz/.tgz) to create or replace a skill.", + "operationId": "remote-agent-read-get", + "summary": "Get A2A agent detail", + "description": "Get one A2A agent by ID.", "tags": [ - "AI SRE/Skills" + "AI SRE/A2A agents" ], "security": [ { @@ -430,10 +370,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **30 requests/minute**; **3 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Send as `multipart/form-data` with a `file` part. Max archive size is 100MB.\n- Set `replace=true` to overwrite an existing same-name skill.\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/skills/skill-write-upload", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", + "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-read-get", "metadata": { - "sidebarTitle": "Upload skill" + "sidebarTitle": "Get A2A agent detail" } }, "responses": { @@ -450,7 +390,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SkillItem" + "$ref": "#/components/schemas/A2AAgentItem" } } } @@ -459,29 +399,27 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", "account_id": 10023, "team_id": 0, - "skill_name": "k8s-triage", - "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", - "version": "1.2.0", - "tags": [ - "kubernetes", - "triage" - ], - "author": "sre-team", - "tools": [ - "bash", - "mcp:prometheus/query" - ], + "can_edit": true, + "agent_name": "deploy-bot", + "card_url": "https://agents.example.com/deploy-bot/card", + "auth_type": "bearer", + "streaming": true, "status": "enabled", + "agent_card_name": "Deploy Bot", + "agent_card_skills": [ + "rollback", + "diff" + ], + "card_resolve_timeout": 10, + "task_timeout": 120, + "auth_mode": "shared", "created_by": 80011, "created_at": 1716960000000, "updated_at": 1717046400000, - "can_edit": true, - "update_available": false, - "is_modified": false, - "created": true + "instructions": "Remote agent that inspects deployment pipelines." } } } @@ -493,9 +431,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -506,26 +441,25 @@ "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { - "$ref": "#/components/schemas/SkillUploadRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "team_id": 0, - "replace": false + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/safari/skill/enable": { + "/safari/a2a-agent/list": { "post": { - "operationId": "skill-read-enable", - "summary": "Enable skill", - "description": "Enable a disabled skill so the agent can load it.", - "tags": [ - "AI SRE/Skills" + "operationId": "remote-agent-read-list", + "summary": "List A2A agents", + "description": "List A2A agents visible to the caller across account and team scopes, with pagination.", + "tags": [ + "AI SRE/A2A agents" ], "security": [ { @@ -533,10 +467,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Only a `disabled` skill can be enabled; otherwise returns InvalidParameter.\n", - "href": "/en/api-reference/ai-sre/skills/skill-read-enable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Pagination uses `offset`/`limit` (not `p`/`limit`).\n", + "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-read-list", "metadata": { - "sidebarTitle": "Enable skill" + "sidebarTitle": "List A2A agents" } }, "responses": { @@ -553,8 +487,7 @@ "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/A2AAgentListResponse" } } } @@ -562,7 +495,34 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "items": [ + { + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "agent_name": "deploy-bot", + "card_url": "https://agents.example.com/deploy-bot/card", + "auth_type": "bearer", + "streaming": true, + "status": "enabled", + "agent_card_name": "Deploy Bot", + "agent_card_skills": [ + "rollback", + "diff" + ], + "card_resolve_timeout": 10, + "task_timeout": 120, + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "instructions": "Remote agent that inspects deployment pipelines." + } + ], + "total": 1 + } } } } @@ -573,9 +533,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -588,23 +545,25 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillStatusRequest" + "$ref": "#/components/schemas/A2AAgentListRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "offset": 0, + "limit": 20, + "include_account": true } } } } } }, - "/safari/skill/disable": { + "/safari/a2a-agent/update": { "post": { - "operationId": "skill-write-disable", - "summary": "Disable skill", - "description": "Disable an enabled skill so the agent stops loading it.", + "operationId": "remote-agent-write-update", + "summary": "Update A2A agent", + "description": "Apply a partial update to an A2A agent. Omit a field to leave it unchanged.", "tags": [ - "AI SRE/Skills" + "AI SRE/A2A agents" ], "security": [ { @@ -612,10 +571,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Only an `enabled` skill can be disabled; otherwise returns InvalidParameter.\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/skills/skill-write-disable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-update", "metadata": { - "sidebarTitle": "Disable skill" + "sidebarTitle": "Update A2A agent" } }, "responses": { @@ -667,23 +626,24 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillStatusRequest" + "$ref": "#/components/schemas/A2AAgentUpdateRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", + "instructions": "Inspect deployment pipelines and propose rollback steps." } } } } } }, - "/safari/mcp/server/list": { + "/safari/automation/rule/create": { "post": { - "operationId": "mcp-read-server-list", - "summary": "List MCP servers", - "description": "List MCP servers visible to the caller across account and team scopes, with pagination.", + "operationId": "automation-rule-write-create", + "summary": "Create automation rule", + "description": "Create an AI SRE automation rule with schedule and optional HTTP trigger settings.", "tags": [ - "AI SRE/MCP servers" + "AI SRE/Automations" ], "security": [ { @@ -691,10 +651,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The live tool list is not included; fetch a single server to probe its tools.\n", - "href": "/en/api-reference/ai-sre/mcp-servers/mcp-read-server-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Use `team_id=0` for a personal rule or a team ID for a team-owned rule.\n- The request accepts a four-field cron expression; the response normalizes it to five fields with a leading zero minute.\n- If `http_post_trigger_enabled` is true, the response includes a one-time `http_post_token`. Save it immediately; later reads do not return it.\n- Every call is recorded in the account audit log. Do not place secrets in request fields.\n", + "href": "/en/api-reference/ai-sre/automations/automation-rule-write-create", "metadata": { - "sidebarTitle": "List MCP servers" + "sidebarTitle": "Create automation rule" } }, "responses": { @@ -711,46 +671,35 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerListResponse" + "$ref": "#/components/schemas/AutomationRuleItem" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "request_id": "01J1D8PMZEB54X6E5M9K0JD8TZ", "data": { - "total": 1, - "servers": [ - { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ - { - "name": "query", - "description": "Run a PromQL instant query." - }, - { - "name": "query_range", - "description": "Run a PromQL range query." - } - ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 - } - ] + "rule_id": "arule_weekly_insight", + "account_id": 10023, + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": true, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": true, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, + "http_post_token": "sat_live_3Qmz7bKp9f6nR2xT1vHd", + "can_edit": true, + "created_at": 1780272000000, + "updated_at": 1780275600000 } } } @@ -774,25 +723,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerListRequest" + "$ref": "#/components/schemas/AutomationRuleCreateRequest" }, "example": { - "p": 1, - "limit": 20, - "include_account": true + "name": "Weekly on-call insight", + "team_id": 7, + "enabled": true, + "cron_expr": "9 * * 1", + "schedule_trigger_enabled": true, + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "http_post_trigger_enabled": true } } } } } }, - "/safari/mcp/server/create": { + "/safari/automation/rule/delete": { "post": { - "operationId": "mcp-write-server-create", - "summary": "Create MCP server", - "description": "Register a new MCP server (connector) on the account.", + "operationId": "automation-rule-write-delete", + "summary": "Delete automation rule", + "description": "Delete an AI SRE automation rule. Future triggers stop immediately after deletion.", "tags": [ - "AI SRE/MCP servers" + "AI SRE/Automations" ], "security": [ { @@ -800,10 +755,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- `command`/`args`/`env` apply to `stdio`; `url`/`headers` apply to `sse`/`streamable-http`.\n- Server name must be unique within the account; duplicates return InvalidParameter.\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Deleting a rule stops future schedule and HTTP-trigger executions; retained run history is cleaned up by the backend retention job later.\n- Every call is recorded in the account audit log. Do not place secrets in request fields.\n", + "href": "/en/api-reference/ai-sre/automations/automation-rule-write-delete", "metadata": { - "sidebarTitle": "Create MCP server" + "sidebarTitle": "Delete automation rule" } }, "responses": { @@ -820,42 +775,16 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerItem" + "type": "null", + "description": "Always null on success." } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ - { - "name": "query", - "description": "Run a PromQL instant query." - }, - { - "name": "query_range", - "description": "Run a PromQL range query." - } - ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 - } + "request_id": "01J1D8W5SF6G8JQ8Y4S60AV45M", + "data": null } } } @@ -866,9 +795,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -881,27 +807,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerCreateRequest" + "$ref": "#/components/schemas/AutomationRuleIDRequest" }, "example": { - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled" + "rule_id": "arule_weekly_insight" } } } } } }, - "/safari/mcp/server/get": { + "/safari/automation/rule/get": { "post": { - "operationId": "mcp-read-server-get", - "summary": "Get MCP server detail", - "description": "Get one MCP server and run a live probe of its tool list.", + "operationId": "automation-rule-read-get", + "summary": "Get automation rule detail", + "description": "Get one automation rule together with its resolved trigger metadata.", "tags": [ - "AI SRE/MCP servers" + "AI SRE/Automations" ], "security": [ { @@ -909,10 +831,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The detail call live-probes tools; on failure `list_error` is set and the request still succeeds.\n", - "href": "/en/api-reference/ai-sre/mcp-servers/mcp-read-server-get", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The stored `cron_expr` is returned in normalized five-field form.\n- `http_post_token` is usually absent on reads; it is only surfaced immediately after create or token rotation.\n", + "href": "/en/api-reference/ai-sre/automations/automation-rule-read-get", "metadata": { - "sidebarTitle": "Get MCP server detail" + "sidebarTitle": "Get automation rule detail" } }, "responses": { @@ -929,41 +851,34 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerItem" + "$ref": "#/components/schemas/AutomationRuleItem" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "request_id": "01J1D8TANR2PCD3W3EJ0H8Y74M", "data": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "rule_id": "arule_weekly_insight", "account_id": 10023, - "team_id": 0, + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": true, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": true, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ - { - "name": "query", - "description": "Run a PromQL instant query." - }, - { - "name": "query_range", - "description": "Run a PromQL range query." - } - ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 + "created_at": 1780272000000, + "updated_at": 1780275600000 } } } @@ -987,23 +902,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerGetRequest" + "$ref": "#/components/schemas/AutomationRuleIDRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" + "rule_id": "arule_weekly_insight" } } } } } }, - "/safari/mcp/server/update": { + "/safari/automation/rule/list": { "post": { - "operationId": "mcp-write-server-update", - "summary": "Update MCP server", - "description": "Update an MCP server's configuration. Omit a field to leave it unchanged.", + "operationId": "automation-rule-read-list", + "summary": "List automation rules", + "description": "List AI SRE automation rules visible to the caller across personal and team scopes.", "tags": [ - "AI SRE/MCP servers" + "AI SRE/Automations" ], "security": [ { @@ -1011,10 +926,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Masked secret values in `env`/`headers` are preserved — sending the masked value back does not overwrite the stored secret.\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `scope=all` returns the caller's personal rules plus team rules visible through membership; `team_ids` narrows the result after scope resolution.\n- Use `enabled` to filter active vs disabled rules without changing the visibility rules.\n", + "href": "/en/api-reference/ai-sre/automations/automation-rule-read-list", "metadata": { - "sidebarTitle": "Update MCP server" + "sidebarTitle": "List automation rules" } }, "responses": { @@ -1031,41 +946,39 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerItem" + "$ref": "#/components/schemas/AutomationRuleListResponse" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "request_id": "01J1D8Q7M5QR2RM8ZBJW7V1F8N", "data": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics, alerts, and rules.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ - { - "name": "query", - "description": "Run a PromQL instant query." - }, + "total": 1, + "rules": [ { - "name": "query_range", - "description": "Run a PromQL range query." + "rule_id": "arule_weekly_insight", + "account_id": 10023, + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": true, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": true, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, + "can_edit": true, + "created_at": 1780272000000, + "updated_at": 1780275600000 } - ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 + ] } } } @@ -1077,9 +990,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1092,24 +1002,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerUpdateRequest" + "$ref": "#/components/schemas/AutomationRuleListRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "description": "Query Prometheus metrics, alerts, and rules." + "p": 1, + "limit": 20, + "scope": "team", + "team_ids": [ + 7 + ], + "enabled": true } } } } } }, - "/safari/mcp/server/delete": { + "/safari/automation/rule/update": { "post": { - "operationId": "mcp-write-server-delete", - "summary": "Delete MCP server", - "description": "Delete an MCP server by ID.", + "operationId": "automation-rule-write-update", + "summary": "Update automation rule", + "description": "Partially update an AI SRE automation rule and optionally rotate its HTTP trigger token.", "tags": [ - "AI SRE/MCP servers" + "AI SRE/Automations" ], "security": [ { @@ -1117,10 +1032,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Omit any field you do not want to change.\n- Set `rotate_http_post_trigger_token=true` to mint a replacement HTTP trigger token; the previous token becomes invalid immediately.\n- Every call is recorded in the account audit log. Do not place secrets in request fields.\n", + "href": "/en/api-reference/ai-sre/automations/automation-rule-write-update", "metadata": { - "sidebarTitle": "Delete MCP server" + "sidebarTitle": "Update automation rule" } }, "responses": { @@ -1137,16 +1052,36 @@ "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/AutomationRuleItem" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "request_id": "01J1D8V011TBKCX3T7FPQ4T5W7", + "data": { + "rule_id": "arule_weekly_insight", + "account_id": 10023, + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": false, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": false, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, + "can_edit": true, + "created_at": 1780272000000, + "updated_at": 1780275600000, + "http_post_token": "sat_live_r1N6m2YQ9sH4v8Pe0KcA" + } } } } @@ -1157,9 +1092,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1172,23 +1104,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerDeleteRequest" + "$ref": "#/components/schemas/AutomationRuleUpdateRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" + "rule_id": "arule_weekly_insight", + "enabled": false, + "schedule_trigger_enabled": false, + "http_post_trigger_enabled": true, + "rotate_http_post_trigger_token": true } } } } } }, - "/safari/mcp/server/enable": { + "/safari/automation/run/list": { "post": { - "operationId": "mcp-write-server-enable", - "summary": "Enable MCP server", - "description": "Enable a disabled MCP server.", + "operationId": "automation-run-read-list", + "summary": "List automation runs", + "description": "List execution history rows for one AI SRE automation rule.", "tags": [ - "AI SRE/MCP servers" + "AI SRE/Automations" ], "security": [ { @@ -1196,10 +1132,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-enable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `started_after_ms` and `started_before_ms` are Unix timestamps in milliseconds.\n- `trigger_kind` distinguishes schedule, debug, and HTTP-triggered runs for the same rule.\n", + "href": "/en/api-reference/ai-sre/automations/automation-run-read-list", "metadata": { - "sidebarTitle": "Enable MCP server" + "sidebarTitle": "List automation runs" } }, "responses": { @@ -1216,16 +1152,44 @@ "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/AutomationRunListResponse" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "request_id": "01J1D8RSGQ3CS2R2ZH4WFPB0D0", + "data": { + "total": 1, + "runs": [ + { + "run_id": "trun_weekly_20260630", + "kind": "automation_rule", + "account_id": 10023, + "rule_id": "arule_weekly_insight", + "trigger_kind": "schedule", + "occurrence_key": "2026-06-30T01:00:00Z", + "status": "succeeded", + "attempts": 1, + "started_at": 1782781200000, + "completed_at": 1782781685000, + "duration_ms": 485000, + "error_code": "", + "error_message": "", + "stats_json": { + "messages": 128, + "tool_calls": 9 + }, + "result_json": { + "session_id": "sess_hidden_weekly", + "final_event_id": "evt_final_weekly" + }, + "created_at": 1782781200000, + "updated_at": 1782781685000 + } + ] + } } } } @@ -1236,9 +1200,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1251,23 +1212,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerStatusRequest" + "$ref": "#/components/schemas/AutomationRunListRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" + "rule_id": "arule_weekly_insight", + "limit": 20, + "status": "succeeded", + "trigger_kind": "schedule", + "started_after_ms": 1780272000000 } } } } } }, - "/safari/mcp/server/disable": { + "/safari/automation/template/list": { "post": { - "operationId": "mcp-write-server-disable", - "summary": "Disable MCP server", - "description": "Disable an enabled MCP server.", + "operationId": "automation-template-read-list", + "summary": "List automation templates", + "description": "List preset automation templates that prefill rule creation forms for the caller locale.", "tags": [ - "AI SRE/MCP servers" + "AI SRE/Automations" ], "security": [ { @@ -1275,10 +1240,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-disable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- When `locale` is omitted, the backend falls back to the caller UI locale before loading the template file.\n", + "href": "/en/api-reference/ai-sre/automations/automation-template-read-list", "metadata": { - "sidebarTitle": "Disable MCP server" + "sidebarTitle": "List automation templates" } }, "responses": { @@ -1295,16 +1260,25 @@ "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/AutomationTemplateListResponse" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "request_id": "01J1D8QZ3NVJ4H0N1JBBM4WE1R", + "data": { + "templates": [ + { + "name": "Weekly On-Call Insights", + "description": "Generate a weekly operational report for the on-call team.", + "icon": "clipboard-list", + "enabled": true, + "prompt": "Summarize this week's incidents, escalations, and noisy alerts for the on-call team." + } + ] + } } } } @@ -1315,9 +1289,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1330,23 +1301,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerStatusRequest" + "$ref": "#/components/schemas/AutomationTemplateListRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" + "locale": "en-US" } } } } } }, - "/safari/a2a-agent/create": { + "/safari/mcp/server/create": { "post": { - "operationId": "remote-agent-write-create", - "summary": "Create A2A agent", - "description": "Register a new A2A remote agent from its agent-card URL.", + "operationId": "mcp-write-server-create", + "summary": "Create MCP server", + "description": "Register a new MCP server (connector) on the account.", "tags": [ - "AI SRE/A2A agents" + "AI SRE/MCP servers" ], "security": [ { @@ -1354,10 +1325,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- `card_url` must resolve to a valid agent card; an unreachable or invalid card returns InvalidParameter.\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- `command`/`args`/`env` apply to `stdio`; `url`/`headers` apply to `sse`/`streamable-http`.\n- Server name must be unique within the account; duplicates return InvalidParameter.\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-create", "metadata": { - "sidebarTitle": "Create A2A agent" + "sidebarTitle": "Create MCP server" } }, "responses": { @@ -1374,7 +1345,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/A2AAgentCreateResponse" + "$ref": "#/components/schemas/MCPServerItem" } } } @@ -1383,7 +1354,32 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ + { + "name": "query", + "description": "Run a PromQL instant query." + }, + { + "name": "query_range", + "description": "Run a PromQL range query." + } + ], + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 } } } @@ -1410,28 +1406,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentCreateRequest" + "$ref": "#/components/schemas/MCPServerCreateRequest" }, "example": { - "agent_name": "deploy-bot", - "instructions": "Use when deployment pipelines need inspection or rollback advice.", - "card_url": "https://agents.example.com/deploy-bot/card", - "auth_type": "bearer", - "streaming": true, - "team_id": 0 + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled" } } } } } }, - "/safari/a2a-agent/list": { + "/safari/mcp/server/delete": { "post": { - "operationId": "remote-agent-read-list", - "summary": "List A2A agents", - "description": "List A2A agents visible to the caller across account and team scopes, with pagination.", + "operationId": "mcp-write-server-delete", + "summary": "Delete MCP server", + "description": "Delete an MCP server by ID.", "tags": [ - "AI SRE/A2A agents" + "AI SRE/MCP servers" ], "security": [ { @@ -1439,10 +1434,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Pagination uses `offset`/`limit` (not `p`/`limit`).\n", - "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-delete", "metadata": { - "sidebarTitle": "List A2A agents" + "sidebarTitle": "Delete MCP server" } }, "responses": { @@ -1459,7 +1454,8 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/A2AAgentListResponse" + "type": "null", + "description": "Always null on success." } } } @@ -1467,34 +1463,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "agent_name": "deploy-bot", - "card_url": "https://agents.example.com/deploy-bot/card", - "auth_type": "bearer", - "streaming": true, - "status": "enabled", - "agent_card_name": "Deploy Bot", - "agent_card_skills": [ - "rollback", - "diff" - ], - "card_resolve_timeout": 10, - "task_timeout": 120, - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "instructions": "Remote agent that inspects deployment pipelines." - } - ], - "total": 1 - } + "data": null } } } @@ -1505,6 +1474,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1517,25 +1489,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentListRequest" + "$ref": "#/components/schemas/MCPServerDeleteRequest" }, "example": { - "offset": 0, - "limit": 20, - "include_account": true + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } } } }, - "/safari/a2a-agent/get": { + "/safari/mcp/server/disable": { "post": { - "operationId": "remote-agent-read-get", - "summary": "Get A2A agent detail", - "description": "Get one A2A agent by ID.", + "operationId": "mcp-write-server-disable", + "summary": "Disable MCP server", + "description": "Disable an enabled MCP server.", "tags": [ - "AI SRE/A2A agents" + "AI SRE/MCP servers" ], "security": [ { @@ -1543,10 +1513,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", - "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-read-get", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-disable", "metadata": { - "sidebarTitle": "Get A2A agent detail" + "sidebarTitle": "Disable MCP server" } }, "responses": { @@ -1563,7 +1533,8 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/A2AAgentItem" + "type": "null", + "description": "Always null on success." } } } @@ -1571,29 +1542,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "agent_name": "deploy-bot", - "card_url": "https://agents.example.com/deploy-bot/card", - "auth_type": "bearer", - "streaming": true, - "status": "enabled", - "agent_card_name": "Deploy Bot", - "agent_card_skills": [ - "rollback", - "diff" - ], - "card_resolve_timeout": 10, - "task_timeout": 120, - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "instructions": "Remote agent that inspects deployment pipelines." - } + "data": null } } } @@ -1604,6 +1553,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1616,23 +1568,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" + "$ref": "#/components/schemas/MCPServerStatusRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } } } }, - "/safari/a2a-agent/update": { + "/safari/mcp/server/enable": { "post": { - "operationId": "remote-agent-write-update", - "summary": "Update A2A agent", - "description": "Apply a partial update to an A2A agent. Omit a field to leave it unchanged.", + "operationId": "mcp-write-server-enable", + "summary": "Enable MCP server", + "description": "Enable a disabled MCP server.", "tags": [ - "AI SRE/A2A agents" + "AI SRE/MCP servers" ], "security": [ { @@ -1640,10 +1592,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-enable", "metadata": { - "sidebarTitle": "Update A2A agent" + "sidebarTitle": "Enable MCP server" } }, "responses": { @@ -1695,24 +1647,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentUpdateRequest" + "$ref": "#/components/schemas/MCPServerStatusRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", - "instructions": "Inspect deployment pipelines and propose rollback steps." + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } } } }, - "/safari/a2a-agent/enable": { + "/safari/mcp/server/get": { "post": { - "operationId": "remote-agent-write-enable", - "summary": "Enable A2A agent", - "description": "Enable a disabled A2A agent.", + "operationId": "mcp-read-server-get", + "summary": "Get MCP server detail", + "description": "Get one MCP server and run a live probe of its tool list.", "tags": [ - "AI SRE/A2A agents" + "AI SRE/MCP servers" ], "security": [ { @@ -1720,10 +1671,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-enable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The detail call live-probes tools; on failure `list_error` is set and the request still succeeds.\n", + "href": "/en/api-reference/ai-sre/mcp-servers/mcp-read-server-get", "metadata": { - "sidebarTitle": "Enable A2A agent" + "sidebarTitle": "Get MCP server detail" } }, "responses": { @@ -1740,8 +1691,7 @@ "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/MCPServerItem" } } } @@ -1749,7 +1699,34 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ + { + "name": "query", + "description": "Run a PromQL instant query." + }, + { + "name": "query_range", + "description": "Run a PromQL range query." + } + ], + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 + } } } } @@ -1760,9 +1737,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1775,23 +1749,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" + "$ref": "#/components/schemas/MCPServerGetRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } } } }, - "/safari/a2a-agent/disable": { + "/safari/mcp/server/list": { "post": { - "operationId": "remote-agent-write-disable", - "summary": "Disable A2A agent", - "description": "Disable an enabled A2A agent.", + "operationId": "mcp-read-server-list", + "summary": "List MCP servers", + "description": "List MCP servers visible to the caller across account and team scopes, with pagination.", "tags": [ - "AI SRE/A2A agents" + "AI SRE/MCP servers" ], "security": [ { @@ -1799,10 +1773,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-disable", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The live tool list is not included; fetch a single server to probe its tools.\n", + "href": "/en/api-reference/ai-sre/mcp-servers/mcp-read-server-list", "metadata": { - "sidebarTitle": "Disable A2A agent" + "sidebarTitle": "List MCP servers" } }, "responses": { @@ -1819,8 +1793,7 @@ "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/MCPServerListResponse" } } } @@ -1828,7 +1801,39 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "total": 1, + "servers": [ + { + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ + { + "name": "query", + "description": "Run a PromQL instant query." + }, + { + "name": "query_range", + "description": "Run a PromQL range query." + } + ], + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 + } + ] + } } } } @@ -1839,9 +1844,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1854,23 +1856,25 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" + "$ref": "#/components/schemas/MCPServerListRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "p": 1, + "limit": 20, + "include_account": true } } } } } }, - "/safari/a2a-agent/delete": { + "/safari/mcp/server/update": { "post": { - "operationId": "remote-agent-write-delete", - "summary": "Delete A2A agent", - "description": "Soft-delete an A2A agent by ID.", + "operationId": "mcp-write-server-update", + "summary": "Update MCP server", + "description": "Update an MCP server's configuration. Omit a field to leave it unchanged.", "tags": [ - "AI SRE/A2A agents" + "AI SRE/MCP servers" ], "security": [ { @@ -1878,10 +1882,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Agent Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", - "href": "/en/api-reference/ai-sre/a2a-agents/remote-agent-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **MCP Manage** (`ai-sre`) |\n\n## Usage\n\n- Masked secret values in `env`/`headers` are preserved — sending the masked value back does not overwrite the stored secret.\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/mcp-servers/mcp-write-server-update", "metadata": { - "sidebarTitle": "Delete A2A agent" + "sidebarTitle": "Update MCP server" } }, "responses": { @@ -1898,8 +1902,7 @@ "type": "object", "properties": { "data": { - "type": "null", - "description": "Always null on success." + "$ref": "#/components/schemas/MCPServerItem" } } } @@ -1907,7 +1910,34 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics, alerts, and rules.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ + { + "name": "query", + "description": "Run a PromQL instant query." + }, + { + "name": "query_range", + "description": "Run a PromQL range query." + } + ], + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 + } } } } @@ -1933,21 +1963,22 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" + "$ref": "#/components/schemas/MCPServerUpdateRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "description": "Query Prometheus metrics, alerts, and rules." } } } } } }, - "/safari/session/list": { + "/safari/session/delete": { "post": { - "operationId": "session-read-list", - "summary": "List sessions", - "description": "List agent sessions visible to the caller, filtered by app, surface, archive status, and team.", + "operationId": "session-write-delete", + "summary": "Delete session", + "description": "Delete a session by ID.", "tags": [ "AI SRE/Sessions" ], @@ -1957,10 +1988,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Pagination uses `p`/`limit` (max 100); `scope` defaults to `all` (own + member-of-team rows).\n- `is_running` reflects the live run-set; `has_unread` is computed per calling user.\n", - "href": "/en/api-reference/ai-sre/sessions/session-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Requires manage rights on the session (creator, account admin, or owning-team member).\n", + "href": "/en/api-reference/ai-sre/sessions/session-write-delete", "metadata": { - "sidebarTitle": "List sessions" + "sidebarTitle": "Delete session" } }, "responses": { @@ -1977,7 +2008,8 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SessionListResponse" + "type": "null", + "description": "Always null on success." } } } @@ -1985,38 +2017,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 988, - "sessions": [ - { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "session_name": "Investigate cloud-assistant first heartbeat", - "app_name": "ai-sre", - "entry_kind": "web", - "person_id": "3790925372131", - "team_id": 0, - "is_mine": false, - "can_manage": true, - "status": "enabled", - "incognito": false, - "created_at": 1780367971228, - "updated_at": 1780367993457, - "token_usage": { - "input_tokens": 14948, - "cached_tokens": 11520, - "output_tokens": 888, - "reasoning_tokens": 351 - }, - "current_context_tokens": 14948, - "context_window": 0, - "archived_at": 0, - "pinned_at": 0, - "last_event_at": 1780367992649, - "is_running": false, - "has_unread": true - } - ] - } + "data": null } } } @@ -2039,24 +2040,21 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SessionListRequest" + "$ref": "#/components/schemas/SessionDeleteRequest" }, "example": { - "app_name": "ai-sre", - "limit": 2, - "orderby": "updated_at", - "scope": "all" + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u" } } } } } }, - "/safari/session/get": { + "/safari/session/export": { "post": { - "operationId": "session-read-info", - "summary": "Get session detail", - "description": "Fetch one session plus a backward-paged window of its most recent events.", + "operationId": "session-read-export", + "summary": "Export session transcript", + "description": "Stream a session's full event transcript as newline-delimited JSON.", "tags": [ "AI SRE/Sessions" ], @@ -2066,33 +2064,94 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Page older history with `search_after_ctx` from the previous response.\n- `limit` (or legacy `num_recent_events`) caps the event page; default 100, max 1000.\n", - "href": "/en/api-reference/ai-sre/sessions/session-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The response is `application/x-ndjson` — parse line-by-line and write to a file; do not buffer the whole body in memory.\n- The first line is always a `session_meta` envelope; `include_subagents=true` inlines each child session's stream after its dispatch line.\n", + "href": "/en/api-reference/ai-sre/sessions/session-read-export", "metadata": { - "sidebarTitle": "Get session detail" + "sidebarTitle": "Export session transcript" } }, "responses": { "200": { - "description": "Success", + "description": "Streaming NDJSON (application/x-ndjson). One JSON object per line, terminated by a newline. The first line is always a `session_meta` envelope; subsequent lines are session events.", "content": { - "application/json": { + "application/x-ndjson": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ResponseEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/SessionGetResponse" - } - } - } - ] - }, - "example": { + "type": "string", + "description": "Newline-delimited JSON stream. Parse line-by-line; do not buffer the whole body." + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionExportRequest" + }, + "example": { + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "include_subagents": false + } + } + } + } + } + }, + "/safari/session/get": { + "post": { + "operationId": "session-read-info", + "summary": "Get session detail", + "description": "Fetch one session plus a backward-paged window of its most recent events.", + "tags": [ + "AI SRE/Sessions" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Page older history with `search_after_ctx` from the previous response.\n- `limit` (or legacy `num_recent_events`) caps the event page; default 100, max 1000.\n", + "href": "/en/api-reference/ai-sre/sessions/session-read-info", + "metadata": { + "sidebarTitle": "Get session detail" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SessionGetResponse" + } + } + } + ] + }, + "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { "session": { @@ -2185,11 +2244,11 @@ } } }, - "/safari/session/export": { + "/safari/session/list": { "post": { - "operationId": "session-read-export", - "summary": "Export session transcript", - "description": "Stream a session's full event transcript as newline-delimited JSON.", + "operationId": "session-read-list", + "summary": "List sessions", + "description": "List agent sessions visible to the caller, filtered by app, surface, archive status, and team.", "tags": [ "AI SRE/Sessions" ], @@ -2199,20 +2258,66 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The response is `application/x-ndjson` — parse line-by-line and write to a file; do not buffer the whole body in memory.\n- The first line is always a `session_meta` envelope; `include_subagents=true` inlines each child session's stream after its dispatch line.\n", - "href": "/en/api-reference/ai-sre/sessions/session-read-export", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Pagination uses `p`/`limit` (max 100); `scope` defaults to `all` (own + member-of-team rows).\n- `is_running` reflects the live run-set; `has_unread` is computed per calling user.\n", + "href": "/en/api-reference/ai-sre/sessions/session-read-list", "metadata": { - "sidebarTitle": "Export session transcript" + "sidebarTitle": "List sessions" } }, "responses": { "200": { - "description": "Streaming NDJSON (application/x-ndjson). One JSON object per line, terminated by a newline. The first line is always a `session_meta` envelope; subsequent lines are session events.", + "description": "Success", "content": { - "application/x-ndjson": { + "application/json": { "schema": { - "type": "string", - "description": "Newline-delimited JSON stream. Parse line-by-line; do not buffer the whole body." + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SessionListResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "total": 988, + "sessions": [ + { + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "session_name": "Investigate cloud-assistant first heartbeat", + "app_name": "ai-sre", + "entry_kind": "web", + "person_id": "3790925372131", + "team_id": 0, + "is_mine": false, + "can_manage": true, + "status": "enabled", + "incognito": false, + "created_at": 1780367971228, + "updated_at": 1780367993457, + "token_usage": { + "input_tokens": 14948, + "cached_tokens": 11520, + "output_tokens": 888, + "reasoning_tokens": 351 + }, + "current_context_tokens": 14948, + "context_window": 0, + "archived_at": 0, + "pinned_at": 0, + "last_event_at": 1780367992649, + "is_running": false, + "has_unread": true + } + ] + } } } } @@ -2235,24 +2340,26 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SessionExportRequest" + "$ref": "#/components/schemas/SessionListRequest" }, "example": { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "include_subagents": false + "app_name": "ai-sre", + "limit": 2, + "orderby": "updated_at", + "scope": "all" } } } } } }, - "/safari/session/delete": { + "/safari/skill/delete": { "post": { - "operationId": "session-write-delete", - "summary": "Delete session", - "description": "Delete a session by ID.", + "operationId": "skill-write-delete", + "summary": "Delete skill", + "description": "Delete a skill by ID.", "tags": [ - "AI SRE/Sessions" + "AI SRE/Skills" ], "security": [ { @@ -2260,10 +2367,10 @@ } ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Requires manage rights on the session (creator, account admin, or owning-team member).\n", - "href": "/en/api-reference/ai-sre/sessions/session-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/skills/skill-write-delete", "metadata": { - "sidebarTitle": "Delete session" + "sidebarTitle": "Delete skill" } }, "responses": { @@ -2300,6 +2407,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -2312,148 +2422,715 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SessionDeleteRequest" + "$ref": "#/components/schemas/SkillDeleteRequest" }, "example": { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u" + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" } } } } } - } - }, - "components": { - "securitySchemes": { - "AppKeyAuth": { - "type": "apiKey", - "in": "query", - "name": "app_key", - "description": "App key issued from the Flashduty console. Required on every public API call. Keep it secret — it grants the same access as the owning account." - } }, - "responses": { - "BadRequest": { - "description": "Invalid request — usually a missing or malformed parameter.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - }, - "examples": { - "missingParameter": { - "summary": "Missing required parameter", - "value": { + "/safari/skill/disable": { + "post": { + "operationId": "skill-write-disable", + "summary": "Disable skill", + "description": "Disable an enabled skill so the agent stops loading it.", + "tags": [ + "AI SRE/Skills" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Only an `enabled` skill can be disabled; otherwise returns InvalidParameter.\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/skills/skill-write-disable", + "metadata": { + "sidebarTitle": "Disable skill" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "type": "null", + "description": "Always null on success." + } + } + } + ] + }, + "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "error": { - "code": "InvalidParameter", - "message": "The specified parameter skill_id is not valid." - } + "data": null } } } - } - } - }, - "Unauthorized": { - "description": "Missing or invalid app_key.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - }, - "examples": { - "missingAppKey": { - "value": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "error": { - "code": "Unauthorized", - "message": "You are unauthorized." - } - } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillStatusRequest" + }, + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" } } } } - }, - "Forbidden": { - "description": "The app_key is valid but lacks permission for this operation.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - }, - "examples": { - "accessDenied": { - "value": { + } + }, + "/safari/skill/enable": { + "post": { + "operationId": "skill-read-enable", + "summary": "Enable skill", + "description": "Enable a disabled skill so the agent can load it.", + "tags": [ + "AI SRE/Skills" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Only a `disabled` skill can be enabled; otherwise returns InvalidParameter.\n", + "href": "/en/api-reference/ai-sre/skills/skill-read-enable", + "metadata": { + "sidebarTitle": "Enable skill" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "type": "null", + "description": "Always null on success." + } + } + } + ] + }, + "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "error": { - "code": "AccessDenied", - "message": "Access Denied." - } + "data": null } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" } - } - }, - "TooManyRequests": { - "description": "Rate limit hit. Either the global API limit or a per-account limit.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - }, - "examples": { - "rateLimited": { - "value": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "error": { - "code": "RequestTooFrequently", - "message": "Request too frequently." - } - } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillStatusRequest" + }, + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" } } } } - }, - "ServerError": { - "description": "Unexpected server-side error. Include the request_id when reporting.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - }, - "examples": { - "internal": { - "value": { + } + }, + "/safari/skill/get": { + "post": { + "operationId": "skill-read-get", + "summary": "Get skill detail", + "description": "Get one skill including its full SKILL.md content.", + "tags": [ + "AI SRE/Skills" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n", + "href": "/en/api-reference/ai-sre/skills/skill-read-get", + "metadata": { + "sidebarTitle": "Get skill detail" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SkillItem" + } + } + } + ] + }, + "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "error": { - "code": "InternalError", - "message": "We encountered an internal error, and it has been reported. Please try again later." + "data": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "account_id": 10023, + "team_id": 0, + "skill_name": "k8s-triage", + "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", + "version": "1.2.0", + "tags": [ + "kubernetes", + "triage" + ], + "author": "sre-team", + "tools": [ + "bash", + "mcp:prometheus/query" + ], + "status": "enabled", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "can_edit": true, + "update_available": false, + "is_modified": false, + "content": "---\nname: k8s-triage\ndescription: ...\n---\n# Triage steps" } } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillGetRequest" + }, + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + } + } } } } }, - "schemas": { - "ErrorCode": { - "type": "string", - "description": "Flashduty error code enum. Every failed API response sets `error.code` to one of these values. The value is a stable wire string — not a localized message and not a numeric status. HTTP status is informational.", - "enum": [ - "OK", - "InvalidParameter", - "BadRequest", - "InvalidContentType", - "ResourceNotFound", - "NoLicense", - "ReferenceExist", - "Unauthorized", - "BalanceNotEnough", + "/safari/skill/list": { + "post": { + "operationId": "skill-read-list", + "summary": "List skills", + "description": "List AI SRE skills visible to the caller across account and team scopes, with pagination.", + "tags": [ + "AI SRE/Skills" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- The `content` field is omitted in list rows; fetch a single skill to read its body.\n", + "href": "/en/api-reference/ai-sre/skills/skill-read-list", + "metadata": { + "sidebarTitle": "List skills" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SkillListResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "total": 1, + "skills": [ + { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "account_id": 10023, + "team_id": 0, + "skill_name": "k8s-triage", + "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", + "version": "1.2.0", + "tags": [ + "kubernetes", + "triage" + ], + "author": "sre-team", + "tools": [ + "bash", + "mcp:prometheus/query" + ], + "status": "enabled", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "can_edit": true, + "update_available": false, + "is_modified": false + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillListRequest" + }, + "example": { + "p": 1, + "limit": 20, + "include_account": true + } + } + } + } + } + }, + "/safari/skill/update": { + "post": { + "operationId": "skill-write-update", + "summary": "Update skill", + "description": "Update a skill's description or reassign its team scope.", + "tags": [ + "AI SRE/Skills" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Only `description` and `team_id` are editable; the skill body is changed by re-uploading.\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/skills/skill-write-update", + "metadata": { + "sidebarTitle": "Update skill" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SkillItem" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "account_id": 10023, + "team_id": 0, + "skill_name": "k8s-triage", + "description": "Updated triage runbook.", + "version": "1.2.0", + "tags": [ + "kubernetes", + "triage" + ], + "author": "sre-team", + "tools": [ + "bash", + "mcp:prometheus/query" + ], + "status": "enabled", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "can_edit": true, + "update_available": false, + "is_modified": false + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillUpdateRequest" + }, + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "description": "Updated triage runbook." + } + } + } + } + } + }, + "/safari/skill/upload": { + "post": { + "operationId": "skill-write-upload", + "summary": "Upload skill", + "description": "Upload a skill archive (.skill/.zip/.tar.gz/.tgz) to create or replace a skill.", + "tags": [ + "AI SRE/Skills" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **30 requests/minute**; **3 requests/second** per account |\n| Permissions | **Skill Manage** (`ai-sre`) |\n\n## Usage\n\n- Send as `multipart/form-data` with a `file` part. Max archive size is 100MB.\n- Set `replace=true` to overwrite an existing same-name skill.\n- Every call is recorded in the account audit log.\n", + "href": "/en/api-reference/ai-sre/skills/skill-write-upload", + "metadata": { + "sidebarTitle": "Upload skill" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SkillItem" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "account_id": 10023, + "team_id": 0, + "skill_name": "k8s-triage", + "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", + "version": "1.2.0", + "tags": [ + "kubernetes", + "triage" + ], + "author": "sre-team", + "tools": [ + "bash", + "mcp:prometheus/query" + ], + "status": "enabled", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "can_edit": true, + "update_available": false, + "is_modified": false, + "created": true + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/SkillUploadRequest" + }, + "example": { + "team_id": 0, + "replace": false + } + } + } + } + } + } + }, + "components": { + "securitySchemes": { + "AppKeyAuth": { + "type": "apiKey", + "in": "query", + "name": "app_key", + "description": "App key issued from the Flashduty console. Required on every public API call. Keep it secret — it grants the same access as the owning account." + } + }, + "responses": { + "BadRequest": { + "description": "Invalid request — usually a missing or malformed parameter.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "missingParameter": { + "summary": "Missing required parameter", + "value": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "error": { + "code": "InvalidParameter", + "message": "The specified parameter skill_id is not valid." + } + } + } + } + } + } + }, + "Unauthorized": { + "description": "Missing or invalid app_key.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "missingAppKey": { + "value": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "error": { + "code": "Unauthorized", + "message": "You are unauthorized." + } + } + } + } + } + } + }, + "Forbidden": { + "description": "The app_key is valid but lacks permission for this operation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "accessDenied": { + "value": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "error": { + "code": "AccessDenied", + "message": "Access Denied." + } + } + } + } + } + } + }, + "TooManyRequests": { + "description": "Rate limit hit. Either the global API limit or a per-account limit.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "rateLimited": { + "value": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "error": { + "code": "RequestTooFrequently", + "message": "Request too frequently." + } + } + } + } + } + } + }, + "ServerError": { + "description": "Unexpected server-side error. Include the request_id when reporting.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "internal": { + "value": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "error": { + "code": "InternalError", + "message": "We encountered an internal error, and it has been reported. Please try again later." + } + } + } + } + } + } + } + }, + "schemas": { + "ErrorCode": { + "type": "string", + "description": "Flashduty error code enum. Every failed API response sets `error.code` to one of these values. The value is a stable wire string — not a localized message and not a numeric status. HTTP status is informational.", + "enum": [ + "OK", + "InvalidParameter", + "BadRequest", + "InvalidContentType", + "ResourceNotFound", + "NoLicense", + "ReferenceExist", + "Unauthorized", + "BalanceNotEnough", "AccessDenied", "RouteNotFound", "MethodNotAllowed", @@ -2467,362 +3144,804 @@ "ServiceUnavailable" ] }, - "DutyError": { + "DutyError": { + "type": "object", + "description": "Error payload inside the response envelope. Present only on non-2xx responses.", + "properties": { + "code": { + "$ref": "#/components/schemas/ErrorCode" + }, + "message": { + "type": "string", + "description": "Human-readable error message, localized by the caller's Accept-Language. May contain field names, IDs, or other context from the failing request." + } + }, + "required": [ + "code", + "message" + ] + }, + "ResponseEnvelope": { + "type": "object", + "description": "Standard response envelope used by every Flashduty public API. On success `data` contains the endpoint-specific payload and `error` is absent. On failure `error` is present and `data` is absent. `request_id` is always present and is also mirrored in the `Flashcat-Request-Id` response header.", + "properties": { + "request_id": { + "type": "string", + "description": "Unique ID for this request. Mirrored in the Flashcat-Request-Id header. Include it when reporting issues.", + "example": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4" + }, + "error": { + "$ref": "#/components/schemas/DutyError" + }, + "data": { + "description": "Endpoint-specific payload. See each operation's 200 response schema." + } + }, + "required": [ + "request_id" + ] + }, + "ErrorResponse": { + "type": "object", + "description": "Response envelope for errors. `error` is required; `data` is absent.", + "properties": { + "request_id": { + "type": "string", + "example": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4" + }, + "error": { + "$ref": "#/components/schemas/DutyError" + } + }, + "required": [ + "request_id", + "error" + ] + }, + "SkillItem": { + "type": "object", + "description": "An AI SRE skill — a packaged SKILL.md bundle the agent can load.", + "properties": { + "skill_id": { + "type": "string", + "description": "Unique skill ID (prefix `skill_`)." + }, + "account_id": { + "type": "integer", + "description": "Owning account ID.", + "format": "int64" + }, + "team_id": { + "type": "integer", + "description": "Team scope: 0 = account-wide; >0 = the owning team.", + "format": "int64" + }, + "skill_name": { + "type": "string", + "description": "Skill name, unique within the account." + }, + "description": { + "type": "string", + "description": "Human-readable description from the SKILL.md frontmatter." + }, + "content": { + "type": "string", + "description": "Full SKILL.md content. Omitted in list responses." + }, + "version": { + "type": "string", + "description": "Skill version from the frontmatter." + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tags parsed from the frontmatter." + }, + "author": { + "type": "string", + "description": "Skill author." + }, + "license": { + "type": "string", + "description": "Skill license." + }, + "tools": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Required tools (builtin or `mcp:server/tool`)." + }, + "s3_key": { + "type": "string", + "description": "Object-storage key of the skill zip." + }, + "checksum": { + "type": "string", + "description": "SHA-256 checksum of the skill zip." + }, + "status": { + "type": "string", + "description": "Skill status.", + "enum": [ + "enabled", + "disabled" + ] + }, + "created_by": { + "type": "integer", + "description": "Member ID that created the skill.", + "format": "int64" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Creation time. Unix timestamp in milliseconds." + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Last update time. Unix timestamp in milliseconds." + }, + "can_edit": { + "type": "boolean", + "description": "Whether the caller may edit this skill." + }, + "source_template_name": { + "type": "string", + "description": "Marketplace template this skill was installed from; empty for user-authored." + }, + "source_template_version": { + "type": "string", + "description": "Template version at install time." + }, + "update_available": { + "type": "boolean", + "description": "True when the marketplace has a newer template version." + }, + "is_modified": { + "type": "boolean", + "description": "True when a marketplace-sourced skill was edited locally (auto-update skips it)." + }, + "created": { + "type": "boolean", + "description": "Set only on install-from-session responses: true = fresh install, false = in-place update." + } + }, + "required": [ + "skill_id", + "account_id", + "team_id", + "skill_name", + "description", + "status", + "created_by", + "created_at", + "updated_at", + "can_edit", + "update_available", + "is_modified" + ] + }, + "SkillListRequest": { + "type": "object", + "description": "Pagination and team filter for listing skills.", + "properties": { + "p": { + "type": "integer", + "description": "Page number, 1-based.", + "default": 1 + }, + "limit": { + "type": "integer", + "description": "Page size.", + "default": 20 + }, + "team_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "Filter to these team IDs; empty = the caller's visible set." + }, + "include_account": { + "type": [ + "boolean", + "null" + ], + "description": "Include account-scoped (team_id=0) rows. Defaults to true." + } + } + }, + "SkillGetRequest": { + "type": "object", + "description": "Skill lookup by ID.", + "properties": { + "skill_id": { + "type": "string", + "description": "Target skill ID." + } + }, + "required": [ + "skill_id" + ] + }, + "SkillDeleteRequest": { "type": "object", - "description": "Error payload inside the response envelope. Present only on non-2xx responses.", + "description": "Skill deletion by ID.", "properties": { - "code": { - "$ref": "#/components/schemas/ErrorCode" + "skill_id": { + "type": "string", + "description": "Target skill ID." + } + }, + "required": [ + "skill_id" + ] + }, + "SkillStatusRequest": { + "type": "object", + "description": "Skill enable/disable by ID.", + "properties": { + "skill_id": { + "type": "string", + "description": "Target skill ID." + } + }, + "required": [ + "skill_id" + ] + }, + "SkillUpdateRequest": { + "type": "object", + "description": "Editable skill metadata.", + "properties": { + "skill_id": { + "type": "string", + "description": "Target skill ID." + }, + "description": { + "type": "string", + "description": "New description.", + "maxLength": 1024 + }, + "team_id": { + "type": [ + "integer", + "null" + ], + "description": "Reassign team scope: 0 = account-wide; >0 = team. Omit to leave unchanged.", + "format": "int64" + } + }, + "required": [ + "skill_id" + ] + }, + "SkillUploadRequest": { + "type": "object", + "description": "Multipart form for uploading a skill archive.", + "properties": { + "file": { + "type": "string", + "format": "binary", + "description": "Skill archive (.skill / .zip / .tar.gz / .tgz). Max 100MB." + }, + "team_id": { + "type": "integer", + "description": "Team scope for the new skill: 0 = account-wide.", + "format": "int64" + }, + "replace": { + "type": "boolean", + "description": "When true, overwrite an existing same-name skill." + }, + "skill_id": { + "type": "string", + "description": "When replacing a specific skill, its skill ID." + } + }, + "required": [ + "file" + ] + }, + "SkillListResponse": { + "type": "object", + "description": "Paginated skill list.", + "properties": { + "total": { + "type": "integer", + "description": "Total number of matching skills.", + "format": "int64" + }, + "skills": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SkillItem" + }, + "description": "Skills on this page." + } + }, + "required": [ + "total", + "skills" + ] + }, + "MCPToolInfo": { + "type": "object", + "description": "Metadata for one tool exposed by an MCP server.", + "properties": { + "name": { + "type": "string", + "description": "Tool name." + }, + "description": { + "type": "string", + "description": "Tool description." + }, + "input_schema": { + "type": "object", + "additionalProperties": true, + "description": "JSON Schema describing the tool's input parameters." + } + }, + "required": [ + "name", + "description" + ] + }, + "MCPServerItem": { + "type": "object", + "description": "An MCP server (connector) registered on the account.", + "properties": { + "server_id": { + "type": "string", + "description": "Unique MCP server ID (prefix `mcp_`)." + }, + "account_id": { + "type": "integer", + "description": "Owning account ID.", + "format": "int64" + }, + "team_id": { + "type": "integer", + "description": "Team scope: 0 = account-wide; >0 = the owning team.", + "format": "int64" + }, + "can_edit": { + "type": "boolean", + "description": "Whether the caller may edit this server." + }, + "server_name": { + "type": "string", + "description": "MCP server name, unique within the account." + }, + "description": { + "type": "string", + "description": "Server description." + }, + "ai_description": { + "type": "string", + "description": "LLM-generated description, preferred over `description` when present." + }, + "transport": { + "type": "string", + "description": "Transport protocol.", + "enum": [ + "stdio", + "sse", + "streamable-http" + ] + }, + "command": { + "type": "string", + "description": "Executable command (stdio transport only)." + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Command arguments (stdio transport)." + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Environment variables (stdio transport). Secret values are masked." + }, + "url": { + "type": "string", + "description": "Server URL (sse / streamable-http transport)." + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "HTTP headers (sse / streamable-http). Secret values are masked." + }, + "proxy_url": { + "type": "string", + "description": "Outbound proxy URL used to reach the server." + }, + "status": { + "type": "string", + "description": "Server status.", + "enum": [ + "enabled", + "disabled" + ] + }, + "connect_timeout": { + "type": "integer", + "description": "Connection timeout in seconds (0 = server default, 10s)." + }, + "call_timeout": { + "type": "integer", + "description": "Tool-call timeout in seconds (0 = server default, 60s)." + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MCPToolInfo" + }, + "description": "Live tool list; populated by the get/test endpoints." + }, + "tool_count": { + "type": "integer", + "description": "Number of tools in the live list." + }, + "list_error": { + "type": "string", + "description": "Error message when the live tool list failed." + }, + "auth_mode": { + "type": "string", + "description": "Authentication mode.", + "enum": [ + "shared", + "per_user_secret", + "per_user_oauth" + ] }, - "message": { - "type": "string", - "description": "Human-readable error message, localized by the caller's Accept-Language. May contain field names, IDs, or other context from the failing request." - } - }, - "required": [ - "code", - "message" - ] - }, - "ResponseEnvelope": { - "type": "object", - "description": "Standard response envelope used by every Flashduty public API. On success `data` contains the endpoint-specific payload and `error` is absent. On failure `error` is present and `data` is absent. `request_id` is always present and is also mirrored in the `Flashcat-Request-Id` response header.", - "properties": { - "request_id": { + "secret_schema": { "type": "string", - "description": "Unique ID for this request. Mirrored in the Flashcat-Request-Id header. Include it when reporting issues.", - "example": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4" + "description": "JSON-encoded secret schema (per_user_secret mode)." }, - "error": { - "$ref": "#/components/schemas/DutyError" + "oauth_metadata": { + "type": "string", + "description": "JSON-encoded OAuth metadata (per_user_oauth mode)." }, - "data": { - "description": "Endpoint-specific payload. See each operation's 200 response schema." - } - }, - "required": [ - "request_id" - ] - }, - "ErrorResponse": { - "type": "object", - "description": "Response envelope for errors. `error` is required; `data` is absent.", - "properties": { - "request_id": { + "source_template_name": { "type": "string", - "example": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4" + "description": "Marketplace template this connector was installed from; empty for user-authored." }, - "error": { - "$ref": "#/components/schemas/DutyError" + "created_by": { + "type": "integer", + "description": "Member ID that created the server.", + "format": "int64" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Creation time. Unix timestamp in milliseconds." + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Last update time. Unix timestamp in milliseconds." } }, "required": [ - "request_id", - "error" + "server_id", + "account_id", + "team_id", + "can_edit", + "server_name", + "description", + "transport", + "status", + "connect_timeout", + "call_timeout", + "created_by", + "created_at", + "updated_at" ] }, - "SkillItem": { + "MCPServerCreateRequest": { "type": "object", - "description": "An AI SRE skill — a packaged SKILL.md bundle the agent can load.", + "description": "Configuration for a new MCP server.", "properties": { - "skill_id": { - "type": "string", - "description": "Unique skill ID (prefix `skill_`)." - }, - "account_id": { - "type": "integer", - "description": "Owning account ID.", - "format": "int64" - }, - "team_id": { - "type": "integer", - "description": "Team scope: 0 = account-wide; >0 = the owning team.", - "format": "int64" - }, - "skill_name": { + "server_name": { "type": "string", - "description": "Skill name, unique within the account." + "description": "MCP server name, unique within the account.", + "minLength": 1, + "maxLength": 255 }, "description": { "type": "string", - "description": "Human-readable description from the SKILL.md frontmatter." + "description": "Server description.", + "minLength": 1, + "maxLength": 1024 }, - "content": { + "transport": { "type": "string", - "description": "Full SKILL.md content. Omitted in list responses." + "description": "Transport protocol.", + "enum": [ + "stdio", + "sse", + "streamable-http" + ] }, - "version": { + "command": { "type": "string", - "description": "Skill version from the frontmatter." + "description": "Executable command (stdio transport)." }, - "tags": { + "args": { "type": "array", "items": { "type": "string" }, - "description": "Tags parsed from the frontmatter." + "description": "Command arguments (stdio transport)." }, - "author": { - "type": "string", - "description": "Skill author." + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Environment variables (stdio transport)." }, - "license": { + "url": { "type": "string", - "description": "Skill license." + "description": "Server URL (sse / streamable-http transport)." }, - "tools": { - "type": "array", - "items": { + "headers": { + "type": "object", + "additionalProperties": { "type": "string" }, - "description": "Required tools (builtin or `mcp:server/tool`)." + "description": "HTTP headers (sse / streamable-http)." }, - "s3_key": { + "connect_timeout": { + "type": "integer", + "description": "Connection timeout in seconds. 0 = default (10s)." + }, + "call_timeout": { + "type": "integer", + "description": "Tool-call timeout in seconds. 0 = default (60s)." + }, + "auth_mode": { "type": "string", - "description": "Object-storage key of the skill zip." + "description": "Authentication mode: shared (default), per_user_secret, or per_user_oauth." }, - "checksum": { + "secret_schema": { "type": "string", - "description": "SHA-256 checksum of the skill zip." + "description": "JSON secret schema; required when auth_mode=per_user_secret." + }, + "oauth_metadata": { + "type": "string", + "description": "JSON OAuth metadata; reserved for per_user_oauth." }, "status": { "type": "string", - "description": "Skill status.", + "description": "Initial status.", "enum": [ "enabled", "disabled" - ] + ], + "default": "enabled" }, - "created_by": { + "team_id": { "type": "integer", - "description": "Member ID that created the skill.", + "description": "Team scope: 0 = account-wide; >0 = team.", "format": "int64" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Creation time. Unix timestamp in milliseconds." - }, - "updated_at": { - "type": "integer", - "format": "int64", - "description": "Last update time. Unix timestamp in milliseconds." - }, - "can_edit": { - "type": "boolean", - "description": "Whether the caller may edit this skill." - }, "source_template_name": { "type": "string", - "description": "Marketplace template this skill was installed from; empty for user-authored." - }, - "source_template_version": { - "type": "string", - "description": "Template version at install time." - }, - "update_available": { - "type": "boolean", - "description": "True when the marketplace has a newer template version." - }, - "is_modified": { - "type": "boolean", - "description": "True when a marketplace-sourced skill was edited locally (auto-update skips it)." - }, - "created": { - "type": "boolean", - "description": "Set only on install-from-session responses: true = fresh install, false = in-place update." + "description": "Marketplace template name when created from a connector template." } }, "required": [ - "skill_id", - "account_id", - "team_id", - "skill_name", + "server_name", "description", - "status", - "created_by", - "created_at", - "updated_at", - "can_edit", - "update_available", - "is_modified" + "transport" ] }, - "SkillListRequest": { + "MCPServerUpdateRequest": { "type": "object", - "description": "Pagination and team filter for listing skills.", + "description": "Partial update of an MCP server. Omit a field to leave it unchanged.", "properties": { - "p": { + "server_id": { + "type": "string", + "description": "Target MCP server ID." + }, + "server_name": { + "type": "string", + "description": "New name.", + "minLength": 1, + "maxLength": 255 + }, + "description": { + "type": "string", + "description": "New description.", + "minLength": 1, + "maxLength": 1024 + }, + "transport": { + "type": "string", + "description": "Transport protocol.", + "enum": [ + "stdio", + "sse", + "streamable-http" + ] + }, + "command": { + "type": "string", + "description": "Executable command (stdio transport)." + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Command arguments (stdio transport)." + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Environment variables (stdio transport)." + }, + "url": { + "type": "string", + "description": "Server URL (sse / streamable-http transport)." + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "HTTP headers (sse / streamable-http)." + }, + "connect_timeout": { "type": "integer", - "description": "Page number, 1-based.", - "default": 1 + "description": "Connection timeout in seconds. 0 = default (10s)." }, - "limit": { + "call_timeout": { "type": "integer", - "description": "Page size.", - "default": 20 + "description": "Tool-call timeout in seconds. 0 = default (60s)." }, - "team_ids": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "description": "Filter to these team IDs; empty = the caller's visible set." + "auth_mode": { + "type": "string", + "description": "Authentication mode: shared (default), per_user_secret, or per_user_oauth." }, - "include_account": { + "secret_schema": { + "type": "string", + "description": "JSON secret schema; required when auth_mode=per_user_secret." + }, + "oauth_metadata": { + "type": "string", + "description": "JSON OAuth metadata; reserved for per_user_oauth." + }, + "team_id": { "type": [ - "boolean", + "integer", "null" ], - "description": "Include account-scoped (team_id=0) rows. Defaults to true." - } - } - }, - "SkillGetRequest": { - "type": "object", - "description": "Skill lookup by ID.", - "properties": { - "skill_id": { - "type": "string", - "description": "Target skill ID." + "description": "Reassign team scope: 0 = account-wide; >0 = team. Omit to leave unchanged.", + "format": "int64" } }, "required": [ - "skill_id" + "server_id" ] }, - "SkillDeleteRequest": { + "MCPServerGetRequest": { "type": "object", - "description": "Skill deletion by ID.", + "description": "MCP server lookup by ID.", "properties": { - "skill_id": { + "server_id": { "type": "string", - "description": "Target skill ID." + "description": "Target MCP server ID." } }, "required": [ - "skill_id" + "server_id" ] }, - "SkillStatusRequest": { + "MCPServerDeleteRequest": { "type": "object", - "description": "Skill enable/disable by ID.", + "description": "MCP server deletion by ID.", "properties": { - "skill_id": { + "server_id": { "type": "string", - "description": "Target skill ID." + "description": "Target MCP server ID." } }, "required": [ - "skill_id" + "server_id" ] }, - "SkillUpdateRequest": { + "MCPServerStatusRequest": { "type": "object", - "description": "Editable skill metadata.", + "description": "MCP server enable/disable by ID.", "properties": { - "skill_id": { - "type": "string", - "description": "Target skill ID." - }, - "description": { + "server_id": { "type": "string", - "description": "New description.", - "maxLength": 1024 - }, - "team_id": { - "type": [ - "integer", - "null" - ], - "description": "Reassign team scope: 0 = account-wide; >0 = team. Omit to leave unchanged.", - "format": "int64" + "description": "Target MCP server ID." } }, "required": [ - "skill_id" + "server_id" ] }, - "SkillUploadRequest": { + "MCPServerListRequest": { "type": "object", - "description": "Multipart form for uploading a skill archive.", + "description": "Pagination and team filter for listing MCP servers.", "properties": { - "file": { - "type": "string", - "format": "binary", - "description": "Skill archive (.skill / .zip / .tar.gz / .tgz). Max 100MB." + "p": { + "type": "integer", + "description": "Page number, 1-based.", + "default": 1 }, - "team_id": { + "limit": { "type": "integer", - "description": "Team scope for the new skill: 0 = account-wide.", - "format": "int64" + "description": "Page size.", + "default": 20 }, - "replace": { - "type": "boolean", - "description": "When true, overwrite an existing same-name skill." + "team_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "Filter to these team IDs; empty = the caller's visible set." }, - "skill_id": { - "type": "string", - "description": "When replacing a specific skill, its skill ID." + "include_account": { + "type": [ + "boolean", + "null" + ], + "description": "Include account-scoped (team_id=0) rows. Defaults to true." } - }, - "required": [ - "file" - ] + } }, - "SkillListResponse": { + "MCPServerListResponse": { "type": "object", - "description": "Paginated skill list.", + "description": "Paginated MCP server list.", "properties": { "total": { "type": "integer", - "description": "Total number of matching skills.", + "description": "Total number of matching servers.", "format": "int64" }, - "skills": { + "servers": { "type": "array", "items": { - "$ref": "#/components/schemas/SkillItem" + "$ref": "#/components/schemas/MCPServerItem" }, - "description": "Skills on this page." + "description": "MCP servers on this page." } }, "required": [ "total", - "skills" - ] - }, - "MCPToolInfo": { - "type": "object", - "description": "Metadata for one tool exposed by an MCP server.", - "properties": { - "name": { - "type": "string", - "description": "Tool name." - }, - "description": { - "type": "string", - "description": "Tool description." - }, - "input_schema": { - "type": "object", - "additionalProperties": true, - "description": "JSON Schema describing the tool's input parameters." - } - }, - "required": [ - "name", - "description" + "servers" ] }, - "MCPServerItem": { + "A2AAgentItem": { "type": "object", - "description": "An MCP server (connector) registered on the account.", + "description": "A registered A2A (agent-to-agent) remote agent.", "properties": { - "server_id": { + "agent_id": { "type": "string", - "description": "Unique MCP server ID (prefix `mcp_`)." + "description": "Unique A2A agent ID (prefix `a2a_`)." }, "account_id": { "type": "integer", @@ -2836,92 +3955,62 @@ }, "can_edit": { "type": "boolean", - "description": "Whether the caller may edit this server." - }, - "server_name": { - "type": "string", - "description": "MCP server name, unique within the account." - }, - "description": { - "type": "string", - "description": "Server description." + "description": "Whether the caller may edit this agent." }, - "ai_description": { + "agent_name": { "type": "string", - "description": "LLM-generated description, preferred over `description` when present." + "description": "Agent display name." }, - "transport": { + "instructions": { "type": "string", - "description": "Transport protocol.", - "enum": [ - "stdio", - "sse", - "streamable-http" - ] + "description": "Invocation instructions included in AI SRE's system prompt to decide when to call this A2A agent.", + "maxLength": 2000 }, - "command": { + "card_url": { "type": "string", - "description": "Executable command (stdio transport only)." - }, - "args": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Command arguments (stdio transport)." - }, - "env": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Environment variables (stdio transport). Secret values are masked." + "description": "URL of the remote agent card." }, - "url": { + "auth_type": { "type": "string", - "description": "Server URL (sse / streamable-http transport)." + "description": "Authentication type for reaching the remote agent." }, - "headers": { + "auth_config": { "type": "object", "additionalProperties": { "type": "string" }, - "description": "HTTP headers (sse / streamable-http). Secret values are masked." + "description": "Authentication config; secret values are masked." }, - "proxy_url": { - "type": "string", - "description": "Outbound proxy URL used to reach the server." + "streaming": { + "type": "boolean", + "description": "Whether the remote agent supports streaming responses." }, "status": { "type": "string", - "description": "Server status.", + "description": "Agent status.", "enum": [ "enabled", "disabled" ] }, - "connect_timeout": { - "type": "integer", - "description": "Connection timeout in seconds (0 = server default, 10s)." - }, - "call_timeout": { - "type": "integer", - "description": "Tool-call timeout in seconds (0 = server default, 60s)." - }, - "tools": { + "agent_card_name": { + "type": "string", + "description": "Agent name resolved from the remote card." + }, + "agent_card_skills": { "type": "array", "items": { - "$ref": "#/components/schemas/MCPToolInfo" + "type": "string" }, - "description": "Live tool list; populated by the get/test endpoints." + "description": "Skills advertised by the remote card." }, - "tool_count": { + "card_resolve_timeout": { "type": "integer", - "description": "Number of tools in the live list." + "description": "Card-resolution timeout in seconds." }, - "list_error": { - "type": "string", - "description": "Error message when the live tool list failed." + "task_timeout": { + "type": "integer", + "description": "Single-task execution timeout in seconds." }, "auth_mode": { "type": "string", @@ -2940,13 +4029,9 @@ "type": "string", "description": "JSON-encoded OAuth metadata (per_user_oauth mode)." }, - "source_template_name": { - "type": "string", - "description": "Marketplace template this connector was installed from; empty for user-authored." - }, "created_by": { "type": "integer", - "description": "Member ID that created the server.", + "description": "Member ID that created the agent.", "format": "int64" }, "created_at": { @@ -2961,186 +4046,61 @@ } }, "required": [ - "server_id", + "agent_id", "account_id", "team_id", "can_edit", - "server_name", - "description", - "transport", + "agent_name", + "instructions", + "card_url", + "auth_type", + "streaming", "status", - "connect_timeout", - "call_timeout", + "card_resolve_timeout", + "task_timeout", "created_by", "created_at", "updated_at" ] }, - "MCPServerCreateRequest": { + "A2AAgentCreateRequest": { "type": "object", - "description": "Configuration for a new MCP server.", + "description": "Registration parameters for a new A2A agent.", "properties": { - "server_name": { - "type": "string", - "description": "MCP server name, unique within the account.", - "minLength": 1, - "maxLength": 255 - }, - "description": { + "agent_name": { "type": "string", - "description": "Server description.", - "minLength": 1, - "maxLength": 1024 + "description": "Agent display name.", + "maxLength": 128 }, - "transport": { + "instructions": { "type": "string", - "description": "Transport protocol.", - "enum": [ - "stdio", - "sse", - "streamable-http" - ] + "description": "Invocation instructions included in AI SRE's system prompt to decide when to call this A2A agent. Must be nonblank.", + "maxLength": 2000 }, - "command": { + "card_url": { "type": "string", - "description": "Executable command (stdio transport)." - }, - "args": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Command arguments (stdio transport)." - }, - "env": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Environment variables (stdio transport)." + "description": "URL of the remote agent card." }, - "url": { + "auth_type": { "type": "string", - "description": "Server URL (sse / streamable-http transport)." + "description": "Authentication type for the remote agent." }, - "headers": { + "auth_config": { "type": "object", "additionalProperties": { "type": "string" }, - "description": "HTTP headers (sse / streamable-http)." - }, - "connect_timeout": { - "type": "integer", - "description": "Connection timeout in seconds. 0 = default (10s)." - }, - "call_timeout": { - "type": "integer", - "description": "Tool-call timeout in seconds. 0 = default (60s)." - }, - "auth_mode": { - "type": "string", - "description": "Authentication mode: shared (default), per_user_secret, or per_user_oauth." - }, - "secret_schema": { - "type": "string", - "description": "JSON secret schema; required when auth_mode=per_user_secret." - }, - "oauth_metadata": { - "type": "string", - "description": "JSON OAuth metadata; reserved for per_user_oauth." + "description": "Authentication config key-values." }, - "status": { - "type": "string", - "description": "Initial status.", - "enum": [ - "enabled", - "disabled" - ], - "default": "enabled" + "streaming": { + "type": "boolean", + "description": "Whether the remote agent supports streaming." }, "team_id": { "type": "integer", "description": "Team scope: 0 = account-wide; >0 = team.", "format": "int64" }, - "source_template_name": { - "type": "string", - "description": "Marketplace template name when created from a connector template." - } - }, - "required": [ - "server_name", - "description", - "transport" - ] - }, - "MCPServerUpdateRequest": { - "type": "object", - "description": "Partial update of an MCP server. Omit a field to leave it unchanged.", - "properties": { - "server_id": { - "type": "string", - "description": "Target MCP server ID." - }, - "server_name": { - "type": "string", - "description": "New name.", - "minLength": 1, - "maxLength": 255 - }, - "description": { - "type": "string", - "description": "New description.", - "minLength": 1, - "maxLength": 1024 - }, - "transport": { - "type": "string", - "description": "Transport protocol.", - "enum": [ - "stdio", - "sse", - "streamable-http" - ] - }, - "command": { - "type": "string", - "description": "Executable command (stdio transport)." - }, - "args": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Command arguments (stdio transport)." - }, - "env": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Environment variables (stdio transport)." - }, - "url": { - "type": "string", - "description": "Server URL (sse / streamable-http transport)." - }, - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "HTTP headers (sse / streamable-http)." - }, - "connect_timeout": { - "type": "integer", - "description": "Connection timeout in seconds. 0 = default (10s)." - }, - "call_timeout": { - "type": "integer", - "description": "Tool-call timeout in seconds. 0 = default (60s)." - }, "auth_mode": { "type": "string", "description": "Authentication mode: shared (default), per_user_secret, or per_user_oauth." @@ -3152,67 +4112,48 @@ "oauth_metadata": { "type": "string", "description": "JSON OAuth metadata; reserved for per_user_oauth." - }, - "team_id": { - "type": [ - "integer", - "null" - ], - "description": "Reassign team scope: 0 = account-wide; >0 = team. Omit to leave unchanged.", - "format": "int64" - } - }, - "required": [ - "server_id" - ] - }, - "MCPServerGetRequest": { - "type": "object", - "description": "MCP server lookup by ID.", - "properties": { - "server_id": { - "type": "string", - "description": "Target MCP server ID." } }, "required": [ - "server_id" + "agent_name", + "instructions", + "card_url" ] }, - "MCPServerDeleteRequest": { + "A2AAgentCreateResponse": { "type": "object", - "description": "MCP server deletion by ID.", + "description": "Result of registering an A2A agent.", "properties": { - "server_id": { + "agent_id": { "type": "string", - "description": "Target MCP server ID." + "description": "ID of the newly created agent." } }, "required": [ - "server_id" + "agent_id" ] }, - "MCPServerStatusRequest": { + "A2AAgentIDRequest": { "type": "object", - "description": "MCP server enable/disable by ID.", + "description": "A2A agent lookup by ID.", "properties": { - "server_id": { + "agent_id": { "type": "string", - "description": "Target MCP server ID." + "description": "Target agent ID." } }, "required": [ - "server_id" + "agent_id" ] }, - "MCPServerListRequest": { + "A2AAgentListRequest": { "type": "object", - "description": "Pagination and team filter for listing MCP servers.", + "description": "Pagination and team filter for listing A2A agents.", "properties": { - "p": { + "offset": { "type": "integer", - "description": "Page number, 1-based.", - "default": 1 + "description": "Row offset for pagination.", + "default": 0 }, "limit": { "type": "integer", @@ -3236,851 +4177,1205 @@ } } }, - "MCPServerListResponse": { - "type": "object", - "description": "Paginated MCP server list.", - "properties": { - "total": { - "type": "integer", - "description": "Total number of matching servers.", - "format": "int64" - }, - "servers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MCPServerItem" - }, - "description": "MCP servers on this page." - } - }, - "required": [ - "total", - "servers" - ] - }, - "A2AAgentItem": { + "A2AAgentUpdateRequest": { "type": "object", - "description": "A registered A2A (agent-to-agent) remote agent.", + "description": "Partial update of an A2A agent. A null/omitted field is left unchanged.", "properties": { "agent_id": { "type": "string", - "description": "Unique A2A agent ID (prefix `a2a_`)." - }, - "account_id": { - "type": "integer", - "description": "Owning account ID.", - "format": "int64" - }, - "team_id": { - "type": "integer", - "description": "Team scope: 0 = account-wide; >0 = the owning team.", - "format": "int64" - }, - "can_edit": { - "type": "boolean", - "description": "Whether the caller may edit this agent." + "description": "Target agent ID." }, "agent_name": { - "type": "string", - "description": "Agent display name." + "type": [ + "string", + "null" + ], + "description": "New display name. Omit to leave unchanged.", + "maxLength": 128 }, "instructions": { - "type": "string", - "description": "Invocation instructions included in AI SRE's system prompt to decide when to call this A2A agent.", + "type": [ + "string", + "null" + ], + "description": "New invocation instructions. Omit to leave unchanged; when supplied, must be nonblank.", "maxLength": 2000 }, "card_url": { - "type": "string", - "description": "URL of the remote agent card." + "type": [ + "string", + "null" + ], + "description": "New card URL. Omit to leave unchanged." }, "auth_type": { - "type": "string", - "description": "Authentication type for reaching the remote agent." + "type": [ + "string", + "null" + ], + "description": "New auth type. Omit to leave unchanged." }, "auth_config": { "type": "object", "additionalProperties": { "type": "string" }, - "description": "Authentication config; secret values are masked." + "description": "Replace the auth config. Omit to leave unchanged." }, "streaming": { - "type": "boolean", - "description": "Whether the remote agent supports streaming responses." - }, - "status": { - "type": "string", - "description": "Agent status.", - "enum": [ - "enabled", - "disabled" - ] - }, - "agent_card_name": { - "type": "string", - "description": "Agent name resolved from the remote card." - }, - "agent_card_skills": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Skills advertised by the remote card." - }, - "card_resolve_timeout": { - "type": "integer", - "description": "Card-resolution timeout in seconds." + "type": [ + "boolean", + "null" + ], + "description": "Toggle streaming support. Omit to leave unchanged." }, - "task_timeout": { - "type": "integer", - "description": "Single-task execution timeout in seconds." + "team_id": { + "type": [ + "integer", + "null" + ], + "description": "Reassign team scope. Omit to leave unchanged.", + "format": "int64" }, "auth_mode": { - "type": "string", - "description": "Authentication mode.", - "enum": [ - "shared", - "per_user_secret", - "per_user_oauth" - ] + "type": [ + "string", + "null" + ], + "description": "New auth mode: shared, per_user_secret, or per_user_oauth." }, "secret_schema": { - "type": "string", - "description": "JSON-encoded secret schema (per_user_secret mode)." + "type": [ + "string", + "null" + ], + "description": "New JSON secret schema." }, "oauth_metadata": { - "type": "string", - "description": "JSON-encoded OAuth metadata (per_user_oauth mode)." + "type": [ + "string", + "null" + ], + "description": "New JSON OAuth metadata." + } + }, + "required": [ + "agent_id" + ] + }, + "A2AAgentListResponse": { + "type": "object", + "description": "Paginated A2A agent list.", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/A2AAgentItem" + }, + "description": "A2A agents on this page." }, - "created_by": { + "total": { "type": "integer", - "description": "Member ID that created the agent.", + "description": "Total number of matching agents.", "format": "int64" + } + }, + "required": [ + "items", + "total" + ] + }, + "SessionGetRequest": { + "type": "object", + "description": "Fetch one session plus a backward-paged window of its most recent events.", + "properties": { + "session_id": { + "type": "string", + "description": "Target session ID.", + "minLength": 1 }, - "created_at": { + "num_recent_events": { "type": "integer", - "format": "int64", - "description": "Creation time. Unix timestamp in milliseconds." + "description": "Legacy page size: number of most-recent events to return. Superseded by `limit` when both are set; 0 uses the server default (100).", + "minimum": 0, + "maximum": 1000 }, - "updated_at": { + "limit": { "type": "integer", - "format": "int64", - "description": "Last update time. Unix timestamp in milliseconds." + "description": "Page size for events; takes precedence over `num_recent_events`. 0 uses the server default (100).", + "minimum": 0, + "maximum": 1000 + }, + "search_after_ctx": { + "type": "string", + "description": "Opaque keyset cursor from a previous response; pass it back to fetch the next older page.", + "maxLength": 4096 } }, "required": [ - "agent_id", - "account_id", - "team_id", - "can_edit", - "agent_name", - "instructions", - "card_url", - "auth_type", - "streaming", - "status", - "card_resolve_timeout", - "task_timeout", - "created_by", - "created_at", - "updated_at" + "session_id" ] }, - "A2AAgentCreateRequest": { + "SessionListRequest": { "type": "object", - "description": "Registration parameters for a new A2A agent.", + "description": "Filters for listing agent sessions. Reads are scoped to the resolved account and the caller's visible teams.", "properties": { - "agent_name": { + "app_name": { "type": "string", - "description": "Agent display name.", - "maxLength": 128 + "description": "Agent app whose sessions to list.", + "enum": [ + "ask-ai", + "support", + "support-website", + "support-flashcat", + "ai-sre", + "template-assistant", + "swe" + ] }, - "instructions": { - "type": "string", - "description": "Invocation instructions included in AI SRE's system prompt to decide when to call this A2A agent. Must be nonblank.", - "maxLength": 2000 + "p": { + "type": "integer", + "description": "Page number, 1-based.", + "default": 1, + "minimum": 1 }, - "card_url": { - "type": "string", - "description": "URL of the remote agent card." + "limit": { + "type": "integer", + "description": "Page size, 1–100.", + "minimum": 1, + "maximum": 100, + "default": 20 }, - "auth_type": { + "orderby": { "type": "string", - "description": "Authentication type for the remote agent." - }, - "auth_config": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Authentication config key-values." + "description": "Sort field.", + "enum": [ + "created_at", + "updated_at" + ] }, - "streaming": { + "asc": { "type": "boolean", - "description": "Whether the remote agent supports streaming." + "description": "Ascending order when true; applies only when `orderby` is set." }, - "team_id": { - "type": "integer", - "description": "Team scope: 0 = account-wide; >0 = team.", - "format": "int64" + "include_subagent_sessions": { + "type": "boolean", + "description": "Include subagent-dispatched sessions in the list." }, - "auth_mode": { + "keyword": { "type": "string", - "description": "Authentication mode: shared (default), per_user_secret, or per_user_oauth." + "description": "Filter by session-name keyword.", + "maxLength": 64 }, - "secret_schema": { + "scope": { "type": "string", - "description": "JSON secret schema; required when auth_mode=per_user_secret." + "description": "Visibility scope: all (own + member-of-team rows, default), personal, or team.", + "enum": [ + "all", + "personal", + "team" + ] }, - "oauth_metadata": { + "team_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "Optional explicit team filter; intersects with `scope`." + }, + "entry_kinds": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "web", + "im", + "api", + "automation" + ] + }, + "description": "Restrict to sessions produced by these surfaces; empty returns every kind." + }, + "status": { "type": "string", - "description": "JSON OAuth metadata; reserved for per_user_oauth." + "description": "Archive bucket: active (default) returns un-archived, archived returns archived, all returns both.", + "enum": [ + "active", + "archived", + "all" + ] } }, "required": [ - "agent_name", - "instructions", - "card_url" + "app_name" ] }, - "A2AAgentCreateResponse": { + "SessionExportRequest": { "type": "object", - "description": "Result of registering an A2A agent.", + "description": "Export the full event transcript of one session as a streaming NDJSON body.", "properties": { - "agent_id": { + "session_id": { "type": "string", - "description": "ID of the newly created agent." + "description": "Target session ID." + }, + "include_subagents": { + "type": "boolean", + "description": "When true, each subagent_dispatch line is followed by the child session's full event stream, bracketed by its own session_meta. Defaults to false." } }, "required": [ - "agent_id" + "session_id" ] }, - "A2AAgentIDRequest": { + "SessionDeleteRequest": { "type": "object", - "description": "A2A agent lookup by ID.", + "description": "Session deletion by ID.", "properties": { - "agent_id": { + "session_id": { "type": "string", - "description": "Target agent ID." + "description": "Target session ID.", + "minLength": 1 } }, "required": [ - "agent_id" + "session_id" ] }, - "A2AAgentListRequest": { + "SessionItem": { "type": "object", - "description": "Pagination and team filter for listing A2A agents.", + "description": "One agent session row.", "properties": { - "offset": { - "type": "integer", - "description": "Row offset for pagination.", - "default": 0 + "session_id": { + "type": "string", + "description": "Session identifier." }, - "limit": { + "parent_session_id": { + "type": "string", + "description": "Parent session id for subagent (child) sessions; empty otherwise." + }, + "session_name": { + "type": "string", + "description": "Session title; may be empty for untitled sessions." + }, + "app_name": { + "type": "string", + "description": "Agent app that owns the session." + }, + "entry_kind": { + "type": "string", + "description": "Surface that created the session.", + "enum": [ + "web", + "im", + "api", + "scheduled", + "subagent" + ] + }, + "person_id": { + "type": "string", + "description": "Creator person id." + }, + "team_id": { "type": "integer", - "description": "Page size.", - "default": 20 + "format": "int64", + "description": "Owning team id; 0 means no team is bound. Immutable after create." }, - "team_ids": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "description": "Filter to these team IDs; empty = the caller's visible set." + "team_name": { + "type": "string", + "description": "Resolved team name; empty for unbound rows or deleted teams." }, - "include_account": { - "type": [ - "boolean", - "null" - ], - "description": "Include account-scoped (team_id=0) rows. Defaults to true." - } - } - }, - "A2AAgentUpdateRequest": { - "type": "object", - "description": "Partial update of an A2A agent. A null/omitted field is left unchanged.", - "properties": { - "agent_id": { + "is_mine": { + "type": "boolean", + "description": "True when the caller created this session." + }, + "can_manage": { + "type": "boolean", + "description": "True when the caller may rename/archive/delete the session." + }, + "status": { "type": "string", - "description": "Target agent ID." + "description": "Lifecycle status.", + "enum": [ + "enabled", + "deleted" + ] }, - "agent_name": { - "type": [ - "string", - "null" - ], - "description": "New display name. Omit to leave unchanged.", - "maxLength": 128 + "incognito": { + "type": "boolean", + "description": "True for incognito (non-persisted-memory) sessions." }, - "instructions": { - "type": [ - "string", - "null" - ], - "description": "New invocation instructions. Omit to leave unchanged; when supplied, must be nonblank.", - "maxLength": 2000 + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds when the session was created." }, - "card_url": { - "type": [ - "string", - "null" - ], - "description": "New card URL. Omit to leave unchanged." + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds of the last session update." }, - "auth_type": { - "type": [ - "string", - "null" - ], - "description": "New auth type. Omit to leave unchanged." + "template_staging_round_id": { + "type": "string", + "description": "Current save→validate round id (template-assistant only); empty otherwise." }, - "auth_config": { + "state": { "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Replace the auth config. Omit to leave unchanged." + "additionalProperties": true, + "description": "Raw session-state bag (session-scoped keys). Omitted when empty." }, - "streaming": { - "type": [ - "boolean", - "null" - ], - "description": "Toggle streaming support. Omit to leave unchanged." + "bound_environment": { + "$ref": "#/components/schemas/EnvironmentBinding" }, - "team_id": { - "type": [ - "integer", - "null" - ], - "description": "Reassign team scope. Omit to leave unchanged.", - "format": "int64" + "context_resolved": { + "$ref": "#/components/schemas/ContextResolvedItem" + }, + "token_usage": { + "$ref": "#/components/schemas/SessionTokenUsage" + }, + "current_context_tokens": { + "type": "integer", + "format": "int64", + "description": "Size in tokens of the LLM context window as of the most recent turn. 0 means no turn has completed." + }, + "context_window": { + "type": "integer", + "format": "int64", + "description": "The bound model's max context size in tokens. 0 means unknown." + }, + "archived_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds when archived; 0 means not archived." + }, + "pinned_at": { + "type": "integer", + "format": "int64", + "description": "Caller's per-user pin timestamp in milliseconds; 0 means not pinned." }, - "auth_mode": { - "type": [ - "string", - "null" - ], - "description": "New auth mode: shared, per_user_secret, or per_user_oauth." + "last_event_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds of the most recent assistant-side event." }, - "secret_schema": { - "type": [ - "string", - "null" - ], - "description": "New JSON secret schema." + "is_running": { + "type": "boolean", + "description": "True when an agent turn is currently in flight for this session." }, - "oauth_metadata": { - "type": [ - "string", - "null" - ], - "description": "New JSON OAuth metadata." + "has_unread": { + "type": "boolean", + "description": "True when there is assistant output the caller has not yet viewed." } - }, - "required": [ - "agent_id" - ] + } }, - "A2AAgentListResponse": { + "SessionGetResponse": { "type": "object", - "description": "Paginated A2A agent list.", + "description": "A session plus a backward-paged window of its events.", "properties": { - "items": { + "session": { + "$ref": "#/components/schemas/SessionItem" + }, + "events": { "type": "array", "items": { - "$ref": "#/components/schemas/A2AAgentItem" + "$ref": "#/components/schemas/EventItem" }, - "description": "A2A agents on this page." + "description": "Recent events, ascending by (created_at, event_id)." }, - "total": { - "type": "integer", - "description": "Total number of matching agents.", - "format": "int64" + "has_more_older": { + "type": "boolean", + "description": "True when older events remain beyond this page." + }, + "search_after_ctx": { + "type": "string", + "description": "Opaque keyset cursor; pass back as search_after_ctx to fetch the next older page. Omitted when has_more_older is false." } - }, - "required": [ - "items", - "total" - ] + } }, - "SessionGetRequest": { + "SessionListResponse": { "type": "object", - "description": "Fetch one session plus a backward-paged window of its most recent events.", + "description": "A page of agent sessions.", "properties": { - "session_id": { - "type": "string", - "description": "Target session ID.", - "minLength": 1 - }, - "num_recent_events": { - "type": "integer", - "description": "Legacy page size: number of most-recent events to return. Superseded by `limit` when both are set; 0 uses the server default (100).", - "minimum": 0, - "maximum": 1000 - }, - "limit": { + "total": { "type": "integer", - "description": "Page size for events; takes precedence over `num_recent_events`. 0 uses the server default (100).", - "minimum": 0, - "maximum": 1000 + "format": "int64", + "description": "Total number of sessions matching the filter (ignoring pagination)." }, - "search_after_ctx": { - "type": "string", - "description": "Opaque keyset cursor from a previous response; pass it back to fetch the next older page.", - "maxLength": 4096 + "sessions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionItem" + }, + "description": "The page of sessions." } - }, - "required": [ - "session_id" - ] + } }, - "SessionListRequest": { + "EventItem": { "type": "object", - "description": "Filters for listing agent sessions. Reads are scoped to the resolved account and the caller's visible teams.", + "description": "One persisted session event. content/actions/usage_metadata carry the raw ADK envelope; treat them as opaque structured payloads.", "properties": { - "app_name": { + "event_id": { "type": "string", - "description": "Agent app whose sessions to list.", - "enum": [ - "ask-ai", - "support", - "support-website", - "support-flashcat", - "ai-sre", - "template-assistant", - "swe" - ] + "description": "Event identifier." }, - "p": { - "type": "integer", - "description": "Page number, 1-based.", - "default": 1, - "minimum": 1 + "session_id": { + "type": "string", + "description": "Owning session id." }, - "limit": { - "type": "integer", - "description": "Page size, 1–100.", - "minimum": 1, - "maximum": 100, - "default": 20 + "invocation_id": { + "type": "string", + "description": "ADK invocation id grouping a turn." }, - "orderby": { + "author": { "type": "string", - "description": "Sort field.", - "enum": [ - "created_at", - "updated_at" - ] + "description": "Event author (e.g. user, the agent name)." }, - "asc": { + "branch": { + "type": "string", + "description": "ADK branch path for nested agents." + }, + "content": { + "type": "object", + "additionalProperties": true, + "description": "ADK content envelope {role, parts:[...]}." + }, + "actions": { + "type": "object", + "additionalProperties": true, + "description": "ADK actions envelope (state deltas, transfers, escalation)." + }, + "usage_metadata": { + "type": "object", + "additionalProperties": true, + "description": "Per-turn token usage metadata." + }, + "partial": { "type": "boolean", - "description": "Ascending order when true; applies only when `orderby` is set." + "description": "True for a streaming partial chunk." }, - "include_subagent_sessions": { + "turn_complete": { "type": "boolean", - "description": "Include subagent-dispatched sessions in the list." + "description": "True on the terminal event of a turn." }, - "keyword": { + "error_code": { "type": "string", - "description": "Filter by session-name keyword.", - "maxLength": 64 + "description": "Error code when the event represents a failure." }, - "scope": { + "error_message": { "type": "string", - "description": "Visibility scope: all (own + member-of-team rows, default), personal, or team.", - "enum": [ - "all", - "personal", - "team" - ] - }, - "team_ids": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "description": "Optional explicit team filter; intersects with `scope`." - }, - "entry_kinds": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "web", - "im", - "api", - "automation" - ] - }, - "description": "Restrict to sessions produced by these surfaces; empty returns every kind." + "description": "Human-readable error message, when present." }, "status": { "type": "string", - "description": "Archive bucket: active (default) returns un-archived, archived returns archived, all returns both.", + "description": "Event status.", "enum": [ - "active", - "archived", - "all" + "normal", + "compressed" ] + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds when the event was written." } - }, - "required": [ - "app_name" - ] + } }, - "SessionExportRequest": { + "SessionTokenUsage": { "type": "object", - "description": "Export the full event transcript of one session as a streaming NDJSON body.", + "description": "Cumulative session-level token rollup across all turns. The account-billing source of truth.", "properties": { - "session_id": { - "type": "string", - "description": "Target session ID." + "input_tokens": { + "type": "integer", + "format": "int64", + "description": "Total prompt (input) tokens, including the cached portion." }, - "include_subagents": { - "type": "boolean", - "description": "When true, each subagent_dispatch line is followed by the child session's full event stream, bracketed by its own session_meta. Defaults to false." + "cached_tokens": { + "type": "integer", + "format": "int64", + "description": "Portion of input_tokens served from the prompt cache." + }, + "output_tokens": { + "type": "integer", + "format": "int64", + "description": "Total generated (output) tokens." + }, + "reasoning_tokens": { + "type": "integer", + "format": "int64", + "description": "Total reasoning/thinking tokens." } - }, - "required": [ - "session_id" - ] + } }, - "SessionDeleteRequest": { + "EnvironmentBinding": { "type": "object", - "description": "Session deletion by ID.", + "description": "The runner or cloud sandbox the session is bound to. Null until the first message.", "properties": { - "session_id": { + "kind": { "type": "string", - "description": "Target session ID.", - "minLength": 1 + "description": "Environment kind (e.g. runner, sandbox)." + }, + "id": { + "type": "string", + "description": "Environment identifier." + }, + "name": { + "type": "string", + "description": "Human-readable environment name." + }, + "status": { + "type": "string", + "description": "Binding status." } - }, - "required": [ - "session_id" - ] + } }, - "SessionItem": { + "ContextResolvedItem": { "type": "object", - "description": "One agent session row.", + "description": "Snapshot of the three-tier knowledge-pack resolution for this session.", "properties": { - "session_id": { - "type": "string", - "description": "Session identifier." - }, - "parent_session_id": { + "account_pack_id": { "type": "string", - "description": "Parent session id for subagent (child) sessions; empty otherwise." + "description": "Resolved account-scoped pack id." }, - "session_name": { + "team_pack_id": { "type": "string", - "description": "Session title; may be empty for untitled sessions." + "description": "Resolved team-scoped pack id." }, - "app_name": { + "incident_id": { "type": "string", - "description": "Agent app that owns the session." + "description": "Bound incident id, when war-room originated." }, - "entry_kind": { - "type": "string", - "description": "Surface that created the session.", - "enum": [ - "web", - "im", - "api", - "scheduled", - "subagent" - ] + "resolved_at_ms": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds when the packs were resolved." }, - "person_id": { + "versions": { + "type": "object", + "additionalProperties": { + "type": "integer" + }, + "description": "Per-pack resolved version map." + } + } + }, + "AutomationRuleCreateRequest": { + "type": "object", + "description": "Configuration for a new AI SRE automation rule.", + "properties": { + "name": { "type": "string", - "description": "Creator person id." + "description": "Rule name.", + "minLength": 1, + "maxLength": 255 }, "team_id": { "type": "integer", "format": "int64", - "description": "Owning team id; 0 means no team is bound. Immutable after create." + "description": "Scope owner. Use `0` for a personal rule or a team ID for a team rule.", + "minimum": 0 }, - "team_name": { + "enabled": { + "type": "boolean", + "description": "Whether the rule is enabled immediately after creation." + }, + "cron_expr": { "type": "string", - "description": "Resolved team name; empty for unbound rows or deleted teams." + "description": "Four-field cron expression in API format: hour, day-of-month, month, day-of-week." }, - "is_mine": { - "type": "boolean", - "description": "True when the caller created this session." + "schedule_trigger_enabled": { + "type": [ + "boolean", + "null" + ], + "description": "Override the schedule trigger state. Omit to keep the default enabled state." }, - "can_manage": { - "type": "boolean", - "description": "True when the caller may rename/archive/delete the session." + "prompt": { + "type": "string", + "description": "Task prompt executed on every automation run.", + "minLength": 1 }, - "status": { + "environment_kind": { "type": "string", - "description": "Lifecycle status.", + "description": "Preferred execution environment. Omit to let the backend auto-pick.", "enum": [ - "enabled", - "deleted" + "cloud", + "byoc" ] }, - "incognito": { + "environment_id": { + "type": "string", + "description": "Concrete BYOC runner ID when `environment_kind` is `byoc`." + }, + "http_post_trigger_enabled": { "type": "boolean", - "description": "True for incognito (non-persisted-memory) sessions." + "description": "Whether to provision the HTTP POST trigger alongside the schedule trigger." + } + }, + "required": [ + "name", + "cron_expr", + "prompt" + ] + }, + "AutomationRuleUpdateRequest": { + "type": "object", + "description": "Partial update of an AI SRE automation rule. Omit fields you do not want to change.", + "properties": { + "rule_id": { + "type": "string", + "description": "Target automation rule ID." }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp in milliseconds when the session was created." + "name": { + "type": [ + "string", + "null" + ], + "description": "New rule name.", + "maxLength": 255 }, - "updated_at": { - "type": "integer", + "team_id": { + "type": [ + "integer", + "null" + ], "format": "int64", - "description": "Unix timestamp in milliseconds of the last session update." + "description": "Move the rule to another scope. `0` = personal rule.", + "minimum": 0 }, - "template_staging_round_id": { - "type": "string", - "description": "Current save→validate round id (template-assistant only); empty otherwise." + "enabled": { + "type": [ + "boolean", + "null" + ], + "description": "Enable or disable the rule." }, - "state": { - "type": "object", - "additionalProperties": true, - "description": "Raw session-state bag (session-scoped keys). Omitted when empty." + "cron_expr": { + "type": [ + "string", + "null" + ], + "description": "Replacement four-field cron expression." }, - "bound_environment": { - "$ref": "#/components/schemas/EnvironmentBinding" + "schedule_trigger_enabled": { + "type": [ + "boolean", + "null" + ], + "description": "Enable or disable the schedule trigger." }, - "context_resolved": { - "$ref": "#/components/schemas/ContextResolvedItem" + "prompt": { + "type": [ + "string", + "null" + ], + "description": "Replacement task prompt." + }, + "environment_kind": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cloud", + "byoc" + ] + }, + { + "type": "null" + } + ], + "description": "Preferred execution environment. Set to `null` or omit to leave unchanged." }, - "token_usage": { - "$ref": "#/components/schemas/SessionTokenUsage" + "environment_id": { + "type": [ + "string", + "null" + ], + "description": "Replacement BYOC runner ID. Use an empty string to clear the binding when switching away from BYOC." }, - "current_context_tokens": { - "type": "integer", - "format": "int64", - "description": "Size in tokens of the LLM context window as of the most recent turn. 0 means no turn has completed." + "http_post_trigger_enabled": { + "type": [ + "boolean", + "null" + ], + "description": "Enable or disable the HTTP POST trigger." }, - "context_window": { + "rotate_http_post_trigger_token": { + "type": "boolean", + "description": "Rotate the HTTP trigger token. The previous token becomes invalid." + } + }, + "required": [ + "rule_id" + ] + }, + "AutomationRuleIDRequest": { + "type": "object", + "description": "Select one automation rule by ID.", + "properties": { + "rule_id": { + "type": "string", + "description": "Automation rule ID." + } + }, + "required": [ + "rule_id" + ] + }, + "AutomationRuleListRequest": { + "type": "object", + "description": "Pagination and visibility filters for listing automation rules.", + "properties": { + "p": { "type": "integer", - "format": "int64", - "description": "The bound model's max context size in tokens. 0 means unknown." + "description": "Page number, 1-based.", + "default": 1, + "minimum": 1 }, - "archived_at": { + "limit": { "type": "integer", - "format": "int64", - "description": "Unix timestamp in milliseconds when archived; 0 means not archived." + "description": "Page size.", + "default": 20, + "minimum": 1 }, - "pinned_at": { - "type": "integer", - "format": "int64", - "description": "Caller's per-user pin timestamp in milliseconds; 0 means not pinned." + "scope": { + "type": "string", + "description": "Visibility bucket.", + "enum": [ + "all", + "personal", + "team" + ] }, - "last_event_at": { + "team_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "Optional team filter applied after scope resolution." + }, + "include_person": { + "type": [ + "boolean", + "null" + ], + "description": "Legacy scope switch. When `scope` is omitted and this is `false`, only team rules are returned." + }, + "enabled": { + "type": [ + "boolean", + "null" + ], + "description": "Filter by enabled state." + }, + "keyword": { + "type": "string", + "description": "Substring match against the rule name.", + "maxLength": 64 + } + } + }, + "AutomationRuleListResponse": { + "type": "object", + "description": "Page of automation rules visible to the caller.", + "properties": { + "total": { "type": "integer", "format": "int64", - "description": "Unix timestamp in milliseconds of the most recent assistant-side event." - }, - "is_running": { - "type": "boolean", - "description": "True when an agent turn is currently in flight for this session." + "description": "Total matching rules." }, - "has_unread": { - "type": "boolean", - "description": "True when there is assistant output the caller has not yet viewed." + "rules": { + "type": "array", + "description": "Current page of rules.", + "items": { + "$ref": "#/components/schemas/AutomationRuleItem" + } + } + }, + "required": [ + "total", + "rules" + ] + }, + "AutomationTemplateListRequest": { + "type": "object", + "description": "Locale override for loading automation templates.", + "properties": { + "locale": { + "type": "string", + "description": "Requested locale such as `zh-CN` or `en-US`.", + "maxLength": 16 } } }, - "SessionGetResponse": { + "AutomationTemplateListResponse": { "type": "object", - "description": "A session plus a backward-paged window of its events.", + "description": "Preset templates that prefill new automation rules.", "properties": { - "session": { - "$ref": "#/components/schemas/SessionItem" - }, - "events": { + "templates": { "type": "array", + "description": "Templates available to the caller.", "items": { - "$ref": "#/components/schemas/EventItem" - }, - "description": "Recent events, ascending by (created_at, event_id)." + "$ref": "#/components/schemas/AutomationTemplateItem" + } + } + }, + "required": [ + "templates" + ] + }, + "AutomationRunListRequest": { + "type": "object", + "description": "Filters for the run history of one automation rule.", + "properties": { + "rule_id": { + "type": "string", + "description": "Automation rule ID whose run history to query." }, - "has_more_older": { - "type": "boolean", - "description": "True when older events remain beyond this page." + "p": { + "type": "integer", + "description": "Page number, 1-based.", + "default": 1, + "minimum": 1 }, - "search_after_ctx": { + "limit": { + "type": "integer", + "description": "Page size.", + "default": 20, + "minimum": 1 + }, + "status": { "type": "string", - "description": "Opaque keyset cursor; pass back as search_after_ctx to fetch the next older page. Omitted when has_more_older is false." + "description": "Filter by run status.", + "enum": [ + "queued", + "running", + "retrying", + "succeeded", + "partial", + "failed", + "skipped", + "abandoned" + ] + }, + "trigger_kind": { + "type": "string", + "description": "Filter by trigger source.", + "enum": [ + "schedule", + "debug", + "http_post" + ] + }, + "started_after_ms": { + "type": "integer", + "format": "int64", + "description": "Only include runs whose start time is on or after this Unix timestamp in milliseconds.", + "minimum": 0 + }, + "started_before_ms": { + "type": "integer", + "format": "int64", + "description": "Only include runs whose start time is on or before this Unix timestamp in milliseconds.", + "minimum": 0 } - } + }, + "required": [ + "rule_id" + ] }, - "SessionListResponse": { + "AutomationRunListResponse": { "type": "object", - "description": "A page of agent sessions.", + "description": "Page of automation execution history rows.", "properties": { "total": { "type": "integer", "format": "int64", - "description": "Total number of sessions matching the filter (ignoring pagination)." + "description": "Total matching runs." }, - "sessions": { + "runs": { "type": "array", + "description": "Current page of runs.", "items": { - "$ref": "#/components/schemas/SessionItem" - }, - "description": "The page of sessions." + "$ref": "#/components/schemas/AutomationRunItem" + } } - } + }, + "required": [ + "total", + "runs" + ] }, - "EventItem": { + "AutomationRuleItem": { "type": "object", - "description": "One persisted session event. content/actions/usage_metadata carry the raw ADK envelope; treat them as opaque structured payloads.", + "description": "Public view of one AI SRE automation rule.", "properties": { - "event_id": { + "rule_id": { "type": "string", - "description": "Event identifier." + "description": "Automation rule ID." }, - "session_id": { - "type": "string", - "description": "Owning session id." + "account_id": { + "type": "integer", + "format": "int64", + "description": "Owning account ID." }, - "invocation_id": { + "team_id": { + "type": "integer", + "format": "int64", + "description": "Rule scope. `0` = personal rule; `>0` = team rule." + }, + "owner_id": { + "type": "integer", + "format": "int64", + "description": "Owner member ID." + }, + "name": { "type": "string", - "description": "ADK invocation id grouping a turn." + "description": "Rule name." }, - "author": { + "enabled": { + "type": "boolean", + "description": "Whether the rule itself is enabled." + }, + "run_scope": { "type": "string", - "description": "Event author (e.g. user, the agent name)." + "description": "Derived scope used at execution time.", + "enum": [ + "person", + "team" + ] }, - "branch": { + "cron_expr": { "type": "string", - "description": "ADK branch path for nested agents." + "description": "Stored cron expression. The backend normalizes four-field API input to a five-field form with a leading minute `0`." }, - "content": { - "type": "object", - "additionalProperties": true, - "description": "ADK content envelope {role, parts:[...]}." + "prompt": { + "type": "string", + "description": "Task prompt executed on every run." }, - "actions": { - "type": "object", - "additionalProperties": true, - "description": "ADK actions envelope (state deltas, transfers, escalation)." + "environment_kind": { + "type": "string", + "description": "Preferred execution environment. Empty string means auto-select.", + "enum": [ + "", + "cloud", + "byoc" + ] }, - "usage_metadata": { - "type": "object", - "additionalProperties": true, - "description": "Per-turn token usage metadata." + "environment_id": { + "type": "string", + "description": "Selected BYOC runner ID, or an empty string when the backend auto-picks." }, - "partial": { - "type": "boolean", - "description": "True for a streaming partial chunk." + "schedule_trigger_id": { + "type": "string", + "description": "Schedule trigger ID when the rule has a cron trigger." }, - "turn_complete": { + "schedule_trigger_enabled": { "type": "boolean", - "description": "True on the terminal event of a turn." + "description": "Whether the schedule trigger is enabled." }, - "error_code": { + "http_post_trigger_id": { "type": "string", - "description": "Error code when the event represents a failure." + "description": "HTTP POST trigger ID when the rule exposes an API trigger." }, - "error_message": { + "http_post_trigger_url": { "type": "string", - "description": "Human-readable error message, when present." + "description": "Relative trigger URL. Send a `POST` with `Authorization: Bearer `." }, - "status": { - "type": "string", - "description": "Event status.", - "enum": [ - "normal", - "compressed" - ] + "http_post_trigger_enabled": { + "type": "boolean", + "description": "Whether the HTTP POST trigger is enabled." }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp in milliseconds when the event was written." - } - } - }, - "SessionTokenUsage": { - "type": "object", - "description": "Cumulative session-level token rollup across all turns. The account-billing source of truth.", - "properties": { - "input_tokens": { - "type": "integer", - "format": "int64", - "description": "Total prompt (input) tokens, including the cached portion." + "http_post_token": { + "type": "string", + "description": "One-time plaintext HTTP trigger token. Only returned immediately after create or token rotation." }, - "cached_tokens": { - "type": "integer", - "format": "int64", - "description": "Portion of input_tokens served from the prompt cache." + "can_edit": { + "type": "boolean", + "description": "Whether the caller may edit this rule." }, - "output_tokens": { + "created_at": { "type": "integer", "format": "int64", - "description": "Total generated (output) tokens." + "description": "Unix timestamp in milliseconds when the rule was created." }, - "reasoning_tokens": { + "updated_at": { "type": "integer", "format": "int64", - "description": "Total reasoning/thinking tokens." + "description": "Unix timestamp in milliseconds when the rule was last updated." } - } + }, + "required": [ + "rule_id", + "account_id", + "team_id", + "owner_id", + "name", + "enabled", + "run_scope", + "cron_expr", + "prompt", + "environment_kind", + "environment_id", + "schedule_trigger_enabled", + "http_post_trigger_enabled", + "can_edit", + "created_at", + "updated_at" + ] }, - "EnvironmentBinding": { + "AutomationTemplateItem": { "type": "object", - "description": "The runner or cloud sandbox the session is bound to. Null until the first message.", + "description": "Preset automation-rule template returned by the backend.", "properties": { - "kind": { + "name": { "type": "string", - "description": "Environment kind (e.g. runner, sandbox)." + "description": "Template name." }, - "id": { + "description": { "type": "string", - "description": "Environment identifier." + "description": "Short description of what the template does." }, - "name": { + "icon": { "type": "string", - "description": "Human-readable environment name." + "description": "Mintlify / UI icon name." }, - "status": { + "enabled": { + "type": "boolean", + "description": "Whether the template is currently offered to end users." + }, + "prompt": { "type": "string", - "description": "Binding status." + "description": "Prefilled task prompt." } - } + }, + "required": [ + "name", + "description", + "icon", + "enabled", + "prompt" + ] }, - "ContextResolvedItem": { + "AutomationRunItem": { "type": "object", - "description": "Snapshot of the three-tier knowledge-pack resolution for this session.", + "description": "One execution row in an automation rule history table.", "properties": { - "account_pack_id": { + "run_id": { "type": "string", - "description": "Resolved account-scoped pack id." + "description": "Automation run ID." }, - "team_pack_id": { + "kind": { "type": "string", - "description": "Resolved team-scoped pack id." + "description": "Run ledger kind.", + "enum": [ + "automation_rule" + ] }, - "incident_id": { + "account_id": { + "type": "integer", + "format": "int64", + "description": "Owning account ID." + }, + "rule_id": { "type": "string", - "description": "Bound incident id, when war-room originated." + "description": "Automation rule ID." }, - "resolved_at_ms": { + "trigger_kind": { + "type": "string", + "description": "How this run was started.", + "enum": [ + "schedule", + "debug", + "manual", + "http_post", + "test" + ] + }, + "occurrence_key": { + "type": "string", + "description": "Idempotency key for the trigger occurrence." + }, + "status": { + "type": "string", + "description": "Current or final run status.", + "enum": [ + "queued", + "running", + "retrying", + "succeeded", + "partial", + "failed", + "skipped", + "abandoned" + ] + }, + "attempts": { + "type": "integer", + "description": "How many attempts have been made for this run." + }, + "started_at": { "type": "integer", "format": "int64", - "description": "Unix timestamp in milliseconds when the packs were resolved." + "description": "Unix timestamp in milliseconds when the run started." }, - "versions": { + "completed_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds when the run completed. `0` means it is still running." + }, + "duration_ms": { + "type": "integer", + "format": "int64", + "description": "Run duration in milliseconds. `0` while a run is still in flight." + }, + "error_code": { + "type": "string", + "description": "Run-level error code, if any." + }, + "error_message": { + "type": "string", + "description": "Run-level error message, if any." + }, + "stats_json": { "type": "object", - "additionalProperties": { - "type": "integer" - }, - "description": "Per-pack resolved version map." + "additionalProperties": true, + "description": "Arbitrary JSON metrics captured for the run." + }, + "result_json": { + "type": "object", + "additionalProperties": true, + "description": "Arbitrary JSON result payload captured for the run." + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds when the run row was created." + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp in milliseconds when the run row was last updated." } - } + }, + "required": [ + "run_id", + "kind", + "account_id", + "rule_id", + "trigger_kind", + "occurrence_key", + "status", + "attempts", + "started_at", + "completed_at", + "duration_ms", + "error_code", + "error_message", + "created_at", + "updated_at" + ] } } } diff --git a/api-reference/safari.openapi.zh.json b/api-reference/safari.openapi.zh.json index 553fb70..73d8200 100644 --- a/api-reference/safari.openapi.zh.json +++ b/api-reference/safari.openapi.zh.json @@ -17,6 +17,12 @@ } ], "tags": [ + { + "name": "AI SRE/会话" + }, + { + "name": "AI SRE/自动化" + }, { "name": "AI SRE/技能" }, @@ -25,19 +31,16 @@ }, { "name": "AI SRE/A2A 智能体" - }, - { - "name": "AI SRE/会话" } ], "paths": { - "/safari/skill/list": { + "/safari/a2a-agent/create": { "post": { - "operationId": "skill-read-list", - "summary": "查询技能列表", - "description": "分页查询调用者在账户与团队范围内可见的 AI SRE 技能。", + "operationId": "remote-agent-write-create", + "summary": "创建 A2A 智能体", + "description": "通过智能体卡片 URL 注册新的 A2A 远程智能体。", "tags": [ - "AI SRE/技能" + "AI SRE/A2A 智能体" ], "security": [ { @@ -45,10 +48,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 列表行中省略 `content` 字段;如需正文请单独查询某个技能。\n", - "href": "/zh/api-reference/ai-sre/skills/skill-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- `card_url` 必须可解析为有效的智能体卡片;无法访问或无效的卡片返回 InvalidParameter。\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-create", "metadata": { - "sidebarTitle": "查询技能列表" + "sidebarTitle": "创建 A2A 智能体" } }, "responses": { @@ -65,7 +68,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SkillListResponse" + "$ref": "#/components/schemas/A2AAgentCreateResponse" } } } @@ -74,33 +77,7 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "total": 1, - "skills": [ - { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", - "account_id": 10023, - "team_id": 0, - "skill_name": "k8s-triage", - "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", - "version": "1.2.0", - "tags": [ - "kubernetes", - "triage" - ], - "author": "sre-team", - "tools": [ - "bash", - "mcp:prometheus/query" - ], - "status": "enabled", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "can_edit": true, - "update_available": false, - "is_modified": false - } - ] + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } @@ -112,6 +89,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -124,25 +104,28 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillListRequest" + "$ref": "#/components/schemas/A2AAgentCreateRequest" }, "example": { - "p": 1, - "limit": 20, - "include_account": true + "agent_name": "deploy-bot", + "instructions": "当需要检查部署流水线或给出回滚建议时使用。", + "card_url": "https://agents.example.com/deploy-bot/card", + "auth_type": "bearer", + "streaming": true, + "team_id": 0 } } } } } }, - "/safari/skill/get": { + "/safari/a2a-agent/delete": { "post": { - "operationId": "skill-read-get", - "summary": "查看技能详情", - "description": "查看单个技能,包含完整的 SKILL.md 内容。", + "operationId": "remote-agent-write-delete", + "summary": "删除 A2A 智能体", + "description": "按 ID 软删除 A2A 智能体。", "tags": [ - "AI SRE/技能" + "AI SRE/A2A 智能体" ], "security": [ { @@ -150,10 +133,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", - "href": "/zh/api-reference/ai-sre/skills/skill-read-get", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-delete", "metadata": { - "sidebarTitle": "查看技能详情" + "sidebarTitle": "删除 A2A 智能体" } }, "responses": { @@ -170,7 +153,8 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SkillItem" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -178,31 +162,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", - "account_id": 10023, - "team_id": 0, - "skill_name": "k8s-triage", - "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", - "version": "1.2.0", - "tags": [ - "kubernetes", - "triage" - ], - "author": "sre-team", - "tools": [ - "bash", - "mcp:prometheus/query" - ], - "status": "enabled", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "can_edit": true, - "update_available": false, - "is_modified": false, - "content": "---\nname: k8s-triage\ndescription: ...\n---\n# Triage steps" - } + "data": null } } } @@ -213,6 +173,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -225,23 +188,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillGetRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/safari/skill/update": { + "/safari/a2a-agent/disable": { "post": { - "operationId": "skill-write-update", - "summary": "更新技能", - "description": "更新技能的描述或重新分配团队范围。", + "operationId": "remote-agent-write-disable", + "summary": "禁用 A2A 智能体", + "description": "禁用已启用的 A2A 智能体。", "tags": [ - "AI SRE/技能" + "AI SRE/A2A 智能体" ], "security": [ { @@ -249,10 +212,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 仅 `description` 与 `team_id` 可编辑;技能正文需通过重新上传修改。\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/skills/skill-write-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-disable", "metadata": { - "sidebarTitle": "更新技能" + "sidebarTitle": "禁用 A2A 智能体" } }, "responses": { @@ -269,7 +232,8 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SkillItem" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -277,30 +241,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", - "account_id": 10023, - "team_id": 0, - "skill_name": "k8s-triage", - "description": "Updated triage runbook.", - "version": "1.2.0", - "tags": [ - "kubernetes", - "triage" - ], - "author": "sre-team", - "tools": [ - "bash", - "mcp:prometheus/query" - ], - "status": "enabled", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "can_edit": true, - "update_available": false, - "is_modified": false - } + "data": null } } } @@ -326,24 +267,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillUpdateRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", - "description": "Updated triage runbook." + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/safari/skill/delete": { + "/safari/a2a-agent/enable": { "post": { - "operationId": "skill-write-delete", - "summary": "删除技能", - "description": "按 ID 删除技能。", + "operationId": "remote-agent-write-enable", + "summary": "启用 A2A 智能体", + "description": "启用已禁用的 A2A 智能体。", "tags": [ - "AI SRE/技能" + "AI SRE/A2A 智能体" ], "security": [ { @@ -351,10 +291,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/skills/skill-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-enable", "metadata": { - "sidebarTitle": "删除技能" + "sidebarTitle": "启用 A2A 智能体" } }, "responses": { @@ -406,23 +346,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillDeleteRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/safari/skill/upload": { + "/safari/a2a-agent/get": { "post": { - "operationId": "skill-write-upload", - "summary": "上传技能", - "description": "上传技能压缩包(.skill/.zip/.tar.gz/.tgz)以创建或覆盖技能。", + "operationId": "remote-agent-read-get", + "summary": "查看 A2A 智能体详情", + "description": "按 ID 查看单个 A2A 智能体。", "tags": [ - "AI SRE/技能" + "AI SRE/A2A 智能体" ], "security": [ { @@ -430,10 +370,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **30 次/分钟**;**3 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 以 `multipart/form-data` 提交,包含 `file` 部分。压缩包最大 100MB。\n- 设置 `replace=true` 可覆盖同名技能。\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/skills/skill-write-upload", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", + "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-read-get", "metadata": { - "sidebarTitle": "上传技能" + "sidebarTitle": "查看 A2A 智能体详情" } }, "responses": { @@ -450,7 +390,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SkillItem" + "$ref": "#/components/schemas/A2AAgentItem" } } } @@ -459,29 +399,27 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", "account_id": 10023, "team_id": 0, - "skill_name": "k8s-triage", - "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", - "version": "1.2.0", - "tags": [ - "kubernetes", - "triage" - ], - "author": "sre-team", - "tools": [ - "bash", - "mcp:prometheus/query" - ], + "can_edit": true, + "agent_name": "deploy-bot", + "card_url": "https://agents.example.com/deploy-bot/card", + "auth_type": "bearer", + "streaming": true, "status": "enabled", + "agent_card_name": "Deploy Bot", + "agent_card_skills": [ + "rollback", + "diff" + ], + "card_resolve_timeout": 10, + "task_timeout": 120, + "auth_mode": "shared", "created_by": 80011, "created_at": 1716960000000, "updated_at": 1717046400000, - "can_edit": true, - "update_available": false, - "is_modified": false, - "created": true + "instructions": "Remote agent that inspects deployment pipelines." } } } @@ -493,9 +431,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -506,26 +441,25 @@ "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { - "$ref": "#/components/schemas/SkillUploadRequest" + "$ref": "#/components/schemas/A2AAgentIDRequest" }, "example": { - "team_id": 0, - "replace": false + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" } } } } } }, - "/safari/skill/enable": { + "/safari/a2a-agent/list": { "post": { - "operationId": "skill-read-enable", - "summary": "启用技能", - "description": "启用已禁用的技能,使智能体可加载。", - "tags": [ - "AI SRE/技能" + "operationId": "remote-agent-read-list", + "summary": "查询 A2A 智能体列表", + "description": "分页查询调用者在账户与团队范围内可见的 A2A 智能体。", + "tags": [ + "AI SRE/A2A 智能体" ], "security": [ { @@ -533,10 +467,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 仅可启用 `disabled` 状态的技能,否则返回 InvalidParameter。\n", - "href": "/zh/api-reference/ai-sre/skills/skill-read-enable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 分页使用 `offset`/`limit`(而非 `p`/`limit`)。\n", + "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-read-list", "metadata": { - "sidebarTitle": "启用技能" + "sidebarTitle": "查询 A2A 智能体列表" } }, "responses": { @@ -553,8 +487,7 @@ "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/A2AAgentListResponse" } } } @@ -562,7 +495,34 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "items": [ + { + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "agent_name": "deploy-bot", + "card_url": "https://agents.example.com/deploy-bot/card", + "auth_type": "bearer", + "streaming": true, + "status": "enabled", + "agent_card_name": "Deploy Bot", + "agent_card_skills": [ + "rollback", + "diff" + ], + "card_resolve_timeout": 10, + "task_timeout": 120, + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "instructions": "Remote agent that inspects deployment pipelines." + } + ], + "total": 1 + } } } } @@ -573,9 +533,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -588,23 +545,25 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillStatusRequest" + "$ref": "#/components/schemas/A2AAgentListRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "offset": 0, + "limit": 20, + "include_account": true } } } } } }, - "/safari/skill/disable": { + "/safari/a2a-agent/update": { "post": { - "operationId": "skill-write-disable", - "summary": "禁用技能", - "description": "禁用已启用的技能,使智能体不再加载。", + "operationId": "remote-agent-write-update", + "summary": "更新 A2A 智能体", + "description": "对 A2A 智能体执行部分更新;省略字段表示不变。", "tags": [ - "AI SRE/技能" + "AI SRE/A2A 智能体" ], "security": [ { @@ -612,10 +571,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 仅可禁用 `enabled` 状态的技能,否则返回 InvalidParameter。\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/skills/skill-write-disable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-update", "metadata": { - "sidebarTitle": "禁用技能" + "sidebarTitle": "更新 A2A 智能体" } }, "responses": { @@ -667,23 +626,24 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SkillStatusRequest" + "$ref": "#/components/schemas/A2AAgentUpdateRequest" }, "example": { - "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", + "instructions": "检查部署流水线并给出回滚步骤。" } } } } } }, - "/safari/mcp/server/list": { + "/safari/automation/rule/create": { "post": { - "operationId": "mcp-read-server-list", - "summary": "查询 MCP 服务器列表", - "description": "分页查询调用者在账户与团队范围内可见的 MCP 服务器。", + "operationId": "automation-rule-write-create", + "summary": "创建自动化规则", + "description": "创建一条 AI SRE 自动化规则,可同时配置定时触发与可选的 HTTP 触发。", "tags": [ - "AI SRE/MCP 服务器" + "AI SRE/自动化" ], "security": [ { @@ -691,15 +651,15 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 列表不含实时工具列表;如需探测工具请单独查询某个服务器。\n", - "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-read-server-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | **1,000 次/分钟**;**50 次/秒**(按账户) |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `team_id=0` 表示个人规则;传团队 ID 则创建团队规则。\n- 请求里的 `cron_expr` 使用 4 段格式;响应中的 `cron_expr` 会规范化为带前置分钟 `0` 的 5 段形式。\n- 若 `http_post_trigger_enabled=true`,响应会返回一次性的 `http_post_token`,请立即保存,后续查询接口不会再次返回。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。\n", + "href": "/zh/api-reference/ai-sre/automations/automation-rule-write-create", "metadata": { - "sidebarTitle": "查询 MCP 服务器列表" + "sidebarTitle": "创建自动化规则" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { @@ -711,46 +671,35 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerListResponse" + "$ref": "#/components/schemas/AutomationRuleItem" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "request_id": "01J1D8PMZEB54X6E5M9K0JD8TZ", "data": { - "total": 1, - "servers": [ - { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ - { - "name": "query", - "description": "Run a PromQL instant query." - }, - { - "name": "query_range", - "description": "Run a PromQL range query." - } - ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 - } - ] + "rule_id": "arule_weekly_insight", + "account_id": 10023, + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": true, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": true, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, + "http_post_token": "sat_live_3Qmz7bKp9f6nR2xT1vHd", + "can_edit": true, + "created_at": 1780272000000, + "updated_at": 1780275600000 } } } @@ -774,25 +723,31 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerListRequest" + "$ref": "#/components/schemas/AutomationRuleCreateRequest" }, "example": { - "p": 1, - "limit": 20, - "include_account": true + "name": "每周值班洞察", + "team_id": 7, + "enabled": true, + "cron_expr": "9 * * 1", + "schedule_trigger_enabled": true, + "prompt": "回顾上周故障、升级与噪音告警,并输出后续改进建议。", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "http_post_trigger_enabled": true } } } } } }, - "/safari/mcp/server/create": { + "/safari/automation/rule/delete": { "post": { - "operationId": "mcp-write-server-create", - "summary": "创建 MCP 服务器", - "description": "在账户下注册新的 MCP 服务器(连接器)。", + "operationId": "automation-rule-write-delete", + "summary": "删除自动化规则", + "description": "删除一条 AI SRE 自动化规则。删除后未来触发会立即停止。", "tags": [ - "AI SRE/MCP 服务器" + "AI SRE/自动化" ], "security": [ { @@ -800,15 +755,15 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- `command`/`args`/`env` 用于 `stdio`;`url`/`headers` 用于 `sse`/`streamable-http`。\n- 服务器名称在账户内必须唯一,重复将返回 InvalidParameter。\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | **1,000 次/分钟**;**50 次/秒**(按账户) |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 删除规则后,未来的定时触发与 HTTP 触发都会停止;已有运行历史会由后端保留策略稍后清理。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。\n", + "href": "/zh/api-reference/ai-sre/automations/automation-rule-write-delete", "metadata": { - "sidebarTitle": "创建 MCP 服务器" + "sidebarTitle": "删除自动化规则" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { @@ -820,42 +775,16 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerItem" + "type": "null", + "description": "成功时固定为 null。" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ - { - "name": "query", - "description": "Run a PromQL instant query." - }, - { - "name": "query_range", - "description": "Run a PromQL range query." - } - ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 - } + "request_id": "01J1D8W5SF6G8JQ8Y4S60AV45M", + "data": null } } } @@ -866,9 +795,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -881,27 +807,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerCreateRequest" + "$ref": "#/components/schemas/AutomationRuleIDRequest" }, "example": { - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled" + "rule_id": "arule_weekly_insight" } } } } } }, - "/safari/mcp/server/get": { + "/safari/automation/rule/get": { "post": { - "operationId": "mcp-read-server-get", - "summary": "查看 MCP 服务器详情", - "description": "查看单个 MCP 服务器并实时探测其工具列表。", + "operationId": "automation-rule-read-get", + "summary": "获取自动化规则详情", + "description": "获取一条自动化规则及其已解析的触发器元数据。", "tags": [ - "AI SRE/MCP 服务器" + "AI SRE/自动化" ], "security": [ { @@ -909,15 +831,15 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 详情接口会实时探测工具;探测失败时设置 `list_error`,请求本身仍成功。\n", - "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-read-server-get", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | **1,000 次/分钟**;**50 次/秒**(按账户) |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 返回的 `cron_expr` 已规范化为 5 段形式。\n- `http_post_token` 通常不会出现在查询结果中;它只会在创建或轮换 token 后立即返回。\n", + "href": "/zh/api-reference/ai-sre/automations/automation-rule-read-get", "metadata": { - "sidebarTitle": "查看 MCP 服务器详情" + "sidebarTitle": "获取自动化规则详情" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { @@ -929,41 +851,34 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerItem" + "$ref": "#/components/schemas/AutomationRuleItem" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "request_id": "01J1D8TANR2PCD3W3EJ0H8Y74M", "data": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "rule_id": "arule_weekly_insight", "account_id": 10023, - "team_id": 0, + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": true, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": true, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics and alerts.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ - { - "name": "query", - "description": "Run a PromQL instant query." - }, - { - "name": "query_range", - "description": "Run a PromQL range query." - } - ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 + "created_at": 1780272000000, + "updated_at": 1780275600000 } } } @@ -987,23 +902,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerGetRequest" + "$ref": "#/components/schemas/AutomationRuleIDRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" + "rule_id": "arule_weekly_insight" } } } } } }, - "/safari/mcp/server/update": { + "/safari/automation/rule/list": { "post": { - "operationId": "mcp-write-server-update", - "summary": "更新 MCP 服务器", - "description": "更新 MCP 服务器配置;省略字段表示不变。", + "operationId": "automation-rule-read-list", + "summary": "查询自动化规则列表", + "description": "查询当前调用者在个人与团队范围内可见的 AI SRE 自动化规则。", "tags": [ - "AI SRE/MCP 服务器" + "AI SRE/自动化" ], "security": [ { @@ -1011,15 +926,15 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- `env`/`headers` 中的脱敏密钥会被保留——回传脱敏值不会覆盖已存储的真实密钥。\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | **1,000 次/分钟**;**50 次/秒**(按账户) |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `scope=all` 会返回调用者的个人规则以及其成员身份可见的团队规则;`team_ids` 会在 scope 解析后继续收窄结果。\n- 可用 `enabled` 区分启用与停用规则,而不会改变可见性判断。\n", + "href": "/zh/api-reference/ai-sre/automations/automation-rule-read-list", "metadata": { - "sidebarTitle": "更新 MCP 服务器" + "sidebarTitle": "查询自动化规则列表" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { @@ -1031,41 +946,39 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/MCPServerItem" + "$ref": "#/components/schemas/AutomationRuleListResponse" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "request_id": "01J1D8Q7M5QR2RM8ZBJW7V1F8N", "data": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "server_name": "prometheus", - "description": "Query Prometheus metrics, alerts, and rules.", - "transport": "streamable-http", - "url": "https://mcp.example.com/prometheus", - "status": "enabled", - "connect_timeout": 10, - "call_timeout": 60, - "tool_count": 2, - "tools": [ - { - "name": "query", - "description": "Run a PromQL instant query." - }, + "total": 1, + "rules": [ { - "name": "query_range", - "description": "Run a PromQL range query." + "rule_id": "arule_weekly_insight", + "account_id": 10023, + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": true, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": true, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, + "can_edit": true, + "created_at": 1780272000000, + "updated_at": 1780275600000 } - ], - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000 + ] } } } @@ -1077,9 +990,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1092,24 +1002,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerUpdateRequest" + "$ref": "#/components/schemas/AutomationRuleListRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", - "description": "Query Prometheus metrics, alerts, and rules." + "p": 1, + "limit": 20, + "scope": "team", + "team_ids": [ + 7 + ], + "enabled": true } } } } } }, - "/safari/mcp/server/delete": { + "/safari/automation/rule/update": { "post": { - "operationId": "mcp-write-server-delete", - "summary": "删除 MCP 服务器", - "description": "按 ID 删除 MCP 服务器。", + "operationId": "automation-rule-write-update", + "summary": "更新自动化规则", + "description": "局部更新一条 AI SRE 自动化规则,并可选地轮换其 HTTP 触发 token。", "tags": [ - "AI SRE/MCP 服务器" + "AI SRE/自动化" ], "security": [ { @@ -1117,15 +1032,15 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | **1,000 次/分钟**;**50 次/秒**(按账户) |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 只传你想修改的字段。\n- 设置 `rotate_http_post_trigger_token=true` 会签发新的 HTTP 触发 token,旧 token 会立即失效。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。\n", + "href": "/zh/api-reference/ai-sre/automations/automation-rule-write-update", "metadata": { - "sidebarTitle": "删除 MCP 服务器" + "sidebarTitle": "更新自动化规则" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { @@ -1137,16 +1052,36 @@ "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/AutomationRuleItem" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "request_id": "01J1D8V011TBKCX3T7FPQ4T5W7", + "data": { + "rule_id": "arule_weekly_insight", + "account_id": 10023, + "team_id": 7, + "owner_id": 80011, + "name": "Weekly on-call insight", + "enabled": false, + "run_scope": "team", + "cron_expr": "0 9 * * 1", + "prompt": "Review last week's incidents, summarize escalations, and propose follow-up actions.", + "environment_kind": "byoc", + "environment_id": "env_weekly", + "schedule_trigger_id": "atrig_sched_weekly", + "schedule_trigger_enabled": false, + "http_post_trigger_id": "atrig_http_weekly", + "http_post_trigger_url": "/safari/automation/triggers/atrig_http_weekly/fire", + "http_post_trigger_enabled": true, + "can_edit": true, + "created_at": 1780272000000, + "updated_at": 1780275600000, + "http_post_token": "sat_live_r1N6m2YQ9sH4v8Pe0KcA" + } } } } @@ -1157,9 +1092,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1172,23 +1104,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerDeleteRequest" + "$ref": "#/components/schemas/AutomationRuleUpdateRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" + "rule_id": "arule_weekly_insight", + "enabled": false, + "schedule_trigger_enabled": false, + "http_post_trigger_enabled": true, + "rotate_http_post_trigger_token": true } } } } } }, - "/safari/mcp/server/enable": { + "/safari/automation/run/list": { "post": { - "operationId": "mcp-write-server-enable", - "summary": "启用 MCP 服务器", - "description": "启用已禁用的 MCP 服务器。", + "operationId": "automation-run-read-list", + "summary": "查询自动化执行历史", + "description": "查询某条 AI SRE 自动化规则的执行历史记录。", "tags": [ - "AI SRE/MCP 服务器" + "AI SRE/自动化" ], "security": [ { @@ -1196,15 +1132,15 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-enable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | **1,000 次/分钟**;**50 次/秒**(按账户) |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `started_after_ms` 与 `started_before_ms` 都是 Unix 毫秒时间戳。\n- `trigger_kind` 可区分定时、调试与 HTTP 触发的运行来源。\n", + "href": "/zh/api-reference/ai-sre/automations/automation-run-read-list", "metadata": { - "sidebarTitle": "启用 MCP 服务器" + "sidebarTitle": "查询自动化执行历史" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { @@ -1216,16 +1152,44 @@ "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/AutomationRunListResponse" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "request_id": "01J1D8RSGQ3CS2R2ZH4WFPB0D0", + "data": { + "total": 1, + "runs": [ + { + "run_id": "trun_weekly_20260630", + "kind": "automation_rule", + "account_id": 10023, + "rule_id": "arule_weekly_insight", + "trigger_kind": "schedule", + "occurrence_key": "2026-06-30T01:00:00Z", + "status": "succeeded", + "attempts": 1, + "started_at": 1782781200000, + "completed_at": 1782781685000, + "duration_ms": 485000, + "error_code": "", + "error_message": "", + "stats_json": { + "messages": 128, + "tool_calls": 9 + }, + "result_json": { + "session_id": "sess_hidden_weekly", + "final_event_id": "evt_final_weekly" + }, + "created_at": 1782781200000, + "updated_at": 1782781685000 + } + ] + } } } } @@ -1236,9 +1200,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1251,23 +1212,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerStatusRequest" + "$ref": "#/components/schemas/AutomationRunListRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" + "rule_id": "arule_weekly_insight", + "limit": 20, + "status": "succeeded", + "trigger_kind": "schedule", + "started_after_ms": 1780272000000 } } } } } }, - "/safari/mcp/server/disable": { + "/safari/automation/template/list": { "post": { - "operationId": "mcp-write-server-disable", - "summary": "禁用 MCP 服务器", - "description": "禁用已启用的 MCP 服务器。", + "operationId": "automation-template-read-list", + "summary": "查询自动化模板列表", + "description": "查询用于预填新建自动化规则表单的预设模板列表。", "tags": [ - "AI SRE/MCP 服务器" + "AI SRE/自动化" ], "security": [ { @@ -1275,15 +1240,15 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-disable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | **1,000 次/分钟**;**50 次/秒**(按账户) |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 未传 `locale` 时,后端会先回退到调用者当前界面语言,再加载对应模板文件。\n", + "href": "/zh/api-reference/ai-sre/automations/automation-template-read-list", "metadata": { - "sidebarTitle": "禁用 MCP 服务器" + "sidebarTitle": "查询自动化模板列表" } }, "responses": { "200": { - "description": "Success", + "description": "成功", "content": { "application/json": { "schema": { @@ -1295,16 +1260,25 @@ "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/AutomationTemplateListResponse" } } } ] }, "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "request_id": "01J1D8QZ3NVJ4H0N1JBBM4WE1R", + "data": { + "templates": [ + { + "name": "每周值班洞察", + "description": "为值班团队生成每周运营报告。", + "icon": "clipboard-list", + "enabled": true, + "prompt": "总结本周故障、升级与噪音告警,并输出值班团队周报。" + } + ] + } } } } @@ -1315,9 +1289,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1330,23 +1301,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MCPServerStatusRequest" + "$ref": "#/components/schemas/AutomationTemplateListRequest" }, "example": { - "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" + "locale": "zh-CN" } } } } } }, - "/safari/a2a-agent/create": { + "/safari/mcp/server/create": { "post": { - "operationId": "remote-agent-write-create", - "summary": "创建 A2A 智能体", - "description": "通过智能体卡片 URL 注册新的 A2A 远程智能体。", + "operationId": "mcp-write-server-create", + "summary": "创建 MCP 服务器", + "description": "在账户下注册新的 MCP 服务器(连接器)。", "tags": [ - "AI SRE/A2A 智能体" + "AI SRE/MCP 服务器" ], "security": [ { @@ -1354,10 +1325,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- `card_url` 必须可解析为有效的智能体卡片;无法访问或无效的卡片返回 InvalidParameter。\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- `command`/`args`/`env` 用于 `stdio`;`url`/`headers` 用于 `sse`/`streamable-http`。\n- 服务器名称在账户内必须唯一,重复将返回 InvalidParameter。\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-create", "metadata": { - "sidebarTitle": "创建 A2A 智能体" + "sidebarTitle": "创建 MCP 服务器" } }, "responses": { @@ -1374,7 +1345,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/A2AAgentCreateResponse" + "$ref": "#/components/schemas/MCPServerItem" } } } @@ -1383,7 +1354,32 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ + { + "name": "query", + "description": "Run a PromQL instant query." + }, + { + "name": "query_range", + "description": "Run a PromQL range query." + } + ], + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 } } } @@ -1410,28 +1406,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentCreateRequest" + "$ref": "#/components/schemas/MCPServerCreateRequest" }, "example": { - "agent_name": "deploy-bot", - "instructions": "当需要检查部署流水线或给出回滚建议时使用。", - "card_url": "https://agents.example.com/deploy-bot/card", - "auth_type": "bearer", - "streaming": true, - "team_id": 0 + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled" } } } } } }, - "/safari/a2a-agent/list": { + "/safari/mcp/server/delete": { "post": { - "operationId": "remote-agent-read-list", - "summary": "查询 A2A 智能体列表", - "description": "分页查询调用者在账户与团队范围内可见的 A2A 智能体。", + "operationId": "mcp-write-server-delete", + "summary": "删除 MCP 服务器", + "description": "按 ID 删除 MCP 服务器。", "tags": [ - "AI SRE/A2A 智能体" + "AI SRE/MCP 服务器" ], "security": [ { @@ -1439,10 +1434,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 分页使用 `offset`/`limit`(而非 `p`/`limit`)。\n", - "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-delete", "metadata": { - "sidebarTitle": "查询 A2A 智能体列表" + "sidebarTitle": "删除 MCP 服务器" } }, "responses": { @@ -1459,7 +1454,8 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/A2AAgentListResponse" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -1467,34 +1463,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "items": [ - { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "agent_name": "deploy-bot", - "card_url": "https://agents.example.com/deploy-bot/card", - "auth_type": "bearer", - "streaming": true, - "status": "enabled", - "agent_card_name": "Deploy Bot", - "agent_card_skills": [ - "rollback", - "diff" - ], - "card_resolve_timeout": 10, - "task_timeout": 120, - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "instructions": "Remote agent that inspects deployment pipelines." - } - ], - "total": 1 - } + "data": null } } } @@ -1505,6 +1474,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1517,25 +1489,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentListRequest" + "$ref": "#/components/schemas/MCPServerDeleteRequest" }, "example": { - "offset": 0, - "limit": 20, - "include_account": true + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } } } }, - "/safari/a2a-agent/get": { + "/safari/mcp/server/disable": { "post": { - "operationId": "remote-agent-read-get", - "summary": "查看 A2A 智能体详情", - "description": "按 ID 查看单个 A2A 智能体。", + "operationId": "mcp-write-server-disable", + "summary": "禁用 MCP 服务器", + "description": "禁用已启用的 MCP 服务器。", "tags": [ - "AI SRE/A2A 智能体" + "AI SRE/MCP 服务器" ], "security": [ { @@ -1543,10 +1513,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", - "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-read-get", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-disable", "metadata": { - "sidebarTitle": "查看 A2A 智能体详情" + "sidebarTitle": "禁用 MCP 服务器" } }, "responses": { @@ -1563,7 +1533,8 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/A2AAgentItem" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -1571,29 +1542,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", - "account_id": 10023, - "team_id": 0, - "can_edit": true, - "agent_name": "deploy-bot", - "card_url": "https://agents.example.com/deploy-bot/card", - "auth_type": "bearer", - "streaming": true, - "status": "enabled", - "agent_card_name": "Deploy Bot", - "agent_card_skills": [ - "rollback", - "diff" - ], - "card_resolve_timeout": 10, - "task_timeout": 120, - "auth_mode": "shared", - "created_by": 80011, - "created_at": 1716960000000, - "updated_at": 1717046400000, - "instructions": "Remote agent that inspects deployment pipelines." - } + "data": null } } } @@ -1604,6 +1553,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1616,23 +1568,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" + "$ref": "#/components/schemas/MCPServerStatusRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } } } }, - "/safari/a2a-agent/update": { + "/safari/mcp/server/enable": { "post": { - "operationId": "remote-agent-write-update", - "summary": "更新 A2A 智能体", - "description": "对 A2A 智能体执行部分更新;省略字段表示不变。", + "operationId": "mcp-write-server-enable", + "summary": "启用 MCP 服务器", + "description": "启用已禁用的 MCP 服务器。", "tags": [ - "AI SRE/A2A 智能体" + "AI SRE/MCP 服务器" ], "security": [ { @@ -1640,10 +1592,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-enable", "metadata": { - "sidebarTitle": "更新 A2A 智能体" + "sidebarTitle": "启用 MCP 服务器" } }, "responses": { @@ -1695,24 +1647,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentUpdateRequest" + "$ref": "#/components/schemas/MCPServerStatusRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D", - "instructions": "检查部署流水线并给出回滚步骤。" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } } } }, - "/safari/a2a-agent/enable": { + "/safari/mcp/server/get": { "post": { - "operationId": "remote-agent-write-enable", - "summary": "启用 A2A 智能体", - "description": "启用已禁用的 A2A 智能体。", + "operationId": "mcp-read-server-get", + "summary": "查看 MCP 服务器详情", + "description": "查看单个 MCP 服务器并实时探测其工具列表。", "tags": [ - "AI SRE/A2A 智能体" + "AI SRE/MCP 服务器" ], "security": [ { @@ -1720,10 +1671,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-enable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 详情接口会实时探测工具;探测失败时设置 `list_error`,请求本身仍成功。\n", + "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-read-server-get", "metadata": { - "sidebarTitle": "启用 A2A 智能体" + "sidebarTitle": "查看 MCP 服务器详情" } }, "responses": { @@ -1740,8 +1691,7 @@ "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/MCPServerItem" } } } @@ -1749,7 +1699,34 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ + { + "name": "query", + "description": "Run a PromQL instant query." + }, + { + "name": "query_range", + "description": "Run a PromQL range query." + } + ], + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 + } } } } @@ -1760,9 +1737,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1775,23 +1749,23 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" + "$ref": "#/components/schemas/MCPServerGetRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1" } } } } } }, - "/safari/a2a-agent/disable": { + "/safari/mcp/server/list": { "post": { - "operationId": "remote-agent-write-disable", - "summary": "禁用 A2A 智能体", - "description": "禁用已启用的 A2A 智能体。", + "operationId": "mcp-read-server-list", + "summary": "查询 MCP 服务器列表", + "description": "分页查询调用者在账户与团队范围内可见的 MCP 服务器。", "tags": [ - "AI SRE/A2A 智能体" + "AI SRE/MCP 服务器" ], "security": [ { @@ -1799,10 +1773,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-disable", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 列表不含实时工具列表;如需探测工具请单独查询某个服务器。\n", + "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-read-server-list", "metadata": { - "sidebarTitle": "禁用 A2A 智能体" + "sidebarTitle": "查询 MCP 服务器列表" } }, "responses": { @@ -1819,8 +1793,7 @@ "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/MCPServerListResponse" } } } @@ -1828,7 +1801,39 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "total": 1, + "servers": [ + { + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics and alerts.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ + { + "name": "query", + "description": "Run a PromQL instant query." + }, + { + "name": "query_range", + "description": "Run a PromQL range query." + } + ], + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 + } + ] + } } } } @@ -1839,9 +1844,6 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -1854,23 +1856,25 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" + "$ref": "#/components/schemas/MCPServerListRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "p": 1, + "limit": 20, + "include_account": true } } } } } }, - "/safari/a2a-agent/delete": { + "/safari/mcp/server/update": { "post": { - "operationId": "remote-agent-write-delete", - "summary": "删除 A2A 智能体", - "description": "按 ID 软删除 A2A 智能体。", + "operationId": "mcp-write-server-update", + "summary": "更新 MCP 服务器", + "description": "更新 MCP 服务器配置;省略字段表示不变。", "tags": [ - "AI SRE/A2A 智能体" + "AI SRE/MCP 服务器" ], "security": [ { @@ -1878,10 +1882,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Agent 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", - "href": "/zh/api-reference/ai-sre/a2a-agents/remote-agent-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **MCP 管理**(`ai-sre`) |\n\n## 使用说明\n\n- `env`/`headers` 中的脱敏密钥会被保留——回传脱敏值不会覆盖已存储的真实密钥。\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/mcp-servers/mcp-write-server-update", "metadata": { - "sidebarTitle": "删除 A2A 智能体" + "sidebarTitle": "更新 MCP 服务器" } }, "responses": { @@ -1898,8 +1902,7 @@ "type": "object", "properties": { "data": { - "type": "null", - "description": "成功时恒为 null。" + "$ref": "#/components/schemas/MCPServerItem" } } } @@ -1907,7 +1910,34 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": null + "data": { + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "account_id": 10023, + "team_id": 0, + "can_edit": true, + "server_name": "prometheus", + "description": "Query Prometheus metrics, alerts, and rules.", + "transport": "streamable-http", + "url": "https://mcp.example.com/prometheus", + "status": "enabled", + "connect_timeout": 10, + "call_timeout": 60, + "tool_count": 2, + "tools": [ + { + "name": "query", + "description": "Run a PromQL instant query." + }, + { + "name": "query_range", + "description": "Run a PromQL range query." + } + ], + "auth_mode": "shared", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000 + } } } } @@ -1933,21 +1963,22 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/A2AAgentIDRequest" + "$ref": "#/components/schemas/MCPServerUpdateRequest" }, "example": { - "agent_id": "a2a_6mWqZ2pK9nLcR3tY8uVb4D" + "server_id": "mcp_4kP9wQ2nLceRtY7uVb3xA1", + "description": "Query Prometheus metrics, alerts, and rules." } } } } } }, - "/safari/session/list": { + "/safari/session/delete": { "post": { - "operationId": "session-read-list", - "summary": "查询会话列表", - "description": "分页查询调用者可见的智能体会话,可按应用、入口、归档状态与团队过滤。", + "operationId": "session-write-delete", + "summary": "删除会话", + "description": "按 ID 删除会话。", "tags": [ "AI SRE/会话" ], @@ -1957,10 +1988,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 分页使用 `p`/`limit`(最大 100);`scope` 默认 `all`(本人 + 所属团队)。\n- `is_running` 反映实时运行集合;`has_unread` 按调用者各自计算。\n", - "href": "/zh/api-reference/ai-sre/sessions/session-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 需要对该会话拥有管理权限(创建者、账户管理员或所属团队成员)。\n", + "href": "/zh/api-reference/ai-sre/sessions/session-write-delete", "metadata": { - "sidebarTitle": "查询会话列表" + "sidebarTitle": "删除会话" } }, "responses": { @@ -1977,7 +2008,8 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SessionListResponse" + "type": "null", + "description": "成功时恒为 null。" } } } @@ -1985,38 +2017,7 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "total": 988, - "sessions": [ - { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "session_name": "Investigate cloud-assistant first heartbeat", - "app_name": "ai-sre", - "entry_kind": "web", - "person_id": "3790925372131", - "team_id": 0, - "is_mine": false, - "can_manage": true, - "status": "enabled", - "incognito": false, - "created_at": 1780367971228, - "updated_at": 1780367993457, - "token_usage": { - "input_tokens": 14948, - "cached_tokens": 11520, - "output_tokens": 888, - "reasoning_tokens": 351 - }, - "current_context_tokens": 14948, - "context_window": 0, - "archived_at": 0, - "pinned_at": 0, - "last_event_at": 1780367992649, - "is_running": false, - "has_unread": true - } - ] - } + "data": null } } } @@ -2039,24 +2040,21 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SessionListRequest" + "$ref": "#/components/schemas/SessionDeleteRequest" }, "example": { - "app_name": "ai-sre", - "limit": 2, - "orderby": "updated_at", - "scope": "all" + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u" } } } } } }, - "/safari/session/get": { + "/safari/session/export": { "post": { - "operationId": "session-read-info", - "summary": "查看会话详情", - "description": "查看单个会话,并返回其最近事件的一页(向更早方向分页)。", + "operationId": "session-read-export", + "summary": "导出会话记录", + "description": "以换行分隔的 JSON(NDJSON)流式导出会话的完整事件记录。", "tags": [ "AI SRE/会话" ], @@ -2066,27 +2064,88 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 使用上一次响应的 `search_after_ctx` 翻阅更早的历史。\n- `limit`(或旧版 `num_recent_events`)限制事件页大小;默认 100,最大 1000。\n", - "href": "/zh/api-reference/ai-sre/sessions/session-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 响应为 `application/x-ndjson`——请逐行解析并写入文件,切勿将整段记录读入内存。\n- 第一行始终为 `session_meta` 信封;`include_subagents=true` 会在派发行后内联各子会话的事件流。\n", + "href": "/zh/api-reference/ai-sre/sessions/session-read-export", "metadata": { - "sidebarTitle": "查看会话详情" + "sidebarTitle": "导出会话记录" } }, "responses": { "200": { - "description": "Success", + "description": "流式 NDJSON(application/x-ndjson)。每行一个 JSON 对象,以换行结束。第一行始终为 `session_meta` 信封,其后为会话事件。", "content": { - "application/json": { + "application/x-ndjson": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ResponseEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/SessionGetResponse" + "type": "string", + "description": "换行分隔的 JSON 流。请逐行解析,切勿缓冲整个响应体。" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionExportRequest" + }, + "example": { + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "include_subagents": false + } + } + } + } + } + }, + "/safari/session/get": { + "post": { + "operationId": "session-read-info", + "summary": "查看会话详情", + "description": "查看单个会话,并返回其最近事件的一页(向更早方向分页)。", + "tags": [ + "AI SRE/会话" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 使用上一次响应的 `search_after_ctx` 翻阅更早的历史。\n- `limit`(或旧版 `num_recent_events`)限制事件页大小;默认 100,最大 1000。\n", + "href": "/zh/api-reference/ai-sre/sessions/session-read-info", + "metadata": { + "sidebarTitle": "查看会话详情" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SessionGetResponse" } } } @@ -2185,11 +2244,11 @@ } } }, - "/safari/session/export": { + "/safari/session/list": { "post": { - "operationId": "session-read-export", - "summary": "导出会话记录", - "description": "以换行分隔的 JSON(NDJSON)流式导出会话的完整事件记录。", + "operationId": "session-read-list", + "summary": "查询会话列表", + "description": "分页查询调用者可见的智能体会话,可按应用、入口、归档状态与团队过滤。", "tags": [ "AI SRE/会话" ], @@ -2199,20 +2258,66 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 响应为 `application/x-ndjson`——请逐行解析并写入文件,切勿将整段记录读入内存。\n- 第一行始终为 `session_meta` 信封;`include_subagents=true` 会在派发行后内联各子会话的事件流。\n", - "href": "/zh/api-reference/ai-sre/sessions/session-read-export", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 分页使用 `p`/`limit`(最大 100);`scope` 默认 `all`(本人 + 所属团队)。\n- `is_running` 反映实时运行集合;`has_unread` 按调用者各自计算。\n", + "href": "/zh/api-reference/ai-sre/sessions/session-read-list", "metadata": { - "sidebarTitle": "导出会话记录" + "sidebarTitle": "查询会话列表" } }, "responses": { "200": { - "description": "流式 NDJSON(application/x-ndjson)。每行一个 JSON 对象,以换行结束。第一行始终为 `session_meta` 信封,其后为会话事件。", + "description": "Success", "content": { - "application/x-ndjson": { + "application/json": { "schema": { - "type": "string", - "description": "换行分隔的 JSON 流。请逐行解析,切勿缓冲整个响应体。" + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SessionListResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "total": 988, + "sessions": [ + { + "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", + "session_name": "Investigate cloud-assistant first heartbeat", + "app_name": "ai-sre", + "entry_kind": "web", + "person_id": "3790925372131", + "team_id": 0, + "is_mine": false, + "can_manage": true, + "status": "enabled", + "incognito": false, + "created_at": 1780367971228, + "updated_at": 1780367993457, + "token_usage": { + "input_tokens": 14948, + "cached_tokens": 11520, + "output_tokens": 888, + "reasoning_tokens": 351 + }, + "current_context_tokens": 14948, + "context_window": 0, + "archived_at": 0, + "pinned_at": 0, + "last_event_at": 1780367992649, + "is_running": false, + "has_unread": true + } + ] + } } } } @@ -2235,24 +2340,26 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SessionExportRequest" + "$ref": "#/components/schemas/SessionListRequest" }, "example": { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u", - "include_subagents": false + "app_name": "ai-sre", + "limit": 2, + "orderby": "updated_at", + "scope": "all" } } } } } }, - "/safari/session/delete": { + "/safari/skill/delete": { "post": { - "operationId": "session-write-delete", - "summary": "删除会话", - "description": "按 ID 删除会话。", + "operationId": "skill-write-delete", + "summary": "删除技能", + "description": "按 ID 删除技能。", "tags": [ - "AI SRE/会话" + "AI SRE/技能" ], "security": [ { @@ -2260,10 +2367,10 @@ } ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 需要对该会话拥有管理权限(创建者、账户管理员或所属团队成员)。\n", - "href": "/zh/api-reference/ai-sre/sessions/session-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/skills/skill-write-delete", "metadata": { - "sidebarTitle": "删除会话" + "sidebarTitle": "删除技能" } }, "responses": { @@ -2300,6 +2407,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -2312,517 +2422,1526 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SessionDeleteRequest" + "$ref": "#/components/schemas/SkillDeleteRequest" }, "example": { - "session_id": "sess_f8oDvqiG64uur6sBNsTc4u" + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" } } } } } - } - }, - "components": { - "securitySchemes": { - "AppKeyAuth": { - "type": "apiKey", - "in": "query", - "name": "app_key", - "description": "App key issued from the Flashduty console. Required on every public API call. Keep it secret — it grants the same access as the owning account." - } }, - "responses": { - "BadRequest": { - "description": "Invalid request — usually a missing or malformed parameter.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - }, - "examples": { - "missingParameter": { - "summary": "Missing required parameter", - "value": { + "/safari/skill/disable": { + "post": { + "operationId": "skill-write-disable", + "summary": "禁用技能", + "description": "禁用已启用的技能,使智能体不再加载。", + "tags": [ + "AI SRE/技能" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 仅可禁用 `enabled` 状态的技能,否则返回 InvalidParameter。\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/skills/skill-write-disable", + "metadata": { + "sidebarTitle": "禁用技能" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "type": "null", + "description": "成功时恒为 null。" + } + } + } + ] + }, + "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "error": { - "code": "InvalidParameter", - "message": "The specified parameter skill_id is not valid." - } + "data": null } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" } - } - }, - "Unauthorized": { - "description": "Missing or invalid app_key.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - }, - "examples": { - "missingAppKey": { - "value": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "error": { - "code": "Unauthorized", - "message": "You are unauthorized." - } - } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillStatusRequest" + }, + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" } } } } - }, - "Forbidden": { - "description": "The app_key is valid but lacks permission for this operation.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - }, - "examples": { - "accessDenied": { - "value": { + } + }, + "/safari/skill/enable": { + "post": { + "operationId": "skill-read-enable", + "summary": "启用技能", + "description": "启用已禁用的技能,使智能体可加载。", + "tags": [ + "AI SRE/技能" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 仅可启用 `disabled` 状态的技能,否则返回 InvalidParameter。\n", + "href": "/zh/api-reference/ai-sre/skills/skill-read-enable", + "metadata": { + "sidebarTitle": "启用技能" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "type": "null", + "description": "成功时恒为 null。" + } + } + } + ] + }, + "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "error": { - "code": "AccessDenied", - "message": "Access Denied." - } + "data": null } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" } - } - }, - "TooManyRequests": { - "description": "Rate limit hit. Either the global API limit or a per-account limit.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - }, - "examples": { - "rateLimited": { - "value": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "error": { - "code": "RequestTooFrequently", - "message": "Request too frequently." - } - } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillStatusRequest" + }, + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" } } } } - }, - "ServerError": { - "description": "Unexpected server-side error. Include the request_id when reporting.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - }, - "examples": { - "internal": { - "value": { + } + }, + "/safari/skill/get": { + "post": { + "operationId": "skill-read-get", + "summary": "查看技能详情", + "description": "查看单个技能,包含完整的 SKILL.md 内容。", + "tags": [ + "AI SRE/技能" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n", + "href": "/zh/api-reference/ai-sre/skills/skill-read-get", + "metadata": { + "sidebarTitle": "查看技能详情" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SkillItem" + } + } + } + ] + }, + "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "error": { - "code": "InternalError", - "message": "We encountered an internal error, and it has been reported. Please try again later." + "data": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "account_id": 10023, + "team_id": 0, + "skill_name": "k8s-triage", + "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", + "version": "1.2.0", + "tags": [ + "kubernetes", + "triage" + ], + "author": "sre-team", + "tools": [ + "bash", + "mcp:prometheus/query" + ], + "status": "enabled", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "can_edit": true, + "update_available": false, + "is_modified": false, + "content": "---\nname: k8s-triage\ndescription: ...\n---\n# Triage steps" } } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillGetRequest" + }, + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m" + } + } } } } }, - "schemas": { - "ErrorCode": { - "type": "string", - "description": "Flashduty error code enum. Every failed API response sets `error.code` to one of these values. The value is a stable wire string — not a localized message and not a numeric status. HTTP status is informational.", - "enum": [ - "OK", - "InvalidParameter", - "BadRequest", - "InvalidContentType", - "ResourceNotFound", - "NoLicense", - "ReferenceExist", - "Unauthorized", - "BalanceNotEnough", - "AccessDenied", - "RouteNotFound", - "MethodNotAllowed", - "UndonedOrderExist", - "RequestLocked", - "EntityTooLarge", - "RequestTooFrequently", - "RequestVerifyRequired", + "/safari/skill/list": { + "post": { + "operationId": "skill-read-list", + "summary": "查询技能列表", + "description": "分页查询调用者在账户与团队范围内可见的 AI SRE 技能。", + "tags": [ + "AI SRE/技能" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 列表行中省略 `content` 字段;如需正文请单独查询某个技能。\n", + "href": "/zh/api-reference/ai-sre/skills/skill-read-list", + "metadata": { + "sidebarTitle": "查询技能列表" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SkillListResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "total": 1, + "skills": [ + { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "account_id": 10023, + "team_id": 0, + "skill_name": "k8s-triage", + "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", + "version": "1.2.0", + "tags": [ + "kubernetes", + "triage" + ], + "author": "sre-team", + "tools": [ + "bash", + "mcp:prometheus/query" + ], + "status": "enabled", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "can_edit": true, + "update_available": false, + "is_modified": false + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillListRequest" + }, + "example": { + "p": 1, + "limit": 20, + "include_account": true + } + } + } + } + } + }, + "/safari/skill/update": { + "post": { + "operationId": "skill-write-update", + "summary": "更新技能", + "description": "更新技能的描述或重新分配团队范围。", + "tags": [ + "AI SRE/技能" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个 `app_key` **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 仅 `description` 与 `team_id` 可编辑;技能正文需通过重新上传修改。\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/skills/skill-write-update", + "metadata": { + "sidebarTitle": "更新技能" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SkillItem" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "account_id": 10023, + "team_id": 0, + "skill_name": "k8s-triage", + "description": "Updated triage runbook.", + "version": "1.2.0", + "tags": [ + "kubernetes", + "triage" + ], + "author": "sre-team", + "tools": [ + "bash", + "mcp:prometheus/query" + ], + "status": "enabled", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "can_edit": true, + "update_available": false, + "is_modified": false + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillUpdateRequest" + }, + "example": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "description": "Updated triage runbook." + } + } + } + } + } + }, + "/safari/skill/upload": { + "post": { + "operationId": "skill-write-upload", + "summary": "上传技能", + "description": "上传技能压缩包(.skill/.zip/.tar.gz/.tgz)以创建或覆盖技能。", + "tags": [ + "AI SRE/技能" + ], + "security": [ + { + "AppKeyAuth": [] + } + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **30 次/分钟**;**3 次/秒** |\n| 权限要求 | **Skill 管理**(`ai-sre`) |\n\n## 使用说明\n\n- 以 `multipart/form-data` 提交,包含 `file` 部分。压缩包最大 100MB。\n- 设置 `replace=true` 可覆盖同名技能。\n- 每次调用都会记录到账户审计日志。\n", + "href": "/zh/api-reference/ai-sre/skills/skill-write-upload", + "metadata": { + "sidebarTitle": "上传技能" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SkillItem" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "skill_id": "skill_8s7Hn2kLpQ3xYbVc4Wd2m", + "account_id": 10023, + "team_id": 0, + "skill_name": "k8s-triage", + "description": "Diagnose unhealthy Kubernetes workloads from cluster events and pod logs.", + "version": "1.2.0", + "tags": [ + "kubernetes", + "triage" + ], + "author": "sre-team", + "tools": [ + "bash", + "mcp:prometheus/query" + ], + "status": "enabled", + "created_by": 80011, + "created_at": 1716960000000, + "updated_at": 1717046400000, + "can_edit": true, + "update_available": false, + "is_modified": false, + "created": true + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/SkillUploadRequest" + }, + "example": { + "team_id": 0, + "replace": false + } + } + } + } + } + } + }, + "components": { + "securitySchemes": { + "AppKeyAuth": { + "type": "apiKey", + "in": "query", + "name": "app_key", + "description": "App key issued from the Flashduty console. Required on every public API call. Keep it secret — it grants the same access as the owning account." + } + }, + "responses": { + "BadRequest": { + "description": "Invalid request — usually a missing or malformed parameter.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "missingParameter": { + "summary": "Missing required parameter", + "value": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "error": { + "code": "InvalidParameter", + "message": "The specified parameter skill_id is not valid." + } + } + } + } + } + } + }, + "Unauthorized": { + "description": "Missing or invalid app_key.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "missingAppKey": { + "value": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "error": { + "code": "Unauthorized", + "message": "You are unauthorized." + } + } + } + } + } + } + }, + "Forbidden": { + "description": "The app_key is valid but lacks permission for this operation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "accessDenied": { + "value": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "error": { + "code": "AccessDenied", + "message": "Access Denied." + } + } + } + } + } + } + }, + "TooManyRequests": { + "description": "Rate limit hit. Either the global API limit or a per-account limit.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "rateLimited": { + "value": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "error": { + "code": "RequestTooFrequently", + "message": "Request too frequently." + } + } + } + } + } + } + }, + "ServerError": { + "description": "Unexpected server-side error. Include the request_id when reporting.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "internal": { + "value": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "error": { + "code": "InternalError", + "message": "We encountered an internal error, and it has been reported. Please try again later." + } + } + } + } + } + } + } + }, + "schemas": { + "ErrorCode": { + "type": "string", + "description": "Flashduty error code enum. Every failed API response sets `error.code` to one of these values. The value is a stable wire string — not a localized message and not a numeric status. HTTP status is informational.", + "enum": [ + "OK", + "InvalidParameter", + "BadRequest", + "InvalidContentType", + "ResourceNotFound", + "NoLicense", + "ReferenceExist", + "Unauthorized", + "BalanceNotEnough", + "AccessDenied", + "RouteNotFound", + "MethodNotAllowed", + "UndonedOrderExist", + "RequestLocked", + "EntityTooLarge", + "RequestTooFrequently", + "RequestVerifyRequired", "DangerousOperation", "InternalError", "ServiceUnavailable" ] }, - "DutyError": { + "DutyError": { + "type": "object", + "description": "Error payload inside the response envelope. Present only on non-2xx responses.", + "properties": { + "code": { + "$ref": "#/components/schemas/ErrorCode" + }, + "message": { + "type": "string", + "description": "Human-readable error message, localized by the caller's Accept-Language. May contain field names, IDs, or other context from the failing request." + } + }, + "required": [ + "code", + "message" + ] + }, + "ResponseEnvelope": { + "type": "object", + "description": "Standard response envelope used by every Flashduty public API. On success `data` contains the endpoint-specific payload and `error` is absent. On failure `error` is present and `data` is absent. `request_id` is always present and is also mirrored in the `Flashcat-Request-Id` response header.", + "properties": { + "request_id": { + "type": "string", + "description": "Unique ID for this request. Mirrored in the Flashcat-Request-Id header. Include it when reporting issues.", + "example": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4" + }, + "error": { + "$ref": "#/components/schemas/DutyError" + }, + "data": { + "description": "Endpoint-specific payload. See each operation's 200 response schema." + } + }, + "required": [ + "request_id" + ] + }, + "ErrorResponse": { + "type": "object", + "description": "Response envelope for errors. `error` is required; `data` is absent.", + "properties": { + "request_id": { + "type": "string", + "example": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4" + }, + "error": { + "$ref": "#/components/schemas/DutyError" + } + }, + "required": [ + "request_id", + "error" + ] + }, + "SkillItem": { + "type": "object", + "description": "AI SRE 技能 —— 智能体可加载的 SKILL.md 打包资源。", + "properties": { + "skill_id": { + "type": "string", + "description": "技能唯一 ID(前缀 `skill_`)。" + }, + "account_id": { + "type": "integer", + "description": "所属账户 ID。", + "format": "int64" + }, + "team_id": { + "type": "integer", + "description": "团队范围:0 表示账户级;>0 表示所属团队。", + "format": "int64" + }, + "skill_name": { + "type": "string", + "description": "技能名称,在账户内唯一。" + }, + "description": { + "type": "string", + "description": "来自 SKILL.md frontmatter 的可读描述。" + }, + "content": { + "type": "string", + "description": "完整的 SKILL.md 内容;列表响应中省略。" + }, + "version": { + "type": "string", + "description": "frontmatter 中的技能版本。" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "从 frontmatter 解析的标签。" + }, + "author": { + "type": "string", + "description": "技能作者。" + }, + "license": { + "type": "string", + "description": "技能许可证。" + }, + "tools": { + "type": "array", + "items": { + "type": "string" + }, + "description": "所需工具(内置或 `mcp:server/tool`)。" + }, + "s3_key": { + "type": "string", + "description": "技能压缩包在对象存储中的 key。" + }, + "checksum": { + "type": "string", + "description": "技能压缩包的 SHA-256 校验和。" + }, + "status": { + "type": "string", + "description": "技能状态。", + "enum": [ + "enabled", + "disabled" + ] + }, + "created_by": { + "type": "integer", + "description": "创建该技能的成员 ID。", + "format": "int64" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "创建时间,Unix 毫秒时间戳。" + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "最近更新时间,Unix 毫秒时间戳。" + }, + "can_edit": { + "type": "boolean", + "description": "调用者是否可编辑该技能。" + }, + "source_template_name": { + "type": "string", + "description": "该技能安装来源的市场模板名称;自建技能为空。" + }, + "source_template_version": { + "type": "string", + "description": "安装时的模板版本。" + }, + "update_available": { + "type": "boolean", + "description": "当市场存在更新版本时为 true。" + }, + "is_modified": { + "type": "boolean", + "description": "当市场来源技能被本地修改时为 true(自动更新将跳过)。" + }, + "created": { + "type": "boolean", + "description": "仅在“从会话安装”响应中出现:true 表示新建,false 表示原地更新。" + } + }, + "required": [ + "skill_id", + "account_id", + "team_id", + "skill_name", + "description", + "status", + "created_by", + "created_at", + "updated_at", + "can_edit", + "update_available", + "is_modified" + ] + }, + "SkillListRequest": { + "type": "object", + "description": "技能列表的分页与团队过滤条件。", + "properties": { + "p": { + "type": "integer", + "description": "页码,从 1 开始。", + "default": 1 + }, + "limit": { + "type": "integer", + "description": "每页数量。", + "default": 20 + }, + "team_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "按团队 ID 过滤;为空则使用调用者可见范围。" + }, + "include_account": { + "type": [ + "boolean", + "null" + ], + "description": "是否包含账户级(team_id=0)记录,默认 true。" + } + } + }, + "SkillGetRequest": { + "type": "object", + "description": "按 ID 查询技能。", + "properties": { + "skill_id": { + "type": "string", + "description": "目标技能 ID。" + } + }, + "required": [ + "skill_id" + ] + }, + "SkillDeleteRequest": { "type": "object", - "description": "Error payload inside the response envelope. Present only on non-2xx responses.", + "description": "按 ID 删除技能。", "properties": { - "code": { - "$ref": "#/components/schemas/ErrorCode" + "skill_id": { + "type": "string", + "description": "目标技能 ID。" + } + }, + "required": [ + "skill_id" + ] + }, + "SkillStatusRequest": { + "type": "object", + "description": "按 ID 启用/禁用技能。", + "properties": { + "skill_id": { + "type": "string", + "description": "目标技能 ID。" + } + }, + "required": [ + "skill_id" + ] + }, + "SkillUpdateRequest": { + "type": "object", + "description": "可编辑的技能元数据。", + "properties": { + "skill_id": { + "type": "string", + "description": "目标技能 ID。" + }, + "description": { + "type": "string", + "description": "新的描述。", + "maxLength": 1024 + }, + "team_id": { + "type": [ + "integer", + "null" + ], + "description": "重新分配团队范围:0 表示账户级;>0 表示团队。省略则不变。", + "format": "int64" + } + }, + "required": [ + "skill_id" + ] + }, + "SkillUploadRequest": { + "type": "object", + "description": "上传技能压缩包的 multipart 表单。", + "properties": { + "file": { + "type": "string", + "format": "binary", + "description": "技能压缩包(.skill / .zip / .tar.gz / .tgz),最大 100MB。" + }, + "team_id": { + "type": "integer", + "description": "新技能的团队范围:0 表示账户级。", + "format": "int64" + }, + "replace": { + "type": "boolean", + "description": "为 true 时覆盖同名技能。" + }, + "skill_id": { + "type": "string", + "description": "替换指定技能时的技能 ID。" + } + }, + "required": [ + "file" + ] + }, + "SkillListResponse": { + "type": "object", + "description": "分页的技能列表。", + "properties": { + "total": { + "type": "integer", + "description": "匹配的技能总数。", + "format": "int64" + }, + "skills": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SkillItem" + }, + "description": "当前页的技能。" + } + }, + "required": [ + "total", + "skills" + ] + }, + "MCPToolInfo": { + "type": "object", + "description": "MCP 服务器暴露的单个工具的元数据。", + "properties": { + "name": { + "type": "string", + "description": "工具名称。" + }, + "description": { + "type": "string", + "description": "工具描述。" + }, + "input_schema": { + "type": "object", + "additionalProperties": true, + "description": "描述工具输入参数的 JSON Schema。" + } + }, + "required": [ + "name", + "description" + ] + }, + "MCPServerItem": { + "type": "object", + "description": "账户下注册的 MCP 服务器(连接器)。", + "properties": { + "server_id": { + "type": "string", + "description": "MCP 服务器唯一 ID(前缀 `mcp_`)。" + }, + "account_id": { + "type": "integer", + "description": "所属账户 ID。", + "format": "int64" + }, + "team_id": { + "type": "integer", + "description": "团队范围:0 表示账户级;>0 表示所属团队。", + "format": "int64" + }, + "can_edit": { + "type": "boolean", + "description": "调用者是否可编辑该服务器。" + }, + "server_name": { + "type": "string", + "description": "MCP 服务器名称,在账户内唯一。" + }, + "description": { + "type": "string", + "description": "服务器描述。" + }, + "ai_description": { + "type": "string", + "description": "LLM 生成的描述,存在时优先于 `description`。" + }, + "transport": { + "type": "string", + "description": "传输协议。", + "enum": [ + "stdio", + "sse", + "streamable-http" + ] + }, + "command": { + "type": "string", + "description": "可执行命令(仅 stdio 传输)。" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "description": "命令参数(stdio 传输)。" + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "环境变量(stdio 传输);密钥值已脱敏。" + }, + "url": { + "type": "string", + "description": "服务器 URL(sse / streamable-http 传输)。" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "HTTP 头(sse / streamable-http);密钥值已脱敏。" + }, + "proxy_url": { + "type": "string", + "description": "访问服务器使用的出站代理 URL。" + }, + "status": { + "type": "string", + "description": "服务器状态。", + "enum": [ + "enabled", + "disabled" + ] + }, + "connect_timeout": { + "type": "integer", + "description": "连接超时,单位秒(0 表示默认 10 秒)。" + }, + "call_timeout": { + "type": "integer", + "description": "工具调用超时,单位秒(0 表示默认 60 秒)。" + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MCPToolInfo" + }, + "description": "实时工具列表;由 get/test 接口填充。" + }, + "tool_count": { + "type": "integer", + "description": "实时工具列表的数量。" + }, + "list_error": { + "type": "string", + "description": "实时获取工具列表失败时的错误信息。" + }, + "auth_mode": { + "type": "string", + "description": "认证模式。", + "enum": [ + "shared", + "per_user_secret", + "per_user_oauth" + ] }, - "message": { - "type": "string", - "description": "Human-readable error message, localized by the caller's Accept-Language. May contain field names, IDs, or other context from the failing request." - } - }, - "required": [ - "code", - "message" - ] - }, - "ResponseEnvelope": { - "type": "object", - "description": "Standard response envelope used by every Flashduty public API. On success `data` contains the endpoint-specific payload and `error` is absent. On failure `error` is present and `data` is absent. `request_id` is always present and is also mirrored in the `Flashcat-Request-Id` response header.", - "properties": { - "request_id": { + "secret_schema": { "type": "string", - "description": "Unique ID for this request. Mirrored in the Flashcat-Request-Id header. Include it when reporting issues.", - "example": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4" + "description": "JSON 编码的密钥 schema(per_user_secret 模式)。" }, - "error": { - "$ref": "#/components/schemas/DutyError" + "oauth_metadata": { + "type": "string", + "description": "JSON 编码的 OAuth 元数据(per_user_oauth 模式)。" }, - "data": { - "description": "Endpoint-specific payload. See each operation's 200 response schema." - } - }, - "required": [ - "request_id" - ] - }, - "ErrorResponse": { - "type": "object", - "description": "Response envelope for errors. `error` is required; `data` is absent.", - "properties": { - "request_id": { + "source_template_name": { "type": "string", - "example": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4" + "description": "该连接器安装来源的市场模板名称;自建为空。" }, - "error": { - "$ref": "#/components/schemas/DutyError" + "created_by": { + "type": "integer", + "description": "创建该服务器的成员 ID。", + "format": "int64" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "创建时间,Unix 毫秒时间戳。" + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "最近更新时间,Unix 毫秒时间戳。" } }, "required": [ - "request_id", - "error" + "server_id", + "account_id", + "team_id", + "can_edit", + "server_name", + "description", + "transport", + "status", + "connect_timeout", + "call_timeout", + "created_by", + "created_at", + "updated_at" ] }, - "SkillItem": { + "MCPServerCreateRequest": { "type": "object", - "description": "AI SRE 技能 —— 智能体可加载的 SKILL.md 打包资源。", + "description": "新建 MCP 服务器的配置。", "properties": { - "skill_id": { - "type": "string", - "description": "技能唯一 ID(前缀 `skill_`)。" - }, - "account_id": { - "type": "integer", - "description": "所属账户 ID。", - "format": "int64" - }, - "team_id": { - "type": "integer", - "description": "团队范围:0 表示账户级;>0 表示所属团队。", - "format": "int64" - }, - "skill_name": { + "server_name": { "type": "string", - "description": "技能名称,在账户内唯一。" + "description": "MCP 服务器名称,在账户内唯一。", + "minLength": 1, + "maxLength": 255 }, "description": { "type": "string", - "description": "来自 SKILL.md frontmatter 的可读描述。" + "description": "服务器描述。", + "minLength": 1, + "maxLength": 1024 }, - "content": { + "transport": { "type": "string", - "description": "完整的 SKILL.md 内容;列表响应中省略。" + "description": "传输协议。", + "enum": [ + "stdio", + "sse", + "streamable-http" + ] }, - "version": { + "command": { "type": "string", - "description": "frontmatter 中的技能版本。" + "description": "可执行命令(stdio 传输)。" }, - "tags": { + "args": { "type": "array", "items": { "type": "string" }, - "description": "从 frontmatter 解析的标签。" + "description": "命令参数(stdio 传输)。" }, - "author": { - "type": "string", - "description": "技能作者。" + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "环境变量(stdio 传输)。" }, - "license": { + "url": { "type": "string", - "description": "技能许可证。" + "description": "服务器 URL(sse / streamable-http 传输)。" }, - "tools": { - "type": "array", - "items": { + "headers": { + "type": "object", + "additionalProperties": { "type": "string" }, - "description": "所需工具(内置或 `mcp:server/tool`)。" + "description": "HTTP 头(sse / streamable-http)。" }, - "s3_key": { + "connect_timeout": { + "type": "integer", + "description": "连接超时,单位秒。0 表示默认(10 秒)。" + }, + "call_timeout": { + "type": "integer", + "description": "工具调用超时,单位秒。0 表示默认(60 秒)。" + }, + "auth_mode": { "type": "string", - "description": "技能压缩包在对象存储中的 key。" + "description": "认证模式:shared(默认)、per_user_secret 或 per_user_oauth。" }, - "checksum": { + "secret_schema": { "type": "string", - "description": "技能压缩包的 SHA-256 校验和。" + "description": "JSON 密钥 schema;auth_mode=per_user_secret 时必填。" + }, + "oauth_metadata": { + "type": "string", + "description": "JSON OAuth 元数据;为 per_user_oauth 预留。" }, "status": { "type": "string", - "description": "技能状态。", + "description": "初始状态。", "enum": [ "enabled", "disabled" - ] + ], + "default": "enabled" }, - "created_by": { + "team_id": { "type": "integer", - "description": "创建该技能的成员 ID。", + "description": "团队范围:0 表示账户级;>0 表示团队。", "format": "int64" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "创建时间,Unix 毫秒时间戳。" - }, - "updated_at": { - "type": "integer", - "format": "int64", - "description": "最近更新时间,Unix 毫秒时间戳。" - }, - "can_edit": { - "type": "boolean", - "description": "调用者是否可编辑该技能。" - }, "source_template_name": { "type": "string", - "description": "该技能安装来源的市场模板名称;自建技能为空。" - }, - "source_template_version": { - "type": "string", - "description": "安装时的模板版本。" - }, - "update_available": { - "type": "boolean", - "description": "当市场存在更新版本时为 true。" - }, - "is_modified": { - "type": "boolean", - "description": "当市场来源技能被本地修改时为 true(自动更新将跳过)。" - }, - "created": { - "type": "boolean", - "description": "仅在“从会话安装”响应中出现:true 表示新建,false 表示原地更新。" + "description": "从连接器模板创建时的市场模板名称。" } }, "required": [ - "skill_id", - "account_id", - "team_id", - "skill_name", + "server_name", "description", - "status", - "created_by", - "created_at", - "updated_at", - "can_edit", - "update_available", - "is_modified" + "transport" ] }, - "SkillListRequest": { + "MCPServerUpdateRequest": { "type": "object", - "description": "技能列表的分页与团队过滤条件。", + "description": "MCP 服务器的部分更新;省略字段表示不变。", "properties": { - "p": { + "server_id": { + "type": "string", + "description": "目标 MCP 服务器 ID。" + }, + "server_name": { + "type": "string", + "description": "新名称。", + "minLength": 1, + "maxLength": 255 + }, + "description": { + "type": "string", + "description": "新描述。", + "minLength": 1, + "maxLength": 1024 + }, + "transport": { + "type": "string", + "description": "传输协议。", + "enum": [ + "stdio", + "sse", + "streamable-http" + ] + }, + "command": { + "type": "string", + "description": "可执行命令(stdio 传输)。" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "description": "命令参数(stdio 传输)。" + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "环境变量(stdio 传输)。" + }, + "url": { + "type": "string", + "description": "服务器 URL(sse / streamable-http 传输)。" + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "HTTP 头(sse / streamable-http)。" + }, + "connect_timeout": { "type": "integer", - "description": "页码,从 1 开始。", - "default": 1 + "description": "连接超时,单位秒。0 表示默认(10 秒)。" }, - "limit": { + "call_timeout": { "type": "integer", - "description": "每页数量。", - "default": 20 + "description": "工具调用超时,单位秒。0 表示默认(60 秒)。" }, - "team_ids": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "description": "按团队 ID 过滤;为空则使用调用者可见范围。" + "auth_mode": { + "type": "string", + "description": "认证模式:shared(默认)、per_user_secret 或 per_user_oauth。" }, - "include_account": { + "secret_schema": { + "type": "string", + "description": "JSON 密钥 schema;auth_mode=per_user_secret 时必填。" + }, + "oauth_metadata": { + "type": "string", + "description": "JSON OAuth 元数据;为 per_user_oauth 预留。" + }, + "team_id": { "type": [ - "boolean", + "integer", "null" ], - "description": "是否包含账户级(team_id=0)记录,默认 true。" - } - } - }, - "SkillGetRequest": { - "type": "object", - "description": "按 ID 查询技能。", - "properties": { - "skill_id": { - "type": "string", - "description": "目标技能 ID。" + "description": "重新分配团队范围:0 表示账户级;>0 表示团队。省略则不变。", + "format": "int64" } }, "required": [ - "skill_id" + "server_id" ] }, - "SkillDeleteRequest": { + "MCPServerGetRequest": { "type": "object", - "description": "按 ID 删除技能。", + "description": "按 ID 查询 MCP 服务器。", "properties": { - "skill_id": { + "server_id": { "type": "string", - "description": "目标技能 ID。" + "description": "目标 MCP 服务器 ID。" } }, "required": [ - "skill_id" + "server_id" ] }, - "SkillStatusRequest": { + "MCPServerDeleteRequest": { "type": "object", - "description": "按 ID 启用/禁用技能。", + "description": "按 ID 删除 MCP 服务器。", "properties": { - "skill_id": { + "server_id": { "type": "string", - "description": "目标技能 ID。" + "description": "目标 MCP 服务器 ID。" } }, "required": [ - "skill_id" + "server_id" ] }, - "SkillUpdateRequest": { + "MCPServerStatusRequest": { "type": "object", - "description": "可编辑的技能元数据。", + "description": "按 ID 启用/禁用 MCP 服务器。", "properties": { - "skill_id": { - "type": "string", - "description": "目标技能 ID。" - }, - "description": { + "server_id": { "type": "string", - "description": "新的描述。", - "maxLength": 1024 - }, - "team_id": { - "type": [ - "integer", - "null" - ], - "description": "重新分配团队范围:0 表示账户级;>0 表示团队。省略则不变。", - "format": "int64" + "description": "目标 MCP 服务器 ID。" } }, "required": [ - "skill_id" + "server_id" ] }, - "SkillUploadRequest": { + "MCPServerListRequest": { "type": "object", - "description": "上传技能压缩包的 multipart 表单。", + "description": "MCP 服务器列表的分页与团队过滤条件。", "properties": { - "file": { - "type": "string", - "format": "binary", - "description": "技能压缩包(.skill / .zip / .tar.gz / .tgz),最大 100MB。" + "p": { + "type": "integer", + "description": "页码,从 1 开始。", + "default": 1 }, - "team_id": { + "limit": { "type": "integer", - "description": "新技能的团队范围:0 表示账户级。", - "format": "int64" + "description": "每页数量。", + "default": 20 }, - "replace": { - "type": "boolean", - "description": "为 true 时覆盖同名技能。" + "team_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "按团队 ID 过滤;为空则使用调用者可见范围。" }, - "skill_id": { - "type": "string", - "description": "替换指定技能时的技能 ID。" + "include_account": { + "type": [ + "boolean", + "null" + ], + "description": "是否包含账户级(team_id=0)记录,默认 true。" } - }, - "required": [ - "file" - ] + } }, - "SkillListResponse": { + "MCPServerListResponse": { "type": "object", - "description": "分页的技能列表。", + "description": "分页的 MCP 服务器列表。", "properties": { "total": { "type": "integer", - "description": "匹配的技能总数。", + "description": "匹配的服务器总数。", "format": "int64" }, - "skills": { + "servers": { "type": "array", "items": { - "$ref": "#/components/schemas/SkillItem" + "$ref": "#/components/schemas/MCPServerItem" }, - "description": "当前页的技能。" + "description": "当前页的 MCP 服务器。" } }, "required": [ "total", - "skills" - ] - }, - "MCPToolInfo": { - "type": "object", - "description": "MCP 服务器暴露的单个工具的元数据。", - "properties": { - "name": { - "type": "string", - "description": "工具名称。" - }, - "description": { - "type": "string", - "description": "工具描述。" - }, - "input_schema": { - "type": "object", - "additionalProperties": true, - "description": "描述工具输入参数的 JSON Schema。" - } - }, - "required": [ - "name", - "description" + "servers" ] }, - "MCPServerItem": { + "A2AAgentItem": { "type": "object", - "description": "账户下注册的 MCP 服务器(连接器)。", + "description": "已注册的 A2A(智能体到智能体)远程智能体。", "properties": { - "server_id": { + "agent_id": { "type": "string", - "description": "MCP 服务器唯一 ID(前缀 `mcp_`)。" + "description": "A2A 智能体唯一 ID(前缀 `a2a_`)。" }, "account_id": { "type": "integer", @@ -2836,92 +3955,62 @@ }, "can_edit": { "type": "boolean", - "description": "调用者是否可编辑该服务器。" - }, - "server_name": { - "type": "string", - "description": "MCP 服务器名称,在账户内唯一。" - }, - "description": { - "type": "string", - "description": "服务器描述。" + "description": "调用者是否可编辑该智能体。" }, - "ai_description": { + "agent_name": { "type": "string", - "description": "LLM 生成的描述,存在时优先于 `description`。" + "description": "智能体显示名称。" }, - "transport": { + "instructions": { "type": "string", - "description": "传输协议。", - "enum": [ - "stdio", - "sse", - "streamable-http" - ] + "description": "调用说明,会进入 AI SRE 的系统提示词,用于判断何时调用此 A2A 智能体。", + "maxLength": 2000 }, - "command": { + "card_url": { "type": "string", - "description": "可执行命令(仅 stdio 传输)。" - }, - "args": { - "type": "array", - "items": { - "type": "string" - }, - "description": "命令参数(stdio 传输)。" - }, - "env": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "环境变量(stdio 传输);密钥值已脱敏。" + "description": "远程智能体卡片的 URL。" }, - "url": { + "auth_type": { "type": "string", - "description": "服务器 URL(sse / streamable-http 传输)。" + "description": "访问远程智能体的认证类型。" }, - "headers": { + "auth_config": { "type": "object", "additionalProperties": { "type": "string" }, - "description": "HTTP 头(sse / streamable-http);密钥值已脱敏。" + "description": "认证配置;密钥值已脱敏。" }, - "proxy_url": { - "type": "string", - "description": "访问服务器使用的出站代理 URL。" + "streaming": { + "type": "boolean", + "description": "远程智能体是否支持流式响应。" }, "status": { "type": "string", - "description": "服务器状态。", + "description": "智能体状态。", "enum": [ "enabled", "disabled" ] }, - "connect_timeout": { - "type": "integer", - "description": "连接超时,单位秒(0 表示默认 10 秒)。" - }, - "call_timeout": { - "type": "integer", - "description": "工具调用超时,单位秒(0 表示默认 60 秒)。" - }, - "tools": { + "agent_card_name": { + "type": "string", + "description": "从远程卡片解析出的智能体名称。" + }, + "agent_card_skills": { "type": "array", "items": { - "$ref": "#/components/schemas/MCPToolInfo" + "type": "string" }, - "description": "实时工具列表;由 get/test 接口填充。" + "description": "远程卡片声明的技能。" }, - "tool_count": { + "card_resolve_timeout": { "type": "integer", - "description": "实时工具列表的数量。" + "description": "卡片解析超时,单位秒。" }, - "list_error": { - "type": "string", - "description": "实时获取工具列表失败时的错误信息。" + "task_timeout": { + "type": "integer", + "description": "单任务执行超时,单位秒。" }, "auth_mode": { "type": "string", @@ -2940,13 +4029,9 @@ "type": "string", "description": "JSON 编码的 OAuth 元数据(per_user_oauth 模式)。" }, - "source_template_name": { - "type": "string", - "description": "该连接器安装来源的市场模板名称;自建为空。" - }, "created_by": { "type": "integer", - "description": "创建该服务器的成员 ID。", + "description": "创建该智能体的成员 ID。", "format": "int64" }, "created_at": { @@ -2961,186 +4046,61 @@ } }, "required": [ - "server_id", + "agent_id", "account_id", "team_id", "can_edit", - "server_name", - "description", - "transport", + "agent_name", + "instructions", + "card_url", + "auth_type", + "streaming", "status", - "connect_timeout", - "call_timeout", + "card_resolve_timeout", + "task_timeout", "created_by", "created_at", "updated_at" ] }, - "MCPServerCreateRequest": { + "A2AAgentCreateRequest": { "type": "object", - "description": "新建 MCP 服务器的配置。", + "description": "注册新 A2A 智能体的参数。", "properties": { - "server_name": { - "type": "string", - "description": "MCP 服务器名称,在账户内唯一。", - "minLength": 1, - "maxLength": 255 - }, - "description": { + "agent_name": { "type": "string", - "description": "服务器描述。", - "minLength": 1, - "maxLength": 1024 + "description": "智能体显示名称。", + "maxLength": 128 }, - "transport": { + "instructions": { "type": "string", - "description": "传输协议。", - "enum": [ - "stdio", - "sse", - "streamable-http" - ] + "description": "调用说明,会进入 AI SRE 的系统提示词,用于判断何时调用此 A2A 智能体。不能为空。", + "maxLength": 2000 }, - "command": { + "card_url": { "type": "string", - "description": "可执行命令(stdio 传输)。" - }, - "args": { - "type": "array", - "items": { - "type": "string" - }, - "description": "命令参数(stdio 传输)。" - }, - "env": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "环境变量(stdio 传输)。" + "description": "远程智能体卡片的 URL。" }, - "url": { + "auth_type": { "type": "string", - "description": "服务器 URL(sse / streamable-http 传输)。" + "description": "远程智能体的认证类型。" }, - "headers": { + "auth_config": { "type": "object", "additionalProperties": { "type": "string" }, - "description": "HTTP 头(sse / streamable-http)。" - }, - "connect_timeout": { - "type": "integer", - "description": "连接超时,单位秒。0 表示默认(10 秒)。" - }, - "call_timeout": { - "type": "integer", - "description": "工具调用超时,单位秒。0 表示默认(60 秒)。" - }, - "auth_mode": { - "type": "string", - "description": "认证模式:shared(默认)、per_user_secret 或 per_user_oauth。" - }, - "secret_schema": { - "type": "string", - "description": "JSON 密钥 schema;auth_mode=per_user_secret 时必填。" - }, - "oauth_metadata": { - "type": "string", - "description": "JSON OAuth 元数据;为 per_user_oauth 预留。" + "description": "认证配置键值对。" }, - "status": { - "type": "string", - "description": "初始状态。", - "enum": [ - "enabled", - "disabled" - ], - "default": "enabled" + "streaming": { + "type": "boolean", + "description": "远程智能体是否支持流式响应。" }, "team_id": { "type": "integer", "description": "团队范围:0 表示账户级;>0 表示团队。", "format": "int64" }, - "source_template_name": { - "type": "string", - "description": "从连接器模板创建时的市场模板名称。" - } - }, - "required": [ - "server_name", - "description", - "transport" - ] - }, - "MCPServerUpdateRequest": { - "type": "object", - "description": "MCP 服务器的部分更新;省略字段表示不变。", - "properties": { - "server_id": { - "type": "string", - "description": "目标 MCP 服务器 ID。" - }, - "server_name": { - "type": "string", - "description": "新名称。", - "minLength": 1, - "maxLength": 255 - }, - "description": { - "type": "string", - "description": "新描述。", - "minLength": 1, - "maxLength": 1024 - }, - "transport": { - "type": "string", - "description": "传输协议。", - "enum": [ - "stdio", - "sse", - "streamable-http" - ] - }, - "command": { - "type": "string", - "description": "可执行命令(stdio 传输)。" - }, - "args": { - "type": "array", - "items": { - "type": "string" - }, - "description": "命令参数(stdio 传输)。" - }, - "env": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "环境变量(stdio 传输)。" - }, - "url": { - "type": "string", - "description": "服务器 URL(sse / streamable-http 传输)。" - }, - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "HTTP 头(sse / streamable-http)。" - }, - "connect_timeout": { - "type": "integer", - "description": "连接超时,单位秒。0 表示默认(10 秒)。" - }, - "call_timeout": { - "type": "integer", - "description": "工具调用超时,单位秒。0 表示默认(60 秒)。" - }, "auth_mode": { "type": "string", "description": "认证模式:shared(默认)、per_user_secret 或 per_user_oauth。" @@ -3152,67 +4112,48 @@ "oauth_metadata": { "type": "string", "description": "JSON OAuth 元数据;为 per_user_oauth 预留。" - }, - "team_id": { - "type": [ - "integer", - "null" - ], - "description": "重新分配团队范围:0 表示账户级;>0 表示团队。省略则不变。", - "format": "int64" - } - }, - "required": [ - "server_id" - ] - }, - "MCPServerGetRequest": { - "type": "object", - "description": "按 ID 查询 MCP 服务器。", - "properties": { - "server_id": { - "type": "string", - "description": "目标 MCP 服务器 ID。" } }, "required": [ - "server_id" + "agent_name", + "instructions", + "card_url" ] }, - "MCPServerDeleteRequest": { + "A2AAgentCreateResponse": { "type": "object", - "description": "按 ID 删除 MCP 服务器。", + "description": "注册 A2A 智能体的结果。", "properties": { - "server_id": { + "agent_id": { "type": "string", - "description": "目标 MCP 服务器 ID。" + "description": "新建智能体的 ID。" } }, "required": [ - "server_id" + "agent_id" ] }, - "MCPServerStatusRequest": { + "A2AAgentIDRequest": { "type": "object", - "description": "按 ID 启用/禁用 MCP 服务器。", + "description": "按 ID 查询 A2A 智能体。", "properties": { - "server_id": { + "agent_id": { "type": "string", - "description": "目标 MCP 服务器 ID。" + "description": "目标智能体 ID。" } }, "required": [ - "server_id" + "agent_id" ] }, - "MCPServerListRequest": { + "A2AAgentListRequest": { "type": "object", - "description": "MCP 服务器列表的分页与团队过滤条件。", + "description": "A2A 智能体列表的分页与团队过滤条件。", "properties": { - "p": { + "offset": { "type": "integer", - "description": "页码,从 1 开始。", - "default": 1 + "description": "分页行偏移。", + "default": 0 }, "limit": { "type": "integer", @@ -3236,851 +4177,1205 @@ } } }, - "MCPServerListResponse": { - "type": "object", - "description": "分页的 MCP 服务器列表。", - "properties": { - "total": { - "type": "integer", - "description": "匹配的服务器总数。", - "format": "int64" - }, - "servers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MCPServerItem" - }, - "description": "当前页的 MCP 服务器。" - } - }, - "required": [ - "total", - "servers" - ] - }, - "A2AAgentItem": { + "A2AAgentUpdateRequest": { "type": "object", - "description": "已注册的 A2A(智能体到智能体)远程智能体。", + "description": "A2A 智能体的部分更新;为空或省略的字段保持不变。", "properties": { "agent_id": { "type": "string", - "description": "A2A 智能体唯一 ID(前缀 `a2a_`)。" - }, - "account_id": { - "type": "integer", - "description": "所属账户 ID。", - "format": "int64" - }, - "team_id": { - "type": "integer", - "description": "团队范围:0 表示账户级;>0 表示所属团队。", - "format": "int64" - }, - "can_edit": { - "type": "boolean", - "description": "调用者是否可编辑该智能体。" + "description": "目标智能体 ID。" }, "agent_name": { - "type": "string", - "description": "智能体显示名称。" + "type": [ + "string", + "null" + ], + "description": "新的显示名称。省略则不变。", + "maxLength": 128 }, "instructions": { - "type": "string", - "description": "调用说明,会进入 AI SRE 的系统提示词,用于判断何时调用此 A2A 智能体。", + "type": [ + "string", + "null" + ], + "description": "新的调用说明。省略则不变;传入时不能为空。", "maxLength": 2000 }, "card_url": { - "type": "string", - "description": "远程智能体卡片的 URL。" + "type": [ + "string", + "null" + ], + "description": "新的卡片 URL。省略则不变。" }, "auth_type": { - "type": "string", - "description": "访问远程智能体的认证类型。" + "type": [ + "string", + "null" + ], + "description": "新的认证类型。省略则不变。" }, "auth_config": { "type": "object", "additionalProperties": { "type": "string" }, - "description": "认证配置;密钥值已脱敏。" + "description": "替换认证配置。省略则不变。" }, "streaming": { - "type": "boolean", - "description": "远程智能体是否支持流式响应。" - }, - "status": { - "type": "string", - "description": "智能体状态。", - "enum": [ - "enabled", - "disabled" - ] - }, - "agent_card_name": { - "type": "string", - "description": "从远程卡片解析出的智能体名称。" - }, - "agent_card_skills": { - "type": "array", - "items": { - "type": "string" - }, - "description": "远程卡片声明的技能。" - }, - "card_resolve_timeout": { - "type": "integer", - "description": "卡片解析超时,单位秒。" + "type": [ + "boolean", + "null" + ], + "description": "切换流式支持。省略则不变。" }, - "task_timeout": { - "type": "integer", - "description": "单任务执行超时,单位秒。" + "team_id": { + "type": [ + "integer", + "null" + ], + "description": "重新分配团队范围。省略则不变。", + "format": "int64" }, "auth_mode": { - "type": "string", - "description": "认证模式。", - "enum": [ - "shared", - "per_user_secret", - "per_user_oauth" - ] + "type": [ + "string", + "null" + ], + "description": "新的认证模式:shared、per_user_secret 或 per_user_oauth。" }, "secret_schema": { - "type": "string", - "description": "JSON 编码的密钥 schema(per_user_secret 模式)。" + "type": [ + "string", + "null" + ], + "description": "新的 JSON 密钥 schema。" }, "oauth_metadata": { - "type": "string", - "description": "JSON 编码的 OAuth 元数据(per_user_oauth 模式)。" + "type": [ + "string", + "null" + ], + "description": "新的 JSON OAuth 元数据。" + } + }, + "required": [ + "agent_id" + ] + }, + "A2AAgentListResponse": { + "type": "object", + "description": "分页的 A2A 智能体列表。", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/A2AAgentItem" + }, + "description": "当前页的 A2A 智能体。" }, - "created_by": { + "total": { "type": "integer", - "description": "创建该智能体的成员 ID。", + "description": "匹配的智能体总数。", "format": "int64" + } + }, + "required": [ + "items", + "total" + ] + }, + "SessionGetRequest": { + "type": "object", + "description": "查询单个会话,并返回其最近事件的一页(向更早方向分页)。", + "properties": { + "session_id": { + "type": "string", + "description": "目标会话 ID。", + "minLength": 1 }, - "created_at": { + "num_recent_events": { "type": "integer", - "format": "int64", - "description": "创建时间,Unix 毫秒时间戳。" + "description": "旧版每页数量:返回的最近事件数。与 `limit` 同时设置时以 `limit` 为准;0 使用服务端默认值(100)。", + "minimum": 0, + "maximum": 1000 }, - "updated_at": { + "limit": { "type": "integer", - "format": "int64", - "description": "最近更新时间,Unix 毫秒时间戳。" + "description": "事件每页数量;优先于 `num_recent_events`。0 使用服务端默认值(100)。", + "minimum": 0, + "maximum": 1000 + }, + "search_after_ctx": { + "type": "string", + "description": "上一次响应返回的不透明游标;回传以获取更早的一页。", + "maxLength": 4096 } }, "required": [ - "agent_id", - "account_id", - "team_id", - "can_edit", - "agent_name", - "instructions", - "card_url", - "auth_type", - "streaming", - "status", - "card_resolve_timeout", - "task_timeout", - "created_by", - "created_at", - "updated_at" + "session_id" ] }, - "A2AAgentCreateRequest": { + "SessionListRequest": { "type": "object", - "description": "注册新 A2A 智能体的参数。", + "description": "查询智能体会话列表的过滤条件。读取范围限定为解析出的账户及调用者可见的团队。", "properties": { - "agent_name": { + "app_name": { "type": "string", - "description": "智能体显示名称。", - "maxLength": 128 + "description": "要查询其会话的智能体应用。", + "enum": [ + "ask-ai", + "support", + "support-website", + "support-flashcat", + "ai-sre", + "template-assistant", + "swe" + ] }, - "instructions": { - "type": "string", - "description": "调用说明,会进入 AI SRE 的系统提示词,用于判断何时调用此 A2A 智能体。不能为空。", - "maxLength": 2000 + "p": { + "type": "integer", + "description": "页码,从 1 开始。", + "default": 1, + "minimum": 1 }, - "card_url": { - "type": "string", - "description": "远程智能体卡片的 URL。" + "limit": { + "type": "integer", + "description": "每页数量,1–100。", + "minimum": 1, + "maximum": 100, + "default": 20 }, - "auth_type": { + "orderby": { "type": "string", - "description": "远程智能体的认证类型。" - }, - "auth_config": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "认证配置键值对。" + "description": "排序字段。", + "enum": [ + "created_at", + "updated_at" + ] }, - "streaming": { + "asc": { "type": "boolean", - "description": "远程智能体是否支持流式响应。" + "description": "为 true 时升序;仅在设置 `orderby` 时生效。" }, - "team_id": { - "type": "integer", - "description": "团队范围:0 表示账户级;>0 表示团队。", - "format": "int64" + "include_subagent_sessions": { + "type": "boolean", + "description": "是否在列表中包含子智能体派生的会话。" }, - "auth_mode": { + "keyword": { "type": "string", - "description": "认证模式:shared(默认)、per_user_secret 或 per_user_oauth。" + "description": "按会话名称关键字过滤。", + "maxLength": 64 }, - "secret_schema": { + "scope": { "type": "string", - "description": "JSON 密钥 schema;auth_mode=per_user_secret 时必填。" + "description": "可见范围:all(本人 + 所属团队,默认)、personal 或 team。", + "enum": [ + "all", + "personal", + "team" + ] }, - "oauth_metadata": { + "team_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "可选的团队过滤;与 `scope` 取交集。" + }, + "entry_kinds": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "web", + "im", + "api", + "automation" + ] + }, + "description": "仅返回由这些入口产生的会话;为空则返回所有类型。" + }, + "status": { "type": "string", - "description": "JSON OAuth 元数据;为 per_user_oauth 预留。" + "description": "归档分桶:active(默认)返回未归档,archived 返回已归档,all 返回全部。", + "enum": [ + "active", + "archived", + "all" + ] } }, "required": [ - "agent_name", - "instructions", - "card_url" + "app_name" ] }, - "A2AAgentCreateResponse": { + "SessionExportRequest": { "type": "object", - "description": "注册 A2A 智能体的结果。", + "description": "以流式 NDJSON 导出单个会话的完整事件记录。", "properties": { - "agent_id": { + "session_id": { "type": "string", - "description": "新建智能体的 ID。" + "description": "目标会话 ID。" + }, + "include_subagents": { + "type": "boolean", + "description": "为 true 时,每条 subagent_dispatch 行后会跟随子会话的完整事件流,并以其自身的 session_meta 包裹。默认 false。" } }, "required": [ - "agent_id" + "session_id" ] }, - "A2AAgentIDRequest": { + "SessionDeleteRequest": { "type": "object", - "description": "按 ID 查询 A2A 智能体。", + "description": "按 ID 删除会话。", "properties": { - "agent_id": { + "session_id": { "type": "string", - "description": "目标智能体 ID。" + "description": "目标会话 ID。", + "minLength": 1 } }, "required": [ - "agent_id" + "session_id" ] }, - "A2AAgentListRequest": { + "SessionItem": { "type": "object", - "description": "A2A 智能体列表的分页与团队过滤条件。", + "description": "单条智能体会话记录。", "properties": { - "offset": { - "type": "integer", - "description": "分页行偏移。", - "default": 0 + "session_id": { + "type": "string", + "description": "会话标识。" }, - "limit": { + "parent_session_id": { + "type": "string", + "description": "子智能体(子)会话的父会话 ID;否则为空。" + }, + "session_name": { + "type": "string", + "description": "会话标题;未命名会话可能为空。" + }, + "app_name": { + "type": "string", + "description": "拥有该会话的智能体应用。" + }, + "entry_kind": { + "type": "string", + "description": "创建该会话的入口来源。", + "enum": [ + "web", + "im", + "api", + "scheduled", + "subagent" + ] + }, + "person_id": { + "type": "string", + "description": "创建者人员 ID。" + }, + "team_id": { "type": "integer", - "description": "每页数量。", - "default": 20 + "format": "int64", + "description": "所属团队 ID;0 表示未绑定团队。创建后不可变更。" }, - "team_ids": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "description": "按团队 ID 过滤;为空则使用调用者可见范围。" + "team_name": { + "type": "string", + "description": "解析出的团队名称;未绑定或团队已删除时为空。" }, - "include_account": { - "type": [ - "boolean", - "null" - ], - "description": "是否包含账户级(team_id=0)记录,默认 true。" - } - } - }, - "A2AAgentUpdateRequest": { - "type": "object", - "description": "A2A 智能体的部分更新;为空或省略的字段保持不变。", - "properties": { - "agent_id": { + "is_mine": { + "type": "boolean", + "description": "当该会话由调用者创建时为 true。" + }, + "can_manage": { + "type": "boolean", + "description": "当调用者可重命名/归档/删除该会话时为 true。" + }, + "status": { "type": "string", - "description": "目标智能体 ID。" + "description": "生命周期状态。", + "enum": [ + "enabled", + "deleted" + ] }, - "agent_name": { - "type": [ - "string", - "null" - ], - "description": "新的显示名称。省略则不变。", - "maxLength": 128 + "incognito": { + "type": "boolean", + "description": "无痕(不持久化记忆)会话时为 true。" }, - "instructions": { - "type": [ - "string", - "null" - ], - "description": "新的调用说明。省略则不变;传入时不能为空。", - "maxLength": 2000 + "created_at": { + "type": "integer", + "format": "int64", + "description": "会话创建时间,Unix 毫秒时间戳。" }, - "card_url": { - "type": [ - "string", - "null" - ], - "description": "新的卡片 URL。省略则不变。" + "updated_at": { + "type": "integer", + "format": "int64", + "description": "会话最近更新时间,Unix 毫秒时间戳。" }, - "auth_type": { - "type": [ - "string", - "null" - ], - "description": "新的认证类型。省略则不变。" + "template_staging_round_id": { + "type": "string", + "description": "当前 save→validate 轮次 ID(仅 template-assistant);否则为空。" }, - "auth_config": { + "state": { "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "替换认证配置。省略则不变。" + "additionalProperties": true, + "description": "原始会话状态包(会话级键)。为空时省略。" }, - "streaming": { - "type": [ - "boolean", - "null" - ], - "description": "切换流式支持。省略则不变。" + "bound_environment": { + "$ref": "#/components/schemas/EnvironmentBinding" }, - "team_id": { - "type": [ - "integer", - "null" - ], - "description": "重新分配团队范围。省略则不变。", - "format": "int64" + "context_resolved": { + "$ref": "#/components/schemas/ContextResolvedItem" + }, + "token_usage": { + "$ref": "#/components/schemas/SessionTokenUsage" + }, + "current_context_tokens": { + "type": "integer", + "format": "int64", + "description": "截至最近一轮的 LLM 上下文窗口的 token 数。0 表示尚无已完成的轮次。" + }, + "context_window": { + "type": "integer", + "format": "int64", + "description": "所绑定模型的最大上下文 token 数。0 表示未知。" + }, + "archived_at": { + "type": "integer", + "format": "int64", + "description": "归档时间,Unix 毫秒时间戳;0 表示未归档。" + }, + "pinned_at": { + "type": "integer", + "format": "int64", + "description": "调用者的个人置顶时间,Unix 毫秒时间戳;0 表示未置顶。" }, - "auth_mode": { - "type": [ - "string", - "null" - ], - "description": "新的认证模式:shared、per_user_secret 或 per_user_oauth。" + "last_event_at": { + "type": "integer", + "format": "int64", + "description": "最近一条助手侧事件的时间,Unix 毫秒时间戳。" }, - "secret_schema": { - "type": [ - "string", - "null" - ], - "description": "新的 JSON 密钥 schema。" + "is_running": { + "type": "boolean", + "description": "当该会话当前有正在进行的智能体轮次时为 true。" }, - "oauth_metadata": { - "type": [ - "string", - "null" - ], - "description": "新的 JSON OAuth 元数据。" + "has_unread": { + "type": "boolean", + "description": "当存在调用者尚未查看的助手输出时为 true。" } - }, - "required": [ - "agent_id" - ] + } }, - "A2AAgentListResponse": { + "SessionGetResponse": { "type": "object", - "description": "分页的 A2A 智能体列表。", + "description": "一个会话及其事件的一页(向更早方向分页)。", "properties": { - "items": { + "session": { + "$ref": "#/components/schemas/SessionItem" + }, + "events": { "type": "array", "items": { - "$ref": "#/components/schemas/A2AAgentItem" + "$ref": "#/components/schemas/EventItem" }, - "description": "当前页的 A2A 智能体。" + "description": "最近事件,按 (created_at, event_id) 升序排列。" }, - "total": { - "type": "integer", - "description": "匹配的智能体总数。", - "format": "int64" + "has_more_older": { + "type": "boolean", + "description": "当本页之外仍有更早的事件时为 true。" + }, + "search_after_ctx": { + "type": "string", + "description": "不透明游标;作为 search_after_ctx 回传以获取更早的一页。has_more_older 为 false 时省略。" } - }, - "required": [ - "items", - "total" - ] + } }, - "SessionGetRequest": { + "SessionListResponse": { "type": "object", - "description": "查询单个会话,并返回其最近事件的一页(向更早方向分页)。", + "description": "一页智能体会话。", "properties": { - "session_id": { - "type": "string", - "description": "目标会话 ID。", - "minLength": 1 - }, - "num_recent_events": { - "type": "integer", - "description": "旧版每页数量:返回的最近事件数。与 `limit` 同时设置时以 `limit` 为准;0 使用服务端默认值(100)。", - "minimum": 0, - "maximum": 1000 - }, - "limit": { + "total": { "type": "integer", - "description": "事件每页数量;优先于 `num_recent_events`。0 使用服务端默认值(100)。", - "minimum": 0, - "maximum": 1000 + "format": "int64", + "description": "匹配过滤条件的会话总数(忽略分页)。" }, - "search_after_ctx": { - "type": "string", - "description": "上一次响应返回的不透明游标;回传以获取更早的一页。", - "maxLength": 4096 + "sessions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SessionItem" + }, + "description": "当前页的会话。" } - }, - "required": [ - "session_id" - ] + } }, - "SessionListRequest": { + "EventItem": { "type": "object", - "description": "查询智能体会话列表的过滤条件。读取范围限定为解析出的账户及调用者可见的团队。", + "description": "单条已持久化的会话事件。content/actions/usage_metadata 携带原始 ADK 信封,请将其视为不透明的结构化负载。", "properties": { - "app_name": { + "event_id": { "type": "string", - "description": "要查询其会话的智能体应用。", - "enum": [ - "ask-ai", - "support", - "support-website", - "support-flashcat", - "ai-sre", - "template-assistant", - "swe" - ] + "description": "事件标识。" }, - "p": { - "type": "integer", - "description": "页码,从 1 开始。", - "default": 1, - "minimum": 1 + "session_id": { + "type": "string", + "description": "所属会话 ID。" }, - "limit": { - "type": "integer", - "description": "每页数量,1–100。", - "minimum": 1, - "maximum": 100, - "default": 20 + "invocation_id": { + "type": "string", + "description": "标识一轮的 ADK 调用 ID。" }, - "orderby": { + "author": { "type": "string", - "description": "排序字段。", - "enum": [ - "created_at", - "updated_at" - ] + "description": "事件作者(如 user 或智能体名称)。" }, - "asc": { + "branch": { + "type": "string", + "description": "嵌套智能体的 ADK 分支路径。" + }, + "content": { + "type": "object", + "additionalProperties": true, + "description": "ADK content 信封 {role, parts:[...]}。" + }, + "actions": { + "type": "object", + "additionalProperties": true, + "description": "ADK actions 信封(状态增量、转移、升级)。" + }, + "usage_metadata": { + "type": "object", + "additionalProperties": true, + "description": "单轮 token 用量元数据。" + }, + "partial": { "type": "boolean", - "description": "为 true 时升序;仅在设置 `orderby` 时生效。" + "description": "流式部分分片时为 true。" }, - "include_subagent_sessions": { + "turn_complete": { "type": "boolean", - "description": "是否在列表中包含子智能体派生的会话。" + "description": "一轮的终止事件上为 true。" }, - "keyword": { + "error_code": { "type": "string", - "description": "按会话名称关键字过滤。", - "maxLength": 64 + "description": "当该事件表示失败时的错误码。" }, - "scope": { + "error_message": { "type": "string", - "description": "可见范围:all(本人 + 所属团队,默认)、personal 或 team。", - "enum": [ - "all", - "personal", - "team" - ] - }, - "team_ids": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "description": "可选的团队过滤;与 `scope` 取交集。" - }, - "entry_kinds": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "web", - "im", - "api", - "automation" - ] - }, - "description": "仅返回由这些入口产生的会话;为空则返回所有类型。" + "description": "可读的错误信息(如有)。" }, "status": { "type": "string", - "description": "归档分桶:active(默认)返回未归档,archived 返回已归档,all 返回全部。", + "description": "事件状态。", "enum": [ - "active", - "archived", - "all" + "normal", + "compressed" ] + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "事件写入时间,Unix 毫秒时间戳。" } - }, - "required": [ - "app_name" - ] + } }, - "SessionExportRequest": { + "SessionTokenUsage": { "type": "object", - "description": "以流式 NDJSON 导出单个会话的完整事件记录。", + "description": "跨所有轮次的会话级 token 累计汇总。账户计费的权威来源。", "properties": { - "session_id": { - "type": "string", - "description": "目标会话 ID。" + "input_tokens": { + "type": "integer", + "format": "int64", + "description": "提示(输入)token 总数,含缓存部分。" }, - "include_subagents": { - "type": "boolean", - "description": "为 true 时,每条 subagent_dispatch 行后会跟随子会话的完整事件流,并以其自身的 session_meta 包裹。默认 false。" - } - }, - "required": [ - "session_id" - ] + "cached_tokens": { + "type": "integer", + "format": "int64", + "description": "input_tokens 中由提示缓存命中的部分。" + }, + "output_tokens": { + "type": "integer", + "format": "int64", + "description": "生成(输出)token 总数。" + }, + "reasoning_tokens": { + "type": "integer", + "format": "int64", + "description": "推理/思考 token 总数。" + } + } }, - "SessionDeleteRequest": { + "EnvironmentBinding": { "type": "object", - "description": "按 ID 删除会话。", + "description": "会话绑定的 runner 或云沙箱。首条消息前为 null。", "properties": { - "session_id": { + "kind": { "type": "string", - "description": "目标会话 ID。", - "minLength": 1 + "description": "环境类型(如 runner、sandbox)。" + }, + "id": { + "type": "string", + "description": "环境标识。" + }, + "name": { + "type": "string", + "description": "可读的环境名称。" + }, + "status": { + "type": "string", + "description": "绑定状态。" } - }, - "required": [ - "session_id" - ] + } }, - "SessionItem": { + "ContextResolvedItem": { "type": "object", - "description": "单条智能体会话记录。", + "description": "该会话三层知识包解析结果的快照。", "properties": { - "session_id": { - "type": "string", - "description": "会话标识。" - }, - "parent_session_id": { + "account_pack_id": { "type": "string", - "description": "子智能体(子)会话的父会话 ID;否则为空。" + "description": "解析出的账户级知识包 ID。" }, - "session_name": { + "team_pack_id": { "type": "string", - "description": "会话标题;未命名会话可能为空。" + "description": "解析出的团队级知识包 ID。" }, - "app_name": { + "incident_id": { "type": "string", - "description": "拥有该会话的智能体应用。" + "description": "作战室来源时绑定的故障 ID。" }, - "entry_kind": { - "type": "string", - "description": "创建该会话的入口来源。", - "enum": [ - "web", - "im", - "api", - "scheduled", - "subagent" - ] + "resolved_at_ms": { + "type": "integer", + "format": "int64", + "description": "知识包解析时间,Unix 毫秒时间戳。" }, - "person_id": { + "versions": { + "type": "object", + "additionalProperties": { + "type": "integer" + }, + "description": "各知识包解析版本映射。" + } + } + }, + "AutomationRuleCreateRequest": { + "type": "object", + "description": "创建一条 AI SRE 自动化规则所需的配置。", + "properties": { + "name": { "type": "string", - "description": "创建者人员 ID。" + "description": "规则名称。", + "minLength": 1, + "maxLength": 255 }, "team_id": { "type": "integer", "format": "int64", - "description": "所属团队 ID;0 表示未绑定团队。创建后不可变更。" + "description": "规则归属。`0` 表示个人规则,团队 ID 表示团队规则。", + "minimum": 0 }, - "team_name": { + "enabled": { + "type": "boolean", + "description": "创建后是否立即启用规则。" + }, + "cron_expr": { "type": "string", - "description": "解析出的团队名称;未绑定或团队已删除时为空。" + "description": "API 形态的 4 段 cron:小时、日期、月份、星期。" }, - "is_mine": { - "type": "boolean", - "description": "当该会话由调用者创建时为 true。" + "schedule_trigger_enabled": { + "type": [ + "boolean", + "null" + ], + "description": "覆盖定时触发器的启用状态;省略时沿用默认启用。" }, - "can_manage": { - "type": "boolean", - "description": "当调用者可重命名/归档/删除该会话时为 true。" + "prompt": { + "type": "string", + "description": "每次自动化运行时交给 Agent 的任务提示词。", + "minLength": 1 }, - "status": { + "environment_kind": { "type": "string", - "description": "生命周期状态。", + "description": "偏好的执行环境;省略时由后端自动选择。", "enum": [ - "enabled", - "deleted" + "cloud", + "byoc" ] }, - "incognito": { + "environment_id": { + "type": "string", + "description": "当 `environment_kind` 为 `byoc` 时使用的具体 Runner ID。" + }, + "http_post_trigger_enabled": { "type": "boolean", - "description": "无痕(不持久化记忆)会话时为 true。" + "description": "是否同时启用 HTTP POST 触发器。" + } + }, + "required": [ + "name", + "cron_expr", + "prompt" + ] + }, + "AutomationRuleUpdateRequest": { + "type": "object", + "description": "局部更新一条 AI SRE 自动化规则;省略的字段保持不变。", + "properties": { + "rule_id": { + "type": "string", + "description": "目标自动化规则 ID。" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "会话创建时间,Unix 毫秒时间戳。" + "name": { + "type": [ + "string", + "null" + ], + "description": "新的规则名称。", + "maxLength": 255 }, - "updated_at": { - "type": "integer", + "team_id": { + "type": [ + "integer", + "null" + ], "format": "int64", - "description": "会话最近更新时间,Unix 毫秒时间戳。" + "description": "把规则移动到新的范围;`0` 表示个人规则。", + "minimum": 0 }, - "template_staging_round_id": { - "type": "string", - "description": "当前 save→validate 轮次 ID(仅 template-assistant);否则为空。" + "enabled": { + "type": [ + "boolean", + "null" + ], + "description": "启用或停用规则。" }, - "state": { - "type": "object", - "additionalProperties": true, - "description": "原始会话状态包(会话级键)。为空时省略。" + "cron_expr": { + "type": [ + "string", + "null" + ], + "description": "新的 4 段 cron 表达式。" }, - "bound_environment": { - "$ref": "#/components/schemas/EnvironmentBinding" + "schedule_trigger_enabled": { + "type": [ + "boolean", + "null" + ], + "description": "启用或停用定时触发器。" }, - "context_resolved": { - "$ref": "#/components/schemas/ContextResolvedItem" + "prompt": { + "type": [ + "string", + "null" + ], + "description": "新的任务提示词。" + }, + "environment_kind": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cloud", + "byoc" + ] + }, + { + "type": "null" + } + ], + "description": "偏好的执行环境;传 `null` 或省略表示保持不变。" }, - "token_usage": { - "$ref": "#/components/schemas/SessionTokenUsage" + "environment_id": { + "type": [ + "string", + "null" + ], + "description": "新的 BYOC Runner ID;切换 away from BYOC 时可传空字符串清空。" }, - "current_context_tokens": { - "type": "integer", - "format": "int64", - "description": "截至最近一轮的 LLM 上下文窗口的 token 数。0 表示尚无已完成的轮次。" + "http_post_trigger_enabled": { + "type": [ + "boolean", + "null" + ], + "description": "启用或停用 HTTP POST 触发器。" }, - "context_window": { + "rotate_http_post_trigger_token": { + "type": "boolean", + "description": "轮换 HTTP 触发 token;旧 token 会立即失效。" + } + }, + "required": [ + "rule_id" + ] + }, + "AutomationRuleIDRequest": { + "type": "object", + "description": "按 ID 选择一条自动化规则。", + "properties": { + "rule_id": { + "type": "string", + "description": "自动化规则 ID。" + } + }, + "required": [ + "rule_id" + ] + }, + "AutomationRuleListRequest": { + "type": "object", + "description": "查询自动化规则列表时使用的分页与可见性过滤条件。", + "properties": { + "p": { "type": "integer", - "format": "int64", - "description": "所绑定模型的最大上下文 token 数。0 表示未知。" + "description": "页码,从 1 开始。", + "default": 1, + "minimum": 1 }, - "archived_at": { + "limit": { "type": "integer", - "format": "int64", - "description": "归档时间,Unix 毫秒时间戳;0 表示未归档。" + "description": "每页条数。", + "default": 20, + "minimum": 1 }, - "pinned_at": { - "type": "integer", - "format": "int64", - "description": "调用者的个人置顶时间,Unix 毫秒时间戳;0 表示未置顶。" + "scope": { + "type": "string", + "description": "可见性范围。", + "enum": [ + "all", + "personal", + "team" + ] }, - "last_event_at": { + "team_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "description": "在 scope 解析后追加的团队过滤条件。" + }, + "include_person": { + "type": [ + "boolean", + "null" + ], + "description": "兼容旧语义;当 `scope` 省略且该值为 `false` 时,仅返回团队规则。" + }, + "enabled": { + "type": [ + "boolean", + "null" + ], + "description": "按启用状态过滤。" + }, + "keyword": { + "type": "string", + "description": "对规则名称做子串匹配。", + "maxLength": 64 + } + } + }, + "AutomationRuleListResponse": { + "type": "object", + "description": "当前调用者可见的自动化规则分页结果。", + "properties": { + "total": { "type": "integer", "format": "int64", - "description": "最近一条助手侧事件的时间,Unix 毫秒时间戳。" - }, - "is_running": { - "type": "boolean", - "description": "当该会话当前有正在进行的智能体轮次时为 true。" + "description": "匹配规则总数。" }, - "has_unread": { - "type": "boolean", - "description": "当存在调用者尚未查看的助手输出时为 true。" + "rules": { + "type": "array", + "description": "当前页规则。", + "items": { + "$ref": "#/components/schemas/AutomationRuleItem" + } + } + }, + "required": [ + "total", + "rules" + ] + }, + "AutomationTemplateListRequest": { + "type": "object", + "description": "加载自动化模板时可选的 locale 覆盖。", + "properties": { + "locale": { + "type": "string", + "description": "请求的语言环境,例如 `zh-CN` 或 `en-US`。", + "maxLength": 16 } } }, - "SessionGetResponse": { + "AutomationTemplateListResponse": { "type": "object", - "description": "一个会话及其事件的一页(向更早方向分页)。", + "description": "可用于预填新建自动化规则的预设模板。", "properties": { - "session": { - "$ref": "#/components/schemas/SessionItem" - }, - "events": { + "templates": { "type": "array", + "description": "当前调用者可用的模板。", "items": { - "$ref": "#/components/schemas/EventItem" - }, - "description": "最近事件,按 (created_at, event_id) 升序排列。" + "$ref": "#/components/schemas/AutomationTemplateItem" + } + } + }, + "required": [ + "templates" + ] + }, + "AutomationRunListRequest": { + "type": "object", + "description": "查询某条自动化规则运行历史时使用的过滤条件。", + "properties": { + "rule_id": { + "type": "string", + "description": "要查询运行历史的自动化规则 ID。" }, - "has_more_older": { - "type": "boolean", - "description": "当本页之外仍有更早的事件时为 true。" + "p": { + "type": "integer", + "description": "页码,从 1 开始。", + "default": 1, + "minimum": 1 }, - "search_after_ctx": { + "limit": { + "type": "integer", + "description": "每页条数。", + "default": 20, + "minimum": 1 + }, + "status": { "type": "string", - "description": "不透明游标;作为 search_after_ctx 回传以获取更早的一页。has_more_older 为 false 时省略。" + "description": "按运行状态过滤。", + "enum": [ + "queued", + "running", + "retrying", + "succeeded", + "partial", + "failed", + "skipped", + "abandoned" + ] + }, + "trigger_kind": { + "type": "string", + "description": "按触发来源过滤。", + "enum": [ + "schedule", + "debug", + "http_post" + ] + }, + "started_after_ms": { + "type": "integer", + "format": "int64", + "description": "仅返回开始时间大于等于该 Unix 毫秒时间戳的运行。", + "minimum": 0 + }, + "started_before_ms": { + "type": "integer", + "format": "int64", + "description": "仅返回开始时间小于等于该 Unix 毫秒时间戳的运行。", + "minimum": 0 } - } + }, + "required": [ + "rule_id" + ] }, - "SessionListResponse": { + "AutomationRunListResponse": { "type": "object", - "description": "一页智能体会话。", + "description": "自动化执行历史的分页结果。", "properties": { "total": { "type": "integer", "format": "int64", - "description": "匹配过滤条件的会话总数(忽略分页)。" + "description": "匹配运行总数。" }, - "sessions": { + "runs": { "type": "array", + "description": "当前页运行记录。", "items": { - "$ref": "#/components/schemas/SessionItem" - }, - "description": "当前页的会话。" + "$ref": "#/components/schemas/AutomationRunItem" + } } - } + }, + "required": [ + "total", + "runs" + ] }, - "EventItem": { + "AutomationRuleItem": { "type": "object", - "description": "单条已持久化的会话事件。content/actions/usage_metadata 携带原始 ADK 信封,请将其视为不透明的结构化负载。", + "description": "一条 AI SRE 自动化规则的公开视图。", "properties": { - "event_id": { + "rule_id": { "type": "string", - "description": "事件标识。" + "description": "自动化规则 ID。" }, - "session_id": { - "type": "string", - "description": "所属会话 ID。" + "account_id": { + "type": "integer", + "format": "int64", + "description": "所属账户 ID。" }, - "invocation_id": { + "team_id": { + "type": "integer", + "format": "int64", + "description": "规则范围。`0` 表示个人规则,`>0` 表示团队规则。" + }, + "owner_id": { + "type": "integer", + "format": "int64", + "description": "规则所有者成员 ID。" + }, + "name": { "type": "string", - "description": "标识一轮的 ADK 调用 ID。" + "description": "规则名称。" }, - "author": { + "enabled": { + "type": "boolean", + "description": "规则本身是否启用。" + }, + "run_scope": { "type": "string", - "description": "事件作者(如 user 或智能体名称)。" + "description": "运行时使用的派生范围。", + "enum": [ + "person", + "team" + ] }, - "branch": { + "cron_expr": { "type": "string", - "description": "嵌套智能体的 ADK 分支路径。" + "description": "持久化后的 cron 表达式。4 段 API 输入会在返回时补成前置分钟为 `0` 的 5 段形式。" }, - "content": { - "type": "object", - "additionalProperties": true, - "description": "ADK content 信封 {role, parts:[...]}。" + "prompt": { + "type": "string", + "description": "每次运行执行的任务提示词。" }, - "actions": { - "type": "object", - "additionalProperties": true, - "description": "ADK actions 信封(状态增量、转移、升级)。" + "environment_kind": { + "type": "string", + "description": "偏好的执行环境;空字符串表示自动选择。", + "enum": [ + "", + "cloud", + "byoc" + ] }, - "usage_metadata": { - "type": "object", - "additionalProperties": true, - "description": "单轮 token 用量元数据。" + "environment_id": { + "type": "string", + "description": "选定的 BYOC Runner ID;自动选择时为空字符串。" }, - "partial": { - "type": "boolean", - "description": "流式部分分片时为 true。" + "schedule_trigger_id": { + "type": "string", + "description": "定时触发器 ID。" }, - "turn_complete": { + "schedule_trigger_enabled": { "type": "boolean", - "description": "一轮的终止事件上为 true。" + "description": "定时触发器是否启用。" }, - "error_code": { + "http_post_trigger_id": { "type": "string", - "description": "当该事件表示失败时的错误码。" + "description": "HTTP POST 触发器 ID。" }, - "error_message": { + "http_post_trigger_url": { "type": "string", - "description": "可读的错误信息(如有)。" + "description": "相对触发地址;调用时需附带 `Authorization: Bearer `。" }, - "status": { - "type": "string", - "description": "事件状态。", - "enum": [ - "normal", - "compressed" - ] + "http_post_trigger_enabled": { + "type": "boolean", + "description": "HTTP POST 触发器是否启用。" }, - "created_at": { - "type": "integer", - "format": "int64", - "description": "事件写入时间,Unix 毫秒时间戳。" - } - } - }, - "SessionTokenUsage": { - "type": "object", - "description": "跨所有轮次的会话级 token 累计汇总。账户计费的权威来源。", - "properties": { - "input_tokens": { - "type": "integer", - "format": "int64", - "description": "提示(输入)token 总数,含缓存部分。" + "http_post_token": { + "type": "string", + "description": "一次性明文 HTTP 触发 token;仅在创建或轮换 token 后立即返回。" }, - "cached_tokens": { - "type": "integer", - "format": "int64", - "description": "input_tokens 中由提示缓存命中的部分。" + "can_edit": { + "type": "boolean", + "description": "当前调用者是否可编辑该规则。" }, - "output_tokens": { + "created_at": { "type": "integer", "format": "int64", - "description": "生成(输出)token 总数。" + "description": "规则创建时间,Unix 毫秒时间戳。" }, - "reasoning_tokens": { + "updated_at": { "type": "integer", "format": "int64", - "description": "推理/思考 token 总数。" + "description": "规则最后更新时间,Unix 毫秒时间戳。" } - } + }, + "required": [ + "rule_id", + "account_id", + "team_id", + "owner_id", + "name", + "enabled", + "run_scope", + "cron_expr", + "prompt", + "environment_kind", + "environment_id", + "schedule_trigger_enabled", + "http_post_trigger_enabled", + "can_edit", + "created_at", + "updated_at" + ] }, - "EnvironmentBinding": { + "AutomationTemplateItem": { "type": "object", - "description": "会话绑定的 runner 或云沙箱。首条消息前为 null。", + "description": "后端返回的自动化预设模板。", "properties": { - "kind": { + "name": { "type": "string", - "description": "环境类型(如 runner、sandbox)。" + "description": "模板名称。" }, - "id": { + "description": { "type": "string", - "description": "环境标识。" + "description": "模板用途的简要说明。" }, - "name": { + "icon": { "type": "string", - "description": "可读的环境名称。" + "description": "Mintlify / UI 图标名。" }, - "status": { + "enabled": { + "type": "boolean", + "description": "模板当前是否对终端用户开放。" + }, + "prompt": { "type": "string", - "description": "绑定状态。" + "description": "预填的任务提示词。" } - } + }, + "required": [ + "name", + "description", + "icon", + "enabled", + "prompt" + ] }, - "ContextResolvedItem": { + "AutomationRunItem": { "type": "object", - "description": "该会话三层知识包解析结果的快照。", + "description": "自动化规则运行历史中的一条执行记录。", "properties": { - "account_pack_id": { + "run_id": { "type": "string", - "description": "解析出的账户级知识包 ID。" + "description": "自动化运行 ID。" }, - "team_pack_id": { + "kind": { "type": "string", - "description": "解析出的团队级知识包 ID。" + "description": "运行台账类型。", + "enum": [ + "automation_rule" + ] }, - "incident_id": { + "account_id": { + "type": "integer", + "format": "int64", + "description": "所属账户 ID。" + }, + "rule_id": { "type": "string", - "description": "作战室来源时绑定的故障 ID。" + "description": "自动化规则 ID。" }, - "resolved_at_ms": { + "trigger_kind": { + "type": "string", + "description": "本次运行的触发来源。", + "enum": [ + "schedule", + "debug", + "manual", + "http_post", + "test" + ] + }, + "occurrence_key": { + "type": "string", + "description": "触发事件的幂等键。" + }, + "status": { + "type": "string", + "description": "当前或最终运行状态。", + "enum": [ + "queued", + "running", + "retrying", + "succeeded", + "partial", + "failed", + "skipped", + "abandoned" + ] + }, + "attempts": { + "type": "integer", + "description": "当前运行已尝试次数。" + }, + "started_at": { "type": "integer", "format": "int64", - "description": "知识包解析时间,Unix 毫秒时间戳。" + "description": "运行开始时间,Unix 毫秒时间戳。" }, - "versions": { + "completed_at": { + "type": "integer", + "format": "int64", + "description": "运行结束时间,Unix 毫秒时间戳;运行中时为 `0`。" + }, + "duration_ms": { + "type": "integer", + "format": "int64", + "description": "运行耗时(毫秒);运行中时为 `0`。" + }, + "error_code": { + "type": "string", + "description": "运行级错误码(如有)。" + }, + "error_message": { + "type": "string", + "description": "运行级错误消息(如有)。" + }, + "stats_json": { "type": "object", - "additionalProperties": { - "type": "integer" - }, - "description": "各知识包解析版本映射。" + "additionalProperties": true, + "description": "运行过程中记录的任意 JSON 指标。" + }, + "result_json": { + "type": "object", + "additionalProperties": true, + "description": "运行结果的任意 JSON 负载。" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "运行记录创建时间,Unix 毫秒时间戳。" + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "运行记录最后更新时间,Unix 毫秒时间戳。" } - } + }, + "required": [ + "run_id", + "kind", + "account_id", + "rule_id", + "trigger_kind", + "occurrence_key", + "status", + "attempts", + "started_at", + "completed_at", + "duration_ms", + "error_code", + "error_message", + "created_at", + "updated_at" + ] } } } diff --git a/docs.json b/docs.json index 167c76a..167f30b 100644 --- a/docs.json +++ b/docs.json @@ -1058,6 +1058,19 @@ "POST /safari/session/delete" ] }, + { + "group": "自动化", + "icon": "clock", + "pages": [ + "POST /safari/automation/rule/create", + "POST /safari/automation/rule/list", + "POST /safari/automation/template/list", + "POST /safari/automation/run/list", + "POST /safari/automation/rule/get", + "POST /safari/automation/rule/update", + "POST /safari/automation/rule/delete" + ] + }, { "group": "技能", "icon": "wand-magic-sparkles", @@ -2187,6 +2200,19 @@ "POST /safari/session/delete" ] }, + { + "group": "Automations", + "icon": "clock", + "pages": [ + "POST /safari/automation/rule/create", + "POST /safari/automation/rule/list", + "POST /safari/automation/template/list", + "POST /safari/automation/run/list", + "POST /safari/automation/rule/get", + "POST /safari/automation/rule/update", + "POST /safari/automation/rule/delete" + ] + }, { "group": "Skills", "icon": "wand-magic-sparkles", diff --git a/en/openapi/api-catalog.mdx b/en/openapi/api-catalog.mdx index ed5dd95..1001744 100644 --- a/en/openapi/api-catalog.mdx +++ b/en/openapi/api-catalog.mdx @@ -3,7 +3,7 @@ title: "API Catalog" description: "Complete list of Flashduty Open API endpoints, organized by product module with links to detailed documentation" --- -Flashduty Open API provides **239** endpoints covering five major modules: On-call, Monitors, RUM, AI SRE, and Platform. All endpoints use unified authentication and request specifications. See [Quick Start](/en/openapi/introduction) for details. +Flashduty Open API provides **246** endpoints covering five major modules: On-call, Monitors, RUM, AI SRE, and Platform. All endpoints use unified authentication and request specifications. See [Quick Start](/en/openapi/introduction) for details. All endpoint URLs use `https://api.flashcat.cloud` as the base, authenticated via APP Key through query string. @@ -288,7 +288,7 @@ All endpoint URLs use `https://api.flashcat.cloud` as the base, authenticated vi - + ### Sessions @@ -299,6 +299,18 @@ All endpoint URLs use `https://api.flashcat.cloud` as the base, authenticated vi | POST | [`/safari/session/export`](/en/api-reference/ai-sre/sessions/session-read-export) | Export session events | | POST | [`/safari/session/delete`](/en/api-reference/ai-sre/sessions/session-write-delete) | Delete session | +### Automations + +| Method | Endpoint | Description | +| :--- | :--- | :--- | +| POST | [`/safari/automation/rule/create`](/en/api-reference/ai-sre/automations/automation-rule-write-create) | Create automation rule | +| POST | [`/safari/automation/rule/list`](/en/api-reference/ai-sre/automations/automation-rule-read-list) | List automation rules | +| POST | [`/safari/automation/template/list`](/en/api-reference/ai-sre/automations/automation-template-read-list) | List automation templates | +| POST | [`/safari/automation/run/list`](/en/api-reference/ai-sre/automations/automation-run-read-list) | List automation runs | +| POST | [`/safari/automation/rule/get`](/en/api-reference/ai-sre/automations/automation-rule-read-get) | Get automation rule detail | +| POST | [`/safari/automation/rule/update`](/en/api-reference/ai-sre/automations/automation-rule-write-update) | Update automation rule | +| POST | [`/safari/automation/rule/delete`](/en/api-reference/ai-sre/automations/automation-rule-write-delete) | Delete automation rule | + ### Skills | Method | Endpoint | Description | diff --git a/zh/openapi/api-catalog.mdx b/zh/openapi/api-catalog.mdx index f154797..d8c5af3 100644 --- a/zh/openapi/api-catalog.mdx +++ b/zh/openapi/api-catalog.mdx @@ -3,7 +3,7 @@ title: "API 总览" description: "Flashduty Open API 全量接口列表,按产品模块分类,点击可跳转到接口详情" --- -Flashduty Open API 共提供 **239** 个接口,覆盖 On-call、Monitors、RUM、AI SRE 和平台五大模块。所有接口使用统一的认证方式和请求规范,详见[快速入门](/zh/openapi/introduction)。 +Flashduty Open API 共提供 **246** 个接口,覆盖 On-call、Monitors、RUM、AI SRE 和平台五大模块。所有接口使用统一的认证方式和请求规范,详见[快速入门](/zh/openapi/introduction)。 所有接口 Endpoint 均为 `https://api.flashcat.cloud`,使用 APP Key 通过 query string 认证。 @@ -288,7 +288,7 @@ Flashduty Open API 共提供 **239** 个接口,覆盖 On-call、Monitors、RUM - + ### 会话 @@ -299,6 +299,18 @@ Flashduty Open API 共提供 **239** 个接口,覆盖 On-call、Monitors、RUM | POST | [`/safari/session/export`](/zh/api-reference/ai-sre/sessions/session-read-export) | 导出会话事件 | | POST | [`/safari/session/delete`](/zh/api-reference/ai-sre/sessions/session-write-delete) | 删除会话 | +### 自动化 + +| 方法 | 接口 | 描述 | +| :--- | :--- | :--- | +| POST | [`/safari/automation/rule/create`](/zh/api-reference/ai-sre/automations/automation-rule-write-create) | 创建自动化规则 | +| POST | [`/safari/automation/rule/list`](/zh/api-reference/ai-sre/automations/automation-rule-read-list) | 查询自动化规则列表 | +| POST | [`/safari/automation/template/list`](/zh/api-reference/ai-sre/automations/automation-template-read-list) | 查询自动化模板列表 | +| POST | [`/safari/automation/run/list`](/zh/api-reference/ai-sre/automations/automation-run-read-list) | 查询自动化执行历史 | +| POST | [`/safari/automation/rule/get`](/zh/api-reference/ai-sre/automations/automation-rule-read-get) | 获取自动化规则详情 | +| POST | [`/safari/automation/rule/update`](/zh/api-reference/ai-sre/automations/automation-rule-write-update) | 更新自动化规则 | +| POST | [`/safari/automation/rule/delete`](/zh/api-reference/ai-sre/automations/automation-rule-write-delete) | 删除自动化规则 | + ### 技能 | 方法 | 接口 | 描述 |