Skip to content

Generate YAML for Smart Monitoring V2



**POST /api/v1/checker/smart_monitor/generate

Overview

Body Request Parameters

Parameter Type Required Description
stream boolean Defaults to true, which returns SSE; false returns synchronous JSON.
prompt string Y
Allow empty string: False
language string
Allowed values: ['zh', 'zh-hant', 'en', 'id', 'ja', 'ko']
checkerUUID string
existingYaml string The current complete YAML, limited to 256 KiB in UTF-8 bytes, consistent with generated results, drafts, and save validation.

Additional Parameter Notes

By default, Copilot POST /runs is invoked via SSE streaming (stream=true), passing through the StreamEvent JSON; the final result is contained in data.response of the terminal state. With stream=false, the synchronous JSON content RunResponse is retained; the monitor is not saved or enabled. When succeeded and result is empty, the upstream response is still retained, and the caller reads the reason from the steps. Failures before the stream is established return an error; an interrupted stream that does not receive a terminal state is considered incomplete. X-Smart-Monitor-Generation-Id is pre-allocated in the streaming response header. A 24-hour draft is generated only when a successful terminal state contains valid YAML; interrupted, failed, or empty results cannot be saved. OpenAPI allows directly submitting valid V2 YAML to create a monitor without calling the generation endpoint. Language and workspace identity are constrained by the server.

Response