Skip to content

Commit 7f8b672

Browse files
authored
Merge pull request #139 from flashcatcloud/codex/flashduty-api-review-api-20260703-031708
docs(api): sync automation trigger APIs
2 parents 91a0c73 + b2fb06d commit 7f8b672

11 files changed

Lines changed: 2762 additions & 58 deletions

api-reference/on-call.openapi.en.json

Lines changed: 340 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13847,6 +13847,177 @@
1384713847
}
1384813848
}
1384913849
},
13850+
"/incident-trigger-subscription/upsert": {
13851+
"post": {
13852+
"operationId": "incident-trigger-subscription-write-upsert",
13853+
"summary": "Create or update incident trigger subscription",
13854+
"description": "Create or update an incident trigger subscription for AI SRE automation.",
13855+
"tags": [
13856+
"On-call/Incidents"
13857+
],
13858+
"x-mint": {
13859+
"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 this when an AI SRE automation rule needs to receive new-incident trigger events from selected On-call channels.\n- `source`, `consumer`, and `consumer_ref` identify the subscription. Omitting `subscription_id` upserts the row for that tuple.\n- Only `Critical`, `Warning`, and `Info` severities are valid; `enabled` defaults to true.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.",
13860+
"href": "/en/api-reference/on-call/incidents/incident-trigger-subscription-write-upsert",
13861+
"metadata": {
13862+
"sidebarTitle": "Create or update incident trigger subscription"
13863+
}
13864+
},
13865+
"responses": {
13866+
"200": {
13867+
"description": "Success",
13868+
"content": {
13869+
"application/json": {
13870+
"schema": {
13871+
"allOf": [
13872+
{
13873+
"$ref": "#/components/schemas/SuccessEnvelope"
13874+
},
13875+
{
13876+
"type": "object",
13877+
"properties": {
13878+
"data": {
13879+
"$ref": "#/components/schemas/IncidentTriggerSubscription"
13880+
}
13881+
}
13882+
}
13883+
]
13884+
},
13885+
"example": {
13886+
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
13887+
"data": {
13888+
"subscription_id": "b8d820f2-3f41-4bce-9acc-3940f7bf2df0",
13889+
"account_id": 10023,
13890+
"source": "ai_sre_automation",
13891+
"consumer": "fc_safari",
13892+
"consumer_ref": "auto_7NnLzY2Qp8xS4kUaV3mR6b",
13893+
"channel_ids": [
13894+
2468013579
13895+
],
13896+
"severities": [
13897+
"Critical",
13898+
"Warning"
13899+
],
13900+
"enabled": true,
13901+
"created_by": 80011,
13902+
"updated_by": 80011,
13903+
"created_at": 1780367971,
13904+
"updated_at": 1780367971,
13905+
"deleted_at": 0
13906+
}
13907+
}
13908+
}
13909+
}
13910+
},
13911+
"400": {
13912+
"$ref": "#/components/responses/BadRequest"
13913+
},
13914+
"401": {
13915+
"$ref": "#/components/responses/Unauthorized"
13916+
},
13917+
"429": {
13918+
"$ref": "#/components/responses/TooManyRequests"
13919+
},
13920+
"500": {
13921+
"$ref": "#/components/responses/ServerError"
13922+
}
13923+
},
13924+
"requestBody": {
13925+
"required": true,
13926+
"content": {
13927+
"application/json": {
13928+
"schema": {
13929+
"$ref": "#/components/schemas/IncidentTriggerSubscriptionUpsertRequest"
13930+
},
13931+
"example": {
13932+
"source": "ai_sre_automation",
13933+
"consumer": "fc_safari",
13934+
"consumer_ref": "auto_7NnLzY2Qp8xS4kUaV3mR6b",
13935+
"channel_ids": [
13936+
2468013579
13937+
],
13938+
"severities": [
13939+
"Critical",
13940+
"Warning"
13941+
],
13942+
"enabled": true
13943+
}
13944+
}
13945+
}
13946+
}
13947+
}
13948+
},
13949+
"/incident-trigger-subscription/delete": {
13950+
"post": {
13951+
"operationId": "incident-trigger-subscription-write-delete",
13952+
"summary": "Delete incident trigger subscription",
13953+
"description": "Delete an incident trigger subscription for AI SRE automation.",
13954+
"tags": [
13955+
"On-call/Incidents"
13956+
],
13957+
"x-mint": {
13958+
"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- Deletes the subscription identified by `source`, `consumer`, and `consumer_ref`; it does not delete the consumer rule itself.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.",
13959+
"href": "/en/api-reference/on-call/incidents/incident-trigger-subscription-write-delete",
13960+
"metadata": {
13961+
"sidebarTitle": "Delete incident trigger subscription"
13962+
}
13963+
},
13964+
"responses": {
13965+
"200": {
13966+
"description": "Success",
13967+
"content": {
13968+
"application/json": {
13969+
"schema": {
13970+
"allOf": [
13971+
{
13972+
"$ref": "#/components/schemas/SuccessEnvelope"
13973+
},
13974+
{
13975+
"type": "object",
13976+
"properties": {
13977+
"data": {
13978+
"$ref": "#/components/schemas/EmptyResponse"
13979+
}
13980+
}
13981+
}
13982+
]
13983+
},
13984+
"example": {
13985+
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
13986+
"data": {}
13987+
}
13988+
}
13989+
}
13990+
},
13991+
"400": {
13992+
"$ref": "#/components/responses/BadRequest"
13993+
},
13994+
"401": {
13995+
"$ref": "#/components/responses/Unauthorized"
13996+
},
13997+
"429": {
13998+
"$ref": "#/components/responses/TooManyRequests"
13999+
},
14000+
"500": {
14001+
"$ref": "#/components/responses/ServerError"
14002+
}
14003+
},
14004+
"requestBody": {
14005+
"required": true,
14006+
"content": {
14007+
"application/json": {
14008+
"schema": {
14009+
"$ref": "#/components/schemas/IncidentTriggerSubscriptionDeleteRequest"
14010+
},
14011+
"example": {
14012+
"source": "ai_sre_automation",
14013+
"consumer": "fc_safari",
14014+
"consumer_ref": "auto_7NnLzY2Qp8xS4kUaV3mR6b"
14015+
}
14016+
}
14017+
}
14018+
}
14019+
}
14020+
},
1385014021
"/template/preview": {
1385114022
"post": {
1385214023
"operationId": "template-read-preview",
@@ -28952,6 +29123,175 @@
2895229123
"description": "ID of the created or updated template."
2895329124
}
2895429125
}
29126+
},
29127+
"IncidentTriggerSubscriptionUpsertRequest": {
29128+
"type": "object",
29129+
"description": "Create or update an incident trigger subscription.",
29130+
"properties": {
29131+
"subscription_id": {
29132+
"type": "string",
29133+
"description": "Existing subscription ID. Omit to create or upsert by source, consumer, and consumer_ref."
29134+
},
29135+
"source": {
29136+
"type": "string",
29137+
"description": "Subscription source. Use `ai_sre_automation` for AI SRE automation rules."
29138+
},
29139+
"consumer": {
29140+
"type": "string",
29141+
"description": "Consumer system. Use `fc_safari` for AI SRE automation rules."
29142+
},
29143+
"consumer_ref": {
29144+
"type": "string",
29145+
"description": "Consumer-owned reference, such as an Automation rule ID."
29146+
},
29147+
"channel_ids": {
29148+
"type": "array",
29149+
"minItems": 1,
29150+
"items": {
29151+
"type": "integer",
29152+
"format": "int64"
29153+
},
29154+
"description": "On-call channel IDs whose new incidents should trigger the consumer."
29155+
},
29156+
"severities": {
29157+
"type": "array",
29158+
"minItems": 1,
29159+
"items": {
29160+
"type": "string",
29161+
"enum": [
29162+
"Critical",
29163+
"Warning",
29164+
"Info"
29165+
]
29166+
},
29167+
"description": "Incident severities to subscribe to. `Ok` is not valid."
29168+
},
29169+
"enabled": {
29170+
"type": "boolean",
29171+
"description": "Whether the subscription is enabled. Defaults to true when omitted."
29172+
}
29173+
},
29174+
"required": [
29175+
"source",
29176+
"consumer",
29177+
"consumer_ref",
29178+
"channel_ids",
29179+
"severities"
29180+
]
29181+
},
29182+
"IncidentTriggerSubscriptionDeleteRequest": {
29183+
"type": "object",
29184+
"description": "Delete an incident trigger subscription by consumer reference.",
29185+
"properties": {
29186+
"source": {
29187+
"type": "string",
29188+
"description": "Subscription source."
29189+
},
29190+
"consumer": {
29191+
"type": "string",
29192+
"description": "Consumer system."
29193+
},
29194+
"consumer_ref": {
29195+
"type": "string",
29196+
"description": "Consumer-owned reference, such as an Automation rule ID."
29197+
}
29198+
},
29199+
"required": [
29200+
"source",
29201+
"consumer",
29202+
"consumer_ref"
29203+
]
29204+
},
29205+
"IncidentTriggerSubscription": {
29206+
"type": "object",
29207+
"description": "Incident trigger subscription stored by On-call.",
29208+
"properties": {
29209+
"subscription_id": {
29210+
"type": "string",
29211+
"description": "Subscription ID."
29212+
},
29213+
"account_id": {
29214+
"type": "integer",
29215+
"format": "int64",
29216+
"description": "Account ID."
29217+
},
29218+
"source": {
29219+
"type": "string",
29220+
"description": "Subscription source."
29221+
},
29222+
"consumer": {
29223+
"type": "string",
29224+
"description": "Consumer system."
29225+
},
29226+
"consumer_ref": {
29227+
"type": "string",
29228+
"description": "Consumer-owned reference."
29229+
},
29230+
"channel_ids": {
29231+
"type": "array",
29232+
"items": {
29233+
"type": "integer",
29234+
"format": "int64"
29235+
},
29236+
"description": "Subscribed channel IDs."
29237+
},
29238+
"severities": {
29239+
"type": "array",
29240+
"items": {
29241+
"type": "string",
29242+
"enum": [
29243+
"Critical",
29244+
"Warning",
29245+
"Info"
29246+
]
29247+
},
29248+
"description": "Subscribed incident severities."
29249+
},
29250+
"enabled": {
29251+
"type": "boolean",
29252+
"description": "Whether the subscription is enabled."
29253+
},
29254+
"created_by": {
29255+
"type": "integer",
29256+
"format": "int64",
29257+
"description": "Member ID that created the subscription."
29258+
},
29259+
"updated_by": {
29260+
"type": "integer",
29261+
"format": "int64",
29262+
"description": "Member ID that last updated the subscription."
29263+
},
29264+
"created_at": {
29265+
"type": "integer",
29266+
"format": "int64",
29267+
"description": "Unix timestamp in seconds when the subscription was created."
29268+
},
29269+
"updated_at": {
29270+
"type": "integer",
29271+
"format": "int64",
29272+
"description": "Unix timestamp in seconds when the subscription was last updated."
29273+
},
29274+
"deleted_at": {
29275+
"type": "integer",
29276+
"format": "int64",
29277+
"description": "Unix timestamp in seconds when the subscription was deleted; 0 means active."
29278+
}
29279+
},
29280+
"required": [
29281+
"subscription_id",
29282+
"account_id",
29283+
"source",
29284+
"consumer",
29285+
"consumer_ref",
29286+
"channel_ids",
29287+
"severities",
29288+
"enabled",
29289+
"created_by",
29290+
"updated_by",
29291+
"created_at",
29292+
"updated_at",
29293+
"deleted_at"
29294+
]
2895529295
}
2895629296
}
2895729297
}

0 commit comments

Comments
 (0)