Endpoints
Rules
GET
/api/v1/organizations/{org_id}/rulesEvery rule in the active org, name-ordered. org_id in the path
resolves the session (see get_org_context's path-param fallback) —
the repository call below is still scoped from org.organization_id,
never the raw path value, matching every other org-scoped route in
this codebase.
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Path Parameters
org_id*Org Id
Format
uuidResponse Body
application/json
application/json
curl -X GET "https://example.com/api/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/rules"{ "items": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "is_enabled": true, "metric": "string", "aggregation": "avg", "condition": "gt", "threshold": 0, "window_seconds": 0, "for_seconds": 0, "keep_firing_for_seconds": 0, "evaluation_interval_seconds": 0, "severity": "info", "group_by": [ "string" ], "labels": { "property1": "string", "property2": "string" }, "annotations": { "property1": "string", "property2": "string" }, "manifest_path": "string", "commit": "string", "condition_type": "metric", "generated_from_objective_id": "de36b18c-de7f-4624-8131-8cdc9b13a9a3", "burn_rate_long_seconds": 0, "burn_rate_short_seconds": 0, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" } ]}GET
/api/v1/organizations/{org_id}/rules/{rule_id}One rule by id, within the active org — 404, never 403, across
tenants, matching RuleRepository.get_by_id's own docstring and
silences.py's precedent. Carries the evaluation config, the current
rule_evaluations state (if any evaluation has run yet), and the
effective per-plan rule-limit context #806 requires.
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Path Parameters
rule_id*Rule Id
Format
uuidorg_id*Org Id
Format
uuidResponse Body
application/json
application/json
curl -X GET "https://example.com/api/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/rules/497f6eca-6276-4993-bfeb-53cbbbba6f08"{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "is_enabled": true, "metric": "string", "aggregation": "avg", "condition": "gt", "threshold": 0, "window_seconds": 0, "for_seconds": 0, "keep_firing_for_seconds": 0, "evaluation_interval_seconds": 0, "severity": "info", "group_by": [ "string" ], "labels": { "property1": "string", "property2": "string" }, "annotations": { "property1": "string", "property2": "string" }, "manifest_path": "string", "commit": "string", "condition_type": "metric", "generated_from_objective_id": "de36b18c-de7f-4624-8131-8cdc9b13a9a3", "burn_rate_long_seconds": 0, "burn_rate_short_seconds": 0, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "filters": { "property1": "string", "property2": "string" }, "plan_limit": { "plan": "string", "current": 0, "limit": 0, "is_unlimited": true }, "evaluation": { "status": "string", "condition_started_at": "2019-08-24T14:15:22Z", "fired_at": "2019-08-24T14:15:22Z", "resolved_at": "2019-08-24T14:15:22Z", "last_value": 0, "last_evaluated_at": "2019-08-24T14:15:22Z", "error_message": "string" }}