Edit an alert’s rule in a project the authenticated user can write to.
Requires MEMBER role or higher in the project’s workspace (the write
service decides). The patch is validated merged with the stored rule; an
edit to any evaluated field resets the evaluation state, clears an open
page, and re-arms a parked alert — the response reports the first two.
Args:
request (Request): Incoming request (rate-limit plumbing).
response (Response): Outgoing response (rate-limit plumbing).
auth (AccountStampedAuth): Account-scope user auth (session token or
CLI access JWT); its resolved user_id becomes the actor.
alert_id (str): The alert to edit.
payload (UpdateAlertRequest): The project and the rule fields to change.
_live (None): Write-path liveness gate (blocks a revoked JWT session).
Returns:
UpdateAlertResponse: The updated alert, the changed fields, and the
state flags.
Raises:
HTTPException: The write service’s 400/403/404 verbatim, or a 503
when its response is ambiguous.
Body for editing an alert rule (the ten rule fields, all optional).
The write service validates the patch merged with the stored rule; an
edit to any evaluated field resets the evaluation state (and clears an
open page), which the response reports. Status has its own route.
True when the edit voided the evaluation state and made the rule due now (any evaluated field changed, or the alert was resumed)
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"traceroot","colors":{"primary":"#0f172a","light":"#FFFFFF","dark":"#000000"},"logo":{"light":"https://mintcdn.com/tracerootai/w6ZCi-88-jgYww6Q/logo/light.png?fit=max\u0026auto=format\u0026n=w6ZCi-88-jgYww6Q\u0026q=85\u0026s=923b414b9ceb5508b3852e0695a57a7d","dark":"https://mintcdn.com/tracerootai/w6ZCi-88-jgYww6Q/logo/dark.png?fit=max\u0026auto=format\u0026n=w6ZCi-88-jgYww6Q\u0026q=85\u0026s=ef53cb295cc00e48fc76dd371b7e6bbc","href":"https://traceroot.ai"},"favicon":"https://mintcdn.com/tracerootai/spyQTeLHpHTv8unV/logo/favicon.png?fit=max\u0026auto=format\u0026n=spyQTeLHpHTv8unV\u0026q=85\u0026s=5050ccc8990b316a62ef037190ee65e3","navbar":{"links":[{"href":"https://github.com/traceroot-ai/traceroot/tree/main/examples","label":"Examples"},{"href":"https://app.traceroot.ai","label":"traceroot Cloud"},{"icon":"discord","href":"https://discord.gg/TM2m3CtKuC","label":"Discord"}],"primary":{"type":"github","label":"Github","href":"https://github.com/traceroot-ai/traceroot"}},"footer":{"socials":{"github":"https://github.com/traceroot-ai","x":"https://x.com/TraceRootAI","linkedin":"https://www.linkedin.com/company/traceroot-ai","discord":"https://discord.gg/TM2m3CtKuC"}},"search":{},"fonts":{"heading":{"family":"Inter"},"body":{"family":"Inter"}},"integrations":{"posthog":{"apiKey":"phc_X8eeQUsyMb7bk5sw0msmN8ARBxurlVyQxC0uvHVul7C","apiHost":"https://us.i.posthog.com"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"thumbnails":{"appearance":"light","background":"https://mintcdn.com/tracerootai/w6ZCi-88-jgYww6Q/images/og-background.png?fit=max\u0026auto=format\u0026n=w6ZCi-88-jgYww6Q\u0026q=85\u0026s=659b20de18b6b429609af39183e06e79"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"tracerootai","hasAudioNarration":false,"actualSubdomain":"tracerootai","customDomains":["traceroot.ai"],"gitSource":{"type":"github","owner":"traceroot-ai","repo":"traceroot","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aed09b8176e2ff210e31c31","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"default","tag":"API Reference","count":58},{"language":"default","tag":"Endpoints","count":57},{"language":"default","tag":"Documentation","count":36},{"language":"default","tag":"Integrations","count":26},{"language":"default","tag":"Frameworks","count":15},{"language":"default","tag":"Features","count":13},{"language":"default","tag":"Tracing","count":12},{"language":"default","tag":"Offline Eval","count":10},{"language":"default","tag":"Detectors","count":9},{"language":"default","tag":"Alerts","count":8}]},"assistantConfig":{},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/alerts/edit-an-alert-rule","slug":"/api-reference/alerts/edit-an-alert-rule","pageMetadata":{"title":"Edit an alert rule","description":"Edit an alert's rule in a project the authenticated user can write to.\n\nRequires MEMBER role or higher in the project's workspace (the write\nservice decides). The patch is validated merged with the stored rule; an\nedit to any evaluated field resets the evaluation state, clears an open\npage, and re-arms a parked alert — the response reports the first two.\n\nArgs:\n request (Request): Incoming request (rate-limit plumbing).\n response (Response): Outgoing response (rate-limit plumbing).\n auth (AccountStampedAuth): Account-scope user auth (session token or\n CLI access JWT); its resolved ``user_id`` becomes the actor.\n alert_id (str): The alert to edit.\n payload (UpdateAlertRequest): The project and the rule fields to change.\n _live (None): Write-path liveness gate (blocks a revoked JWT session).\n\nReturns:\n UpdateAlertResponse: The updated alert, the changed fields, and the\n state flags.\n\nRaises:\n HTTPException: The write service's 400/403/404 verbatim, or a 503\n when its response is ambiguous.","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /api/v1/public/alerts/{alert_id}","href":"/api-reference/alerts/edit-an-alert-rule","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Edit an alert’s rule in a project the authenticated user can write to.\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"Requires MEMBER role or higher in the project’s workspace (the write\\nservice decides). The patch is validated merged with the stored rule; an\\nedit to any evaluated field resets the evaluation state, clears an open\\npage, and re-arms a parked alert — the response reports the first two.\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Args:\\nrequest (Request): Incoming request (rate-limit plumbing).\\nresponse (Response): Outgoing response (rate-limit plumbing).\\nauth (AccountStampedAuth): Account-scope user auth (session token or\\nCLI access JWT); its resolved \", _jsx(_components.code, {\n children: \"user_id\"\n }), \" becomes the actor.\\nalert_id (str): The alert to edit.\\npayload (UpdateAlertRequest): The project and the rule fields to change.\\n_live (None): Write-path liveness gate (blocks a revoked JWT session).\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"Returns:\\nUpdateAlertResponse: The updated alert, the changed fields, and the\\nstate flags.\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"Raises:\\nHTTPException: The write service’s 400/403/404 verbatim, or a 503\\nwhen its response is ambiguous.\"\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Edit an alert rule","description":"Edit an alert's rule in a project the authenticated user can write to.\n\nRequires MEMBER role or higher in the project's workspace (the write\nservice decides). The patch is validated merged with the stored rule; an\nedit to any evaluated field resets the evaluation state, clears an open\npage, and re-arms a parked alert — the response reports the first two.\n\nArgs:\n request (Request): Incoming request (rate-limit plumbing).\n response (Response): Outgoing response (rate-limit plumbing).\n auth (AccountStampedAuth): Account-scope user auth (session token or\n CLI access JWT); its resolved ``user_id`` becomes the actor.\n alert_id (str): The alert to edit.\n payload (UpdateAlertRequest): The project and the rule fields to change.\n _live (None): Write-path liveness gate (blocks a revoked JWT session).\n\nReturns:\n UpdateAlertResponse: The updated alert, the changed fields, and the\n state flags.\n\nRaises:\n HTTPException: The write service's 400/403/404 verbatim, or a 503\n when its response is ambiguous.","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /api/v1/public/alerts/{alert_id}","href":"/api-reference/alerts/edit-an-alert-rule","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"description":"Edit an alert's rule in a project the authenticated user can write to.\n\nRequires MEMBER role or higher in the project's workspace (the write\nservice decides). The patch is validated merged with the stored rule; an\nedit to any evaluated field resets the evaluation state, clears an open\npage, and re-arms a parked alert — the response reports the first two.\n\nArgs:\n request (Request): Incoming request (rate-limit plumbing).\n response (Response): Outgoing response (rate-limit plumbing).\n auth (AccountStampedAuth): Account-scope user auth (session token or\n CLI access JWT); its resolved ``user_id`` becomes the actor.\n alert_id (str): The alert to edit.\n payload (UpdateAlertRequest): The project and the rule fields to change.\n _live (None): Write-path liveness gate (blocks a revoked JWT session).\n\nReturns:\n UpdateAlertResponse: The updated alert, the changed fields, and the\n state flags.\n\nRaises:\n HTTPException: The write service's 400/403/404 verbatim, or a 503\n when its response is ambiguous.","operationId":"update_alert","parameters":["496ef4f8-654c-4f27-9acc-29fbbaa3a85f"],"requestBody":"42325e96-eafe-4f64-8128-4e41fb7f0bf6","responses":{"200":"db114f23-f3a5-424d-b60f-0e26acfd85ef","400":"ba1e9c3b-85f9-4727-a2c8-72a2f9e9cf3b","401":"ec4d4e52-901b-4b0d-b2fb-efec964dd72b","403":"a4d3d1af-62d3-4a1b-b7b8-4a9f65e4d49c","404":"aa48518a-fd49-4a51-a4dc-89fdb36fcba7","422":"c776e407-4209-4d8b-9458-c7892caf1793","503":"5fb1d675-fde6-4576-b658-abdb318030d6"},"security":["d66bae53-0e61-4576-b6db-46a2c20badf1"],"summary":"Edit an alert rule","tags":["Alerts"],"x-tool":{"description":"Edit an alert's rule: name, view, measure, aggregation, filters, window, threshold_operator, threshold, renotify, no_data_mode. Fields left out are untouched; the patch is validated against the stored rule, so an aggregation edit must fit the stored measure. Any edit to an evaluated field (everything but name) resets the alert's evaluation state and clears any open page — the response reports state_reset and page_cleared, and lists the fields that actually changed. To pause or resume, use set_alert_status instead.","enabled":true,"name":"update_alert","policy":{"approvalClass":"confirm","minRole":"MEMBER","tenancy":"project"}},"method":"patch","type":"path","servers":["8ae2b8ec-5d46-4cd6-b341-439f21217297","44011aa4-1038-4223-aaf9-82d2181cca8b"],"path":"/api/v1/public/alerts/{alert_id}","baseUrlOptions":["https://app.traceroot.ai","{baseUrl}"],"title":"Edit an alert rule","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"496ef4f8-654c-4f27-9acc-29fbbaa3a85f":{"in":"path","name":"alert_id","required":true,"schema":{"title":"Alert Id","type":"string","isRequired":true,"uniqueKey":"","typeLabel":"string"}}},"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"description":"Body for editing an alert rule (the ten rule fields, all optional).\n\nThe write service validates the patch merged with the stored rule; an\nedit to any evaluated field resets the evaluation state (and clears an\nopen page), which the response reports. Status has its own route.","properties":{"project_id":{"title":"Project Id","type":"string","isRequired":true,"uniqueKey":"project_id","typeLabel":"string"},"aggregation":{"enum":["sum","avg","count","max","min","p50","p75","p90","p95","p99","uniq"],"title":"Aggregation","type":"string","uniqueKey":"aggregation","typeLabel":"enum\u003cstring>"},"filters":{"description":"Row predicates the measure is evaluated over","items":{"additionalProperties":false,"description":"A row predicate an alert's measure is evaluated over.","properties":{"field":{"description":"A span field, e.g. model_name or metadata","title":"Field","type":"string","isRequired":true,"uniqueKey":"filters.items.[INDEX].field","typeLabel":"string"},"op":{"enum":["=","contains"],"title":"Op","type":"string","isRequired":true,"uniqueKey":"filters.items.[INDEX].op","typeLabel":"enum\u003cstring>"},"value":{"oneOf":[{"title":"Value","type":"string","isRequired":true,"uniqueKey":"filters.items.[INDEX].value.oneOf.0","typeLabel":"string"},{"title":"Value","type":"number","isRequired":true,"uniqueKey":"filters.items.[INDEX].value.oneOf.1","typeLabel":"number"}],"isRequired":true,"uniqueKey":"filters.items.[INDEX].value","typeLabel":"string | number"},"key":{"description":"The map entry to compare; required for the metadata field","title":"Key","type":"string","uniqueKey":"filters.items.[INDEX].key","typeLabel":"string"}},"required":["field","op","value"],"title":"AlertFilterItemRequest","type":"object","uniqueKey":"filters.items.[INDEX]","typeLabel":"AlertFilterItemRequest · object"},"title":"Filters","type":"array","uniqueKey":"filters","typeLabel":"AlertFilterItemRequest · object[]"},"measure":{"description":"A measure of the view, e.g. latency, cost, count","title":"Measure","type":"string","uniqueKey":"measure","typeLabel":"string"},"name":{"title":"Name","type":"string","uniqueKey":"name","typeLabel":"string"},"no_data_mode":{"description":"What a window that measured nothing means","enum":["HOLD","ZERO","NOTIFY"],"title":"No Data Mode","type":"string","uniqueKey":"no_data_mode","typeLabel":"enum\u003cstring>"},"renotify":{"description":"How often an alert re-notifies while it stays in the alerting state.","properties":{"mode":{"enum":["OFF","EVERY"],"title":"Mode","type":"string","isRequired":true,"uniqueKey":"renotify.mode","typeLabel":"enum\u003cstring>"},"interval_minutes":{"description":"Minutes between repeat notifications; required when mode is EVERY","title":"Interval Minutes","type":"integer","uniqueKey":"renotify.interval_minutes","typeLabel":"integer"}},"required":["mode"],"title":"Renotify","type":"object","uniqueKey":"renotify","typeLabel":"Renotify · object"},"threshold":{"title":"Threshold","type":"number","uniqueKey":"threshold","typeLabel":"number"},"threshold_operator":{"enum":[">",">=","\u003c","\u003c=","=","!="],"title":"Threshold Operator","type":"string","uniqueKey":"threshold_operator","typeLabel":"enum\u003cstring>"},"view":{"const":"SPANS","title":"View","type":"string","uniqueKey":"view","typeLabel":"string"},"window":{"enum":["1m","5m","10m","30m","1h","2h"],"title":"Window","type":"string","uniqueKey":"window","typeLabel":"enum\u003cstring>"}},"required":["project_id"],"title":"UpdateAlertRequest","type":"object","uniqueKey":"","typeLabel":"UpdateAlertRequest · object"},"examples":{"Example":{"title":"Example","value":{"project_id":"\u003cstring>","filters":[{"field":"\u003cstring>","value":"\u003cstring>","key":"\u003cstring>"}],"measure":"\u003cstring>","name":"\u003cstring>","threshold":123,"view":"SPANS"}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"db114f23-f3a5-424d-b60f-0e26acfd85ef":{"content":{"application/json":{"schema":{"description":"The updated alert with its full rule, plus what the edit did to its state.","properties":{"alert":{"description":"One alert with its full rule: the summary plus filters and gap handling.","properties":{"aggregation":{"title":"Aggregation","type":"string","isRequired":true,"uniqueKey":"alert.aggregation","typeLabel":"string"},"alerted_at":{"oneOf":[{"type":"string","title":"Alerted At","format":"date-time","isRequired":true,"uniqueKey":"alert.alerted_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","title":"Alerted At","isRequired":true,"uniqueKey":"alert.alerted_at.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"alert.alerted_at","typeLabel":"string\u003cdate-time> | null"},"create_time":{"format":"date-time","title":"Create Time","type":"string","isRequired":true,"uniqueKey":"alert.create_time","typeLabel":"string\u003cdate-time>"},"creator":{"oneOf":[{"type":"string","title":"Creator","isRequired":true,"uniqueKey":"alert.creator.oneOf.0","typeLabel":"string"},{"type":"null","title":"Creator","isRequired":true,"uniqueKey":"alert.creator.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"alert.creator","typeLabel":"string | null"},"filters":{"items":{"description":"A row predicate an alert's measure is evaluated over.\n\nMirrors the alert filter vocabulary in the frontend core package: ``op``\nis one of the two alert operators, and ``key`` names the map entry on a\nkeyed field (metadata).","properties":{"field":{"title":"Field","type":"string","isRequired":true,"uniqueKey":"alert.filters.items.[INDEX].field","typeLabel":"string"},"op":{"enum":["=","contains"],"title":"Op","type":"string","isRequired":true,"uniqueKey":"alert.filters.items.[INDEX].op","typeLabel":"enum\u003cstring>"},"value":{"oneOf":[{"type":"string","title":"Value","isRequired":true,"uniqueKey":"alert.filters.items.[INDEX].value.oneOf.0","typeLabel":"string"},{"type":"number","title":"Value","isRequired":true,"uniqueKey":"alert.filters.items.[INDEX].value.oneOf.1","typeLabel":"number"}],"isRequired":true,"uniqueKey":"alert.filters.items.[INDEX].value","typeLabel":"string | number"},"key":{"oneOf":[{"type":"string","title":"Key","uniqueKey":"alert.filters.items.[INDEX].key.oneOf.0","typeLabel":"string"},{"type":"null","title":"Key","uniqueKey":"alert.filters.items.[INDEX].key.oneOf.1","typeLabel":"null"}],"uniqueKey":"alert.filters.items.[INDEX].key","typeLabel":"string | null"}},"required":["field","op","value"],"title":"AlertFilterItem","type":"object","uniqueKey":"alert.filters.items.[INDEX]","typeLabel":"AlertFilterItem · object"},"title":"Filters","type":"array","isRequired":true,"uniqueKey":"alert.filters","typeLabel":"AlertFilterItem · object[]"},"id":{"title":"Id","type":"string","isRequired":true,"uniqueKey":"alert.id","typeLabel":"string"},"last_error":{"oneOf":[{"type":"string","title":"Last Error","isRequired":true,"uniqueKey":"alert.last_error.oneOf.0","typeLabel":"string"},{"type":"null","title":"Last Error","isRequired":true,"uniqueKey":"alert.last_error.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"alert.last_error","typeLabel":"string | null"},"last_error_at":{"oneOf":[{"type":"string","title":"Last Error At","format":"date-time","isRequired":true,"uniqueKey":"alert.last_error_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","title":"Last Error At","isRequired":true,"uniqueKey":"alert.last_error_at.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"alert.last_error_at","typeLabel":"string\u003cdate-time> | null"},"last_evaluated_at":{"oneOf":[{"type":"string","title":"Last Evaluated At","format":"date-time","isRequired":true,"uniqueKey":"alert.last_evaluated_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","title":"Last Evaluated At","isRequired":true,"uniqueKey":"alert.last_evaluated_at.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"alert.last_evaluated_at","typeLabel":"string\u003cdate-time> | null"},"last_notify_at":{"oneOf":[{"type":"string","title":"Last Notify At","format":"date-time","isRequired":true,"uniqueKey":"alert.last_notify_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","title":"Last Notify At","isRequired":true,"uniqueKey":"alert.last_notify_at.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"alert.last_notify_at","typeLabel":"string\u003cdate-time> | null"},"last_notify_error":{"oneOf":[{"type":"string","title":"Last Notify Error","isRequired":true,"uniqueKey":"alert.last_notify_error.oneOf.0","typeLabel":"string"},{"type":"null","title":"Last Notify Error","isRequired":true,"uniqueKey":"alert.last_notify_error.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"alert.last_notify_error","typeLabel":"string | null"},"last_notify_status":{"oneOf":[{"type":"string","title":"Last Notify Status","isRequired":true,"uniqueKey":"alert.last_notify_status.oneOf.0","typeLabel":"string"},{"type":"null","title":"Last Notify Status","isRequired":true,"uniqueKey":"alert.last_notify_status.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"alert.last_notify_status","typeLabel":"string | null"},"measure":{"title":"Measure","type":"string","isRequired":true,"uniqueKey":"alert.measure","typeLabel":"string"},"name":{"title":"Name","type":"string","isRequired":true,"uniqueKey":"alert.name","typeLabel":"string"},"no_data_mode":{"title":"No Data Mode","type":"string","isRequired":true,"uniqueKey":"alert.no_data_mode","typeLabel":"string"},"renotify":{"description":"How often an alert re-notifies while it stays in the alerting state.\n\nKept a single-level object rather than a discriminated union, matching\nthe request-side shape. The cross-field rule is enforced by a validator\ninstead, so a contradictory stored rule fails the detail read closed\nrather than passing through half-typed.","properties":{"mode":{"enum":["OFF","EVERY"],"title":"Mode","type":"string","isRequired":true,"uniqueKey":"alert.renotify.mode","typeLabel":"enum\u003cstring>"},"interval_minutes":{"oneOf":[{"type":"integer","title":"Interval Minutes","uniqueKey":"alert.renotify.interval_minutes.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Interval Minutes","uniqueKey":"alert.renotify.interval_minutes.oneOf.1","typeLabel":"null"}],"uniqueKey":"alert.renotify.interval_minutes","typeLabel":"integer | null"}},"required":["mode"],"title":"AlertRenotify","type":"object","isRequired":true,"uniqueKey":"alert.renotify","typeLabel":"AlertRenotify · object"},"severity":{"title":"Severity","type":"string","isRequired":true,"uniqueKey":"alert.severity","typeLabel":"string"},"severity_changed_at":{"oneOf":[{"type":"string","title":"Severity Changed At","format":"date-time","isRequired":true,"uniqueKey":"alert.severity_changed_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","title":"Severity Changed At","isRequired":true,"uniqueKey":"alert.severity_changed_at.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"alert.severity_changed_at","typeLabel":"string\u003cdate-time> | null"},"status":{"title":"Status","type":"string","isRequired":true,"uniqueKey":"alert.status","typeLabel":"string"},"threshold":{"title":"Threshold","type":"number","isRequired":true,"uniqueKey":"alert.threshold","typeLabel":"number"},"threshold_operator":{"title":"Threshold Operator","type":"string","isRequired":true,"uniqueKey":"alert.threshold_operator","typeLabel":"string"},"update_time":{"format":"date-time","title":"Update Time","type":"string","isRequired":true,"uniqueKey":"alert.update_time","typeLabel":"string\u003cdate-time>"},"view":{"title":"View","type":"string","isRequired":true,"uniqueKey":"alert.view","typeLabel":"string"},"window":{"title":"Window","type":"string","isRequired":true,"uniqueKey":"alert.window","typeLabel":"string"}},"required":["id","name","view","measure","aggregation","window","threshold_operator","threshold","status","severity","severity_changed_at","alerted_at","last_evaluated_at","last_error","last_error_at","last_notify_status","last_notify_error","last_notify_at","create_time","update_time","creator","filters","renotify","no_data_mode"],"title":"AlertDetail","type":"object","isRequired":true,"uniqueKey":"alert","typeLabel":"AlertDetail · object"},"changed":{"items":{"type":"string","uniqueKey":"changed.items.[INDEX]","typeLabel":"string"},"title":"Changed","type":"array","isRequired":true,"uniqueKey":"changed","typeLabel":"string[]"},"updated":{"title":"Updated","type":"boolean","isRequired":true,"uniqueKey":"updated","typeLabel":"boolean"},"page_cleared":{"default":false,"description":"True when the alert was firing and the edit discarded that page","title":"Page Cleared","type":"boolean","uniqueKey":"page_cleared","typeLabel":"boolean"},"state_reset":{"default":false,"description":"True when the edit voided the evaluation state and made the rule due now (any evaluated field changed, or the alert was resumed)","title":"State Reset","type":"boolean","uniqueKey":"state_reset","typeLabel":"boolean"}},"required":["updated","changed","alert"],"title":"UpdateAlertResponse","type":"object","uniqueKey":"","typeLabel":"UpdateAlertResponse · object"},"examples":{"Example":{"title":"Example","value":{"alert":{"aggregation":"\u003cstring>","alerted_at":"2023-11-07T05:31:56Z","create_time":"2023-11-07T05:31:56Z","creator":"\u003cstring>","filters":[{"field":"\u003cstring>","op":"=","value":"\u003cstring>","key":"\u003cstring>"}],"id":"\u003cstring>","last_error":"\u003cstring>","last_error_at":"2023-11-07T05:31:56Z","last_evaluated_at":"2023-11-07T05:31:56Z","last_notify_at":"2023-11-07T05:31:56Z","last_notify_error":"\u003cstring>","last_notify_status":"\u003cstring>","measure":"\u003cstring>","name":"\u003cstring>","no_data_mode":"\u003cstring>","renotify":{"mode":"OFF","interval_minutes":123},"severity":"\u003cstring>","severity_changed_at":"2023-11-07T05:31:56Z","status":"\u003cstring>","threshold":123,"threshold_operator":"\u003cstring>","update_time":"2023-11-07T05:31:56Z","view":"\u003cstring>","window":"\u003cstring>"},"changed":["\u003cstring>"],"updated":true,"page_cleared":false,"state_reset":false}}},"exampleType":"generated"}},"description":"Successful Response","exampleType":"generated"},"ba1e9c3b-85f9-4727-a2c8-72a2f9e9cf3b":{"content":{"application/json":{"schema":{"description":"The canonical public error envelope (matches the gateway's normalized shape).","properties":{"detail":{"title":"Detail","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"}},"required":["detail"],"title":"ErrorResponse","type":"object","uniqueKey":"","typeLabel":"ErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"detail":"\u003cstring>"}}},"exampleType":"generated"}},"description":"Invalid request","exampleType":"generated"},"ec4d4e52-901b-4b0d-b2fb-efec964dd72b":{"content":{"application/json":{"schema":{"description":"The canonical public error envelope (matches the gateway's normalized shape).","properties":{"detail":{"title":"Detail","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"}},"required":["detail"],"title":"ErrorResponse","type":"object","uniqueKey":"","typeLabel":"ErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"detail":"\u003cstring>"}}},"exampleType":"generated"}},"description":"Authentication failed or session revoked","exampleType":"generated"},"a4d3d1af-62d3-4a1b-b7b8-4a9f65e4d49c":{"content":{"application/json":{"schema":{"description":"The canonical public error envelope (matches the gateway's normalized shape).","properties":{"detail":{"title":"Detail","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"}},"required":["detail"],"title":"ErrorResponse","type":"object","uniqueKey":"","typeLabel":"ErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"detail":"\u003cstring>"}}},"exampleType":"generated"}},"description":"Insufficient role or wrong credential kind","exampleType":"generated"},"aa48518a-fd49-4a51-a4dc-89fdb36fcba7":{"content":{"application/json":{"schema":{"description":"The canonical public error envelope (matches the gateway's normalized shape).","properties":{"detail":{"title":"Detail","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"}},"required":["detail"],"title":"ErrorResponse","type":"object","uniqueKey":"","typeLabel":"ErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"detail":"\u003cstring>"}}},"exampleType":"generated"}},"description":"Not found","exampleType":"generated"},"c776e407-4209-4d8b-9458-c7892caf1793":{"content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"oneOf":[{"type":"string","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.1","typeLabel":"integer"}],"uniqueKey":"detail.items.[INDEX].loc.items.[INDEX]","typeLabel":"string | integer"},"title":"Location","type":"array","isRequired":true,"uniqueKey":"detail.items.[INDEX].loc","typeLabel":"(string | integer)[]"},"msg":{"title":"Message","type":"string","isRequired":true,"uniqueKey":"detail.items.[INDEX].msg","typeLabel":"string"},"type":{"title":"Error Type","type":"string","isRequired":true,"uniqueKey":"detail.items.[INDEX].type","typeLabel":"string"},"ctx":{"title":"Context","type":"object","uniqueKey":"detail.items.[INDEX].ctx","typeLabel":"Context · object"},"input":{"oneOf":[{"title":"Input"}],"uniqueKey":"detail.items.[INDEX].input","typeLabel":"any"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object","uniqueKey":"detail.items.[INDEX]","typeLabel":"ValidationError · object"},"title":"Detail","type":"array","uniqueKey":"detail","typeLabel":"ValidationError · object[]"}},"title":"HTTPValidationError","type":"object","uniqueKey":"","typeLabel":"HTTPValidationError · object"},"examples":{"Example":{"title":"Example","value":{"detail":[{"loc":["\u003cstring>"],"msg":"\u003cstring>","type":"\u003cstring>","ctx":{},"input":"\u003cunknown>"}]}}},"exampleType":"generated"}},"description":"Validation Error","exampleType":"generated"},"5fb1d675-fde6-4576-b658-abdb318030d6":{"content":{"application/json":{"schema":{"description":"The canonical public error envelope (matches the gateway's normalized shape).","properties":{"detail":{"title":"Detail","type":"string","isRequired":true,"uniqueKey":"detail","typeLabel":"string"}},"required":["detail"],"title":"ErrorResponse","type":"object","uniqueKey":"","typeLabel":"ErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"detail":"\u003cstring>"}}},"exampleType":"generated"}},"description":"Write service unavailable","exampleType":"generated"}},"security":{"d66bae53-0e61-4576-b6db-46a2c20badf1":{"BearerAuth":{"scheme":"bearer","type":"http","scopes":[],"schemeName":"BearerAuth"}}},"servers":{"8ae2b8ec-5d46-4cd6-b341-439f21217297":{"description":"TraceRoot Cloud","url":"https://app.traceroot.ai"},"44011aa4-1038-4223-aaf9-82d2181cca8b":{"description":"Self-hosted","url":"{baseUrl}","variables":{"baseUrl":{"default":"http://localhost:8000","description":"Your TraceRoot backend URL"}}}},"processedSecurityOptions":[{"schemes":[{"scheme":{"scheme":"bearer","type":"http","scopes":[],"schemeName":"BearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuth","name":"Authorization"}],"title":"BearerAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"tracerootai","siteName":"traceroot","title":"Edit an alert rule - traceroot","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-05T22:52:04.330Z","originalFileLocation":"api-reference/alerts/edit-an-alert-rule.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Edit an alert\u0026#x27;s rule in a project the authenticated user can write to. Requires MEMBER role or higher in the project\u0026#x27;s workspace (the write service decides). The patch is validated merged with the stored rule; an edit to any evaluated field resets the evaluation state, clears an open page, and re-arms a parked alert — the response reports the first two. Args: request (Request): Incoming request (rate-limit plumbing). response (Response): Outgoing response (rate-limit plumbing). auth (AccountStampedAuth): Account-scope user auth (session token or CLI access JWT); its resolved user_id becomes the actor. alert_id (str): The alert to edit. payload (UpdateAlertRequest): The project and the rule fields to change. _live (None): Write-path liveness gate (blocks a revoked JWT session). Returns: UpdateAlertResponse: The updated alert, the changed fields, and the state flags. Raises: HTTPException: The write service\u0026#x27;s 400/403/404 verbatim, or a 503 when its response is ambiguous.\">\u003cmeta data-mint-head name=\"application-name\" content=\"traceroot\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/tracerootai/oFGBx2VNS2taHdJt/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/tracerootai/oFGBx2VNS2taHdJt/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/tracerootai/oFGBx2VNS2taHdJt/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/tracerootai/oFGBx2VNS2taHdJt/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/tracerootai/oFGBx2VNS2taHdJt/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/tracerootai/oFGBx2VNS2taHdJt/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/tracerootai/oFGBx2VNS2taHdJt/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/tracerootai/oFGBx2VNS2taHdJt/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/tracerootai/oFGBx2VNS2taHdJt/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Edit an alert rule - traceroot\">\u003cmeta data-mint-head property=\"og:description\" content=\"Edit an alert\u0026#x27;s rule in a project the authenticated user can write to. Requires MEMBER role or higher in the project\u0026#x27;s workspace (the write service decides). The patch is validated merged with the stored rule; an edit to any evaluated field resets the evaluation state, clears an open page, and re-arms a parked alert — the response reports the first two. Args: request (Request): Incoming request (rate-limit plumbing). response (Response): Outgoing response (rate-limit plumbing). auth (AccountStampedAuth): Account-scope user auth (session token or CLI access JWT); its resolved user_id becomes the actor. alert_id (str): The alert to edit. payload (UpdateAlertRequest): The project and the rule fields to change. _live (None): Write-path liveness gate (blocks a revoked JWT session). Returns: UpdateAlertResponse: The updated alert, the changed fields, and the state flags. Raises: HTTPException: The write service\u0026#x27;s 400/403/404 verbatim, or a 503 when its response is ambiguous.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"traceroot\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://traceroot.ai/docs/api-reference/alerts/edit-an-alert-rule\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://tracerootai.mintlify.site/docs/_mintlify/api/og/v2?division=Alerts\u0026amp;title=Edit+an+alert+rule\u0026amp;description=Edit+an+alert%27s+rule+in+a+project+the+authenticated+user+can+write+to.%0A%0ARequires+MEMBER+role+or+higher+in+the+project%27s+workspace+%28the+write%0Aservice+decides%29.+T\u0026amp;theme=d362eef18ac49c168b8bb565\u0026amp;signature=fc0658cc08c06a53912fb67294038051260cdd918b9509c030c747d2518e80db\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Edit an alert rule - traceroot\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Edit an alert\u0026#x27;s rule in a project the authenticated user can write to. Requires MEMBER role or higher in the project\u0026#x27;s workspace (the write service decides). The patch is validated merged with the stored rule; an edit to any evaluated field resets the evaluation state, clears an open page, and re-arms a parked alert — the response reports the first two. Args: request (Request): Incoming request (rate-limit plumbing). response (Response): Outgoing response (rate-limit plumbing). auth (AccountStampedAuth): Account-scope user auth (session token or CLI access JWT); its resolved user_id becomes the actor. alert_id (str): The alert to edit. payload (UpdateAlertRequest): The project and the rule fields to change. _live (None): Write-path liveness gate (blocks a revoked JWT session). Returns: UpdateAlertResponse: The updated alert, the changed fields, and the state flags. Raises: HTTPException: The write service\u0026#x27;s 400/403/404 verbatim, or a 503 when its response is ambiguous.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://tracerootai.mintlify.site/docs/_mintlify/api/og/v2?division=Alerts\u0026amp;title=Edit+an+alert+rule\u0026amp;description=Edit+an+alert%27s+rule+in+a+project+the+authenticated+user+can+write+to.%0A%0ARequires+MEMBER+role+or+higher+in+the+project%27s+workspace+%28the+write%0Aservice+decides%29.+T\u0026amp;theme=d362eef18ac49c168b8bb565\u0026amp;signature=fc0658cc08c06a53912fb67294038051260cdd918b9509c030c747d2518e80db\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/tracerootai/oFGBx2VNS2taHdJt/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"traceroot\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0f172a\">\u003clink data-mint-head rel=\"canonical\" href=\"https://traceroot.ai/docs/api-reference/alerts/edit-an-alert-rule\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api-reference/alerts/edit-an-alert-rule.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://traceroot.ai/#organization\",\"name\":\"traceroot\",\"url\":\"https://traceroot.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/tracerootai/w6ZCi-88-jgYww6Q/logo/light.png?fit=max\u0026auto=format\u0026n=w6ZCi-88-jgYww6Q\u0026q=85\u0026s=923b414b9ceb5508b3852e0695a57a7d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://traceroot.ai/docs#website\",\"name\":\"traceroot\",\"url\":\"https://traceroot.ai/docs\",\"publisher\":{\"@id\":\"https://traceroot.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://traceroot.ai/docs/api-reference/alerts/edit-an-alert-rule#webpage\",\"url\":\"https://traceroot.ai/docs/api-reference/alerts/edit-an-alert-rule\",\"name\":\"Edit an alert rule\",\"description\":\"Edit an alert's rule in a project the authenticated user can write to. Requires MEMBER role or higher in the project's workspace (the write service decides). The patch is validated merged with the stored rule; an edit to any evaluated field resets the evaluation state, clears an open page, and re-arms a parked alert — the response reports the first two. Args: request (Request): Incoming request (rate-limit plumbing). response (Response): Outgoing response (rate-limit plumbing). auth (AccountStampedAuth): Account-scope user auth (session token or CLI access JWT); its resolved user_id becomes the actor. alert_id (str): The alert to edit. payload (UpdateAlertRequest): The project and the rule fields to change. _live (None): Write-path liveness gate (blocks a revoked JWT session). Returns: UpdateAlertResponse: The updated alert, the changed fields, and the state flags. Raises: HTTPException: The write service's 400/403/404 verbatim, or a 503 when its response is ambiguous.\",\"dateModified\":\"2026-11-05T22:52:04.330Z\",\"isPartOf\":{\"@id\":\"https://traceroot.ai/docs#website\"},\"breadcrumb\":{\"@id\":\"https://traceroot.ai/docs/api-reference/alerts/edit-an-alert-rule#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://traceroot.ai/docs/api-reference/alerts/edit-an-alert-rule#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://traceroot.ai/docs/api-reference/alerts/list-alerts\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Alerts\",\"item\":\"https://traceroot.ai/docs/api-reference/alerts/list-alerts\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Edit an alert rule\",\"item\":\"https://traceroot.ai/docs/api-reference/alerts/edit-an-alert-rule\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://traceroot.ai/docs/api-reference/alerts/edit-an-alert-rule#apireference\",\"headline\":\"Edit an alert rule\",\"name\":\"Edit an alert rule\",\"description\":\"Edit an alert's rule in a project the authenticated user can write to. Requires MEMBER role or higher in the project's workspace (the write service decides). The patch is validated merged with the stored rule; an edit to any evaluated field resets the evaluation state, clears an open page, and re-arms a parked alert — the response reports the first two. Args: request (Request): Incoming request (rate-limit plumbing). response (Response): Outgoing response (rate-limit plumbing). auth (AccountStampedAuth): Account-scope user auth (session token or CLI access JWT); its resolved user_id becomes the actor. alert_id (str): The alert to edit. payload (UpdateAlertRequest): The project and the rule fields to change. _live (None): Write-path liveness gate (blocks a revoked JWT session). Returns: UpdateAlertResponse: The updated alert, the changed fields, and the state flags. Raises: HTTPException: The write service's 400/403/404 verbatim, or a 503 when its response is ambiguous.\",\"url\":\"https://traceroot.ai/docs/api-reference/alerts/edit-an-alert-rule\",\"mainEntityOfPage\":{\"@id\":\"https://traceroot.ai/docs/api-reference/alerts/edit-an-alert-rule#webpage\"},\"dateModified\":\"2026-11-05T22:52:04.330Z\",\"publisher\":{\"@id\":\"https://traceroot.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://traceroot.ai/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"traceroot\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"traceroot","nav":{"global":null,"tabs":[{"tab":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/getting-started/introduction"}]},{"tab":"Integrations","icon":"puzzle-piece","pages":[{"title":"Integrations","href":"/integrations/overview"}]},{"tab":"API Reference","icon":"square-code","groups":[{"group":"Overview","pages":[{"title":"Authentication","href":"/api-reference/authentication"}]},{"group":"Endpoints","pages":[{"group":"Alerts","pages":[{"title":"List Alerts","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/alerts","href":"/api-reference/alerts/list-alerts"},{"title":"Create an alert","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /api/v1/public/alerts","href":"/api-reference/alerts/create-an-alert"},{"title":"Get Alert","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/alerts/{alert_id}","href":"/api-reference/alerts/get-alert"},{"title":"Delete an alert","description":"Hard-delete an alert.\n\nRequires MEMBER role or higher in the project's workspace (the write\nservice decides). An outstanding page is discarded, not resolved: the\nresponse reports ``page_cleared`` when one was open.\n\nArgs:\n request (Request): Incoming request (rate-limit plumbing).\n response (Response): Outgoing response (rate-limit plumbing).\n auth (AccountStampedAuth): Account-scope user auth (session token or\n CLI access JWT); its resolved ``user_id`` becomes the actor.\n alert_id (str): The alert to delete.\n project_id (str): The project the alert belongs to.\n reason (str): Why it is being deleted; recorded on the audit row.\n _live (None): Write-path liveness gate (blocks a revoked JWT session).\n\nReturns:\n DeleteAlertResponse: The removed alert and whether a page was cleared.\n\nRaises:\n HTTPException: The write service's 400/403/404 verbatim, or a 503\n when its response is ambiguous.","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /api/v1/public/alerts/{alert_id}","href":"/api-reference/alerts/delete-an-alert"},{"title":"Edit an alert rule","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /api/v1/public/alerts/{alert_id}","href":"/api-reference/alerts/edit-an-alert-rule"},{"title":"Pause or resume an alert","description":"Pause or resume an alert without touching its rule.\n\nRequires MEMBER role or higher in the project's workspace (the write\nservice decides). Pausing keeps the severity it stopped at; resuming is a\ncold start (state reset, due now). Setting the status the alert already\nhas is a 200 with nothing changed.\n\nArgs:\n request (Request): Incoming request (rate-limit plumbing).\n response (Response): Outgoing response (rate-limit plumbing).\n auth (AccountStampedAuth): Account-scope user auth (session token or\n CLI access JWT); its resolved ``user_id`` becomes the actor.\n alert_id (str): The alert to pause or resume.\n payload (AlertStatusRequest): The project and the target status.\n _live (None): Write-path liveness gate (blocks a revoked JWT session).\n\nReturns:\n UpdateAlertResponse: The alert with its new status and the state flags.\n\nRaises:\n HTTPException: The write service's 400/403/404/409 verbatim, or a\n 503 when its response is ambiguous.","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /api/v1/public/alerts/{alert_id}/status","href":"/api-reference/alerts/pause-or-resume-an-alert"}]},{"group":"Dashboards","pages":[{"title":"List Dashboards","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/dashboards","href":"/api-reference/dashboards/list-dashboards"},{"title":"Create a dashboard","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /api/v1/public/dashboards","href":"/api-reference/dashboards/create-a-dashboard"},{"title":"Get Dashboard","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/dashboards/{dashboard_id}","href":"/api-reference/dashboards/get-dashboard"},{"title":"Delete a dashboard","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /api/v1/public/dashboards/{dashboard_id}","href":"/api-reference/dashboards/delete-a-dashboard"},{"title":"Edit a dashboard","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /api/v1/public/dashboards/{dashboard_id}","href":"/api-reference/dashboards/edit-a-dashboard"},{"title":"Get Dashboard Data","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/dashboards/{dashboard_id}/data","href":"/api-reference/dashboards/get-dashboard-data"}]},{"group":"Offline Eval","pages":[{"title":"Read one dataset version and a page of its test cases","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/dataset-versions/{version_id}","href":"/api-reference/offline-eval/read-one-dataset-version-and-a-page-of-its-test-cases"},{"title":"List the project's evaluation datasets","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/datasets","href":"/api-reference/offline-eval/list-the-projects-evaluation-datasets"},{"title":"Read one evaluation dataset","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/datasets/{dataset_id}","href":"/api-reference/offline-eval/read-one-evaluation-dataset"},{"title":"List a dataset's published versions","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/datasets/{dataset_id}/versions","href":"/api-reference/offline-eval/list-a-datasets-published-versions"},{"title":"List the project's evaluation runs","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/evaluation-runs","href":"/api-reference/offline-eval/list-the-projects-evaluation-runs"},{"title":"Register an evaluation run","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /api/v1/public/evaluation-runs","href":"/api-reference/offline-eval/register-an-evaluation-run"},{"title":"Read an evaluation run's summary","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/evaluation-runs/{run_id}","href":"/api-reference/offline-eval/read-an-evaluation-runs-summary"},{"title":"Complete/finalize an evaluation run","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /api/v1/public/evaluation-runs/{run_id}/complete","href":"/api-reference/offline-eval/completefinalize-an-evaluation-run"},{"title":"Upsert one test-case result with scores","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /api/v1/public/evaluation-runs/{run_id}/results","href":"/api-reference/offline-eval/upsert-one-test-case-result-with-scores"},{"title":"List the project's evaluations","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/evaluations","href":"/api-reference/offline-eval/list-the-projects-evaluations"}]},{"group":"Detectors","pages":[{"title":"List Detectors","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/detectors","href":"/api-reference/detectors/list-detectors"},{"title":"Create a detector","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /api/v1/public/detectors","href":"/api-reference/detectors/create-a-detector"},{"title":"List Findings","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/detectors/findings","href":"/api-reference/detectors/list-findings"},{"title":"Get Finding","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/detectors/findings/{finding_id}","href":"/api-reference/detectors/get-finding"},{"title":"Get Finding By Trace","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/detectors/traces/{trace_id}/finding","href":"/api-reference/detectors/get-finding-by-trace"},{"title":"Get Detector","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/detectors/{detector_id}","href":"/api-reference/detectors/get-detector"},{"title":"Delete a detector","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /api/v1/public/detectors/{detector_id}","href":"/api-reference/detectors/delete-a-detector"},{"title":"Edit a detector","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /api/v1/public/detectors/{detector_id}","href":"/api-reference/detectors/edit-a-detector"}]},{"group":"Account","pages":[{"title":"List Projects","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/projects","href":"/api-reference/account/list-projects"},{"title":"Create a project","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /api/v1/public/projects","href":"/api-reference/account/create-a-project"},{"title":"Delete a project","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /api/v1/public/projects/{project_id}","href":"/api-reference/account/delete-a-project"},{"title":"Edit a project","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /api/v1/public/projects/{project_id}","href":"/api-reference/account/edit-a-project"},{"title":"List Workspaces","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/workspaces","href":"/api-reference/account/list-workspaces"},{"title":"Create a workspace","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /api/v1/public/workspaces","href":"/api-reference/account/create-a-workspace"},{"title":"Delete a workspace","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /api/v1/public/workspaces/{workspace_id}","href":"/api-reference/account/delete-a-workspace"},{"title":"Rename a workspace","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /api/v1/public/workspaces/{workspace_id}","href":"/api-reference/account/rename-a-workspace"}]},{"group":"Sessions","pages":[{"title":"List Sessions","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/sessions","href":"/api-reference/sessions/list-sessions"},{"title":"Get Session","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/sessions/{session_id}","href":"/api-reference/sessions/get-session"}]},{"group":"Signals","pages":[{"title":"List Signals","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/signals","href":"/api-reference/signals/list-signals"},{"title":"Get Signal","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/signals/{signal_id}","href":"/api-reference/signals/get-signal"},{"title":"Resolve or reopen a signal","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /api/v1/public/signals/{signal_id}/status","href":"/api-reference/signals/resolve-or-reopen-a-signal"}]},{"group":"SQL","pages":[{"title":"Run Sql","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /api/v1/public/sql","href":"/api-reference/sql/run-sql"},{"title":"Get Sql Schema","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/sql/schema","href":"/api-reference/sql/get-sql-schema"}]},{"group":"Traces","pages":[{"title":"List Traces","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/traces","href":"/api-reference/traces/list-traces"},{"title":"Ingest Traces","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /api/v1/public/traces","href":"/api-reference/traces/ingest-traces"},{"title":"List Trace Filter Values","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/traces/filter-values/{field}","href":"/api-reference/traces/list-trace-filter-values"},{"title":"Get Trace","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/traces/{trace_id}","href":"/api-reference/traces/get-trace"},{"title":"Export Trace","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/traces/{trace_id}/export","href":"/api-reference/traces/export-trace"}]},{"group":"Whoami","pages":[{"title":"Whoami","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/whoami","href":"/api-reference/whoami/whoami"}]},{"group":"Widgets","pages":[{"title":"Create a dashboard widget","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /api/v1/public/widgets","href":"/api-reference/widgets/create-a-dashboard-widget"},{"title":"Run Widget Query","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /api/v1/public/widgets/query","href":"/api-reference/widgets/run-widget-query"},{"title":"Get Widget","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/widgets/{widget_id}","href":"/api-reference/widgets/get-widget"},{"title":"Delete a dashboard widget","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /api/v1/public/widgets/{widget_id}","href":"/api-reference/widgets/delete-a-dashboard-widget"},{"title":"Edit a dashboard widget","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json patch /api/v1/public/widgets/{widget_id}","href":"/api-reference/widgets/edit-a-dashboard-widget"},{"title":"Get Widget Data","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /api/v1/public/widgets/{widget_id}/data","href":"/api-reference/widgets/get-widget-data"}]}]}]}]},"basePath":"","title":"Edit an alert rule - traceroot","buildId":"dpl_BSPUBxEoKhhK7HzXVDPxdPvWx4xc","deploymentId":"dpl_BSPUBxEoKhhK7HzXVDPxdPvWx4xc","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-Do6EtGSl.js","utils-id4tQ6My.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-Byrixac4.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-nakYa3Zl.js","snippetPresets-Bq-pUS7h.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-CujTC_9K.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-FneVUsVu.js","shallow-DY9WpUCz.js","getApiPlaygroundDisplay-Bz8WpPfA.js","CodeSnippet-DgCuJg4G.js","CodeSnippets-Dub9c4T0.js","Page-CePXnjd1.js","getPastedJson-xdI8y2XB.js","icon--yVw5vkr.js","MethodPill-C47t7MdS.js","DuplicateIcon-BzwJ2LeC.js","createIcon-BzggGy84.js","DynamicMarkdown-AlxJK8VR.js","SectionHeading-CMlwFxdK.js","axios-vUo_bRtp.js","Markdown-BNgNrPsi.js","clsx-apD-Q0Oo.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-qmLwQyWY.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Dc4qTkWx.js"]}