Open source / Rust / MIT Field guide / indexed
Field guide / Metrics APIReviewable source / main

Metrics API

Metrics budgets (create, update, delete, status) and commitment/consumption readouts.

17 routes

Response metadata: x-api-version, x-request-id, and traceresponse apply to normal routed responses and are omitted from the per-operation header tables below.

GET/api/metrics/budgets

request access

List all defined budgets.

Request-tier read.

Permissions

Access classCredentialScoping
requestAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

GET https://<your-host>/api/metrics/budgets

Path parameters

This operation has no path parameters.

Query parameters

NameTypeRequirementDescription
limitintegerOptionalMaximum number of results requested.
offsetintegerOptionalNumber of results to skip before returning the page.

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

This operation does not accept a request body.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
budgetsJSON valueRequiredValue of budgets returned in the response body.
durablebooleanRequiredValue of durable returned in the response body.
totalJSON valueRequiredTotal number of matching items before the returned page is applied.
limitJSON valueRequiredPage-size limit applied to this response.
offsetJSON valueRequiredNumber of matching items skipped before this response page.

Returns a paginated JSON object with total/limit/offset keys.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request GET \
  --header 'Authorization: Bearer <token>' \
  'https://<your-host>/api/metrics/budgets'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "budgets": null,
  "durable": false,
  "total": null,
  "limit": null,
  "offset": null
}

POST/api/metrics/budgets

execute access

Define a budget threshold on a metric.

Execute-tier. 503 when no database is configured.

Permissions

Access classCredentialScoping
executeAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

POST https://<your-host>/api/metrics/budgets

Path parameters

This operation has no path parameters.

Query parameters

This operation has no query parameters.

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
Content-TypestringRequiredRequired by the resolved Axum Json<T> request extractor; send application/json.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
Idempotency-KeystringOptionalOptional at-most-once retry key for human mutations. When omitted, the idempotency middleware passes the request through without deduplication.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

JSON structure: MetricBudgetCreateRequest.

NameTypeRequirementDescription
metric_keystringRequiredValue of metric_key in the JSON request body.
sitestringOptionalSite code targeted by the request.
environmentstringOptionalEnvironment targeted by the request.
thresholdnumberRequiredValue of threshold in the JSON request body.
comparisonstringOptional"above" (cost/usage cap, default) or "below" (capacity floor).

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
idJSON valueRequiredIdentifier of the returned resource.
createdbooleanRequiredValue of created returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '{"metric_key":"<string>","threshold":0.0}' \
  'https://<your-host>/api/metrics/budgets'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "id": null,
  "created": false
}

GET/api/metrics/budgets/status

request access

Evaluate every ENABLED budget against its metric series, reporting current and projected breaches.

Request-tier read. 503 when no database is configured.

Permissions

Access classCredentialScoping
requestAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

GET https://<your-host>/api/metrics/budgets/status

Path parameters

This operation has no path parameters.

Query parameters

This operation has no query parameters.

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

This operation does not accept a request body.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
budgetsJSON valueRequiredValue of budgets returned in the response body.
breached_countJSON valueRequiredValue of breached_count returned in the response body.
errored_countJSON valueRequiredValue of errored_count returned in the response body.
overall_statusJSON valueRequiredValue of overall_status returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request GET \
  --header 'Authorization: Bearer <token>' \
  'https://<your-host>/api/metrics/budgets/status'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "budgets": null,
  "breached_count": null,
  "errored_count": null,
  "overall_status": null
}

DELETE/api/metrics/budgets/{id}

execute access

Remove a budget definition (swarm #19, CRUD completion).

Execute-tier (same as create). 404 if absent; 503 no DB.

Permissions

Access classCredentialScoping
executeAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

DELETE https://<your-host>/api/metrics/budgets/{id}

Path parameters

NameTypeRequirementDescription
idstringRequiredIdentifier of the target resource in the request path.

Query parameters

This operation has no query parameters.

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
Idempotency-KeystringOptionalOptional at-most-once retry key for human mutations. When omitted, the idempotency middleware passes the request through without deduplication.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

This operation does not accept a request body.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
deletedJSON valueRequiredValue of deleted returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request DELETE \
  --header 'Authorization: Bearer <token>' \
  --header 'Idempotency-Key: <idempotency-key>' \
  'https://<your-host>/api/metrics/budgets/<id>'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "deleted": null
}

PUT/api/metrics/budgets/{id}

execute access

Update a budget's mutable fields (threshold, comparison, enabled); omitted fields are left unchanged (PATCH semantics, swarm #19).

Execute-tier (same as create/delete). 404 if absent; 503 no DB. The identity/scope fields are immutable here — recreate to re-scope.

Permissions

Access classCredentialScoping
executeAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

PUT https://<your-host>/api/metrics/budgets/{id}

Path parameters

NameTypeRequirementDescription
idstringRequiredIdentifier of the target resource in the request path.

Query parameters

This operation has no query parameters.

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
Content-TypestringRequiredRequired by the resolved Axum Json<T> request extractor; send application/json.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
Idempotency-KeystringOptionalOptional at-most-once retry key for human mutations. When omitted, the idempotency middleware passes the request through without deduplication.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

JSON structure: MetricBudgetUpdateRequest.

NameTypeRequirementDescription
thresholdnumberOptionalValue of threshold in the JSON request body.
comparisonstringOptionalValue of comparison in the JSON request body.
enabledbooleanOptionalWhether the requested capability should be enabled.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
updatedJSON valueRequiredValue of updated returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request PUT \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '{}' \
  'https://<your-host>/api/metrics/budgets/<id>'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "updated": null
}

GET/api/metrics/commitment

request access

Model the cost of a reserved/committed capacity level vs pure on-demand for a metric.

metric_key, on_demand_rate, commitment_rate, and committed_units are required; usage defaults to the metric's mean. Request-tier read. 503 when no database is configured.

Permissions

Access classCredentialScoping
requestAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

GET https://<your-host>/api/metrics/commitment

Path parameters

This operation has no path parameters.

Query parameters

NameTypeRequirementDescription
metric_keystringOptionalValue supplied for the metric_key query parameter.
sitestringOptionalSite identifier used to scope or filter the operation.
environmentstringOptionalEnvironment identifier used to scope or filter the operation.
on_demand_ratenumberOptionalValue supplied for the on_demand_rate query parameter.
commitment_ratenumberOptionalValue supplied for the commitment_rate query parameter.
committed_unitsnumberOptionalValue supplied for the committed_units query parameter.
usagenumberOptionalOptional usage override; when absent, the series mean is used.

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

This operation does not accept a request body.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
metric_keyJSON valueRequiredValue of metric_key returned in the response body.
siteJSON valueRequiredValue of site returned in the response body.
environmentJSON valueRequiredValue of environment returned in the response body.
usage_sourceJSON valueRequiredValue of usage_source returned in the response body.
modelJSON valueRequiredValue of model returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request GET \
  --header 'Authorization: Bearer <token>' \
  'https://<your-host>/api/metrics/commitment'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "metric_key": null,
  "site": null,
  "environment": null,
  "usage_source": null,
  "model": null
}

GET/api/metrics/insights

request access

Anomaly + waste detection over one metric series (pure ryuki_engine::metric_anomaly).

metric_key is required; site/ environment scope the (single, coherent) series; z is the anomaly z-threshold; waste_threshold/waste_fraction configure waste detection. Request-tier read. 503 when no database is configured; 500 on a query error (never a falsely-empty result).

Permissions

Access classCredentialScoping
requestAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

GET https://<your-host>/api/metrics/insights

Path parameters

This operation has no path parameters.

Query parameters

NameTypeRequirementDescription
metric_keystringOptionalValue supplied for the metric_key query parameter.
sitestringOptionalSite identifier used to scope or filter the operation.
environmentstringOptionalEnvironment identifier used to scope or filter the operation.
znumberOptionalAnomaly z-score threshold (default 3.0).
waste_thresholdnumberOptionalWaste threshold: samples at or below this count toward waste (default 10.0).
waste_fractionnumberOptionalFraction of samples at/below the threshold to flag waste (default 0.8).

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

This operation does not accept a request body.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
metric_keyJSON valueRequiredValue of metric_key returned in the response body.
siteJSON valueRequiredValue of site returned in the response body.
environmentJSON valueRequiredValue of environment returned in the response body.
sample_countJSON valueRequiredValue of sample_count returned in the response body.
summaryJSON valueRequiredValue of summary returned in the response body.
anomaliesJSON valueRequiredValue of anomalies returned in the response body.
wasteJSON valueRequiredValue of waste returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request GET \
  --header 'Authorization: Bearer <token>' \
  'https://<your-host>/api/metrics/insights'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "metric_key": null,
  "site": null,
  "environment": null,
  "sample_count": null,
  "summary": null,
  "anomalies": null,
  "waste": null
}

POST/api/metrics/insights/generate

execute access

Run detection over a metric series and PERSIST the resulting suggestions into aiops_suggestions (the existing suggestion surface).

Execute-tier (it writes). Each suggestion is deduped: it is skipped when an OPEN (New/Reviewed) suggestion with the same site+title already exists, so repeated calls do not pile up duplicates. Returns the suggestions that were newly persisted. 503 when no database is configured.

Permissions

Access classCredentialScoping
executeAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

POST https://<your-host>/api/metrics/insights/generate

Path parameters

This operation has no path parameters.

Query parameters

NameTypeRequirementDescription
metric_keystringOptionalValue supplied for the metric_key query parameter.
sitestringOptionalSite identifier used to scope or filter the operation.
environmentstringOptionalEnvironment identifier used to scope or filter the operation.
znumberOptionalAnomaly z-score threshold (default 3.0).
waste_thresholdnumberOptionalWaste threshold: samples at or below this count toward waste (default 10.0).
waste_fractionnumberOptionalFraction of samples at/below the threshold to flag waste (default 0.8).

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
Idempotency-KeystringOptionalOptional at-most-once retry key for human mutations. When omitted, the idempotency middleware passes the request through without deduplication.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

This operation does not accept a request body.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
metric_keyJSON valueRequiredValue of metric_key returned in the response body.
siteJSON valueRequiredValue of site returned in the response body.
generatedJSON valueRequiredValue of generated returned in the response body.
persistedJSON valueRequiredValue of persisted returned in the response body.
suggestionsJSON valueRequiredValue of suggestions returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Idempotency-Key: <idempotency-key>' \
  'https://<your-host>/api/metrics/insights/generate'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "metric_key": null,
  "site": null,
  "generated": null,
  "persisted": null,
  "suggestions": null
}

POST/api/metrics/samples

execute access

Record one time-series metric sample.

Execute-tier (operators/collectors push samples). 503 when no database is configured.

Permissions

Access classCredentialScoping
executeAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

POST https://<your-host>/api/metrics/samples

Path parameters

This operation has no path parameters.

Query parameters

This operation has no query parameters.

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
Content-TypestringRequiredRequired by the resolved Axum Json<T> request extractor; send application/json.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
Idempotency-KeystringOptionalOptional at-most-once retry key for human mutations. When omitted, the idempotency middleware passes the request through without deduplication.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

JSON structure: MetricSampleRequest.

NameTypeRequirementDescription
metric_keystringRequiredValue of metric_key in the JSON request body.
sitestringOptionalSite code targeted by the request.
environmentstringOptionalEnvironment targeted by the request.
valuenumberRequiredValue of value in the JSON request body.
observed_atstringOptionalValue of observed_at in the JSON request body.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
idJSON valueRequiredIdentifier of the returned resource.
recordedbooleanRequiredValue of recorded returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '{"metric_key":"<string>","value":0.0}' \
  'https://<your-host>/api/metrics/samples'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "id": null,
  "recorded": false
}

GET/api/metrics/series

request access

Return one metric's ordered series plus a summary, trend, and a linear forecast (pure ryuki_engine::metric_forecast).

metric_key is required; site/environment narrow the scope; horizon (default 3, capped 100) is the number of points to project. Request-tier read (metrics are non-sensitive aggregates). 503 when no database is configured.

Permissions

Access classCredentialScoping
requestAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

GET https://<your-host>/api/metrics/series

Path parameters

This operation has no path parameters.

Query parameters

NameTypeRequirementDescription
metric_keystringOptionalValue supplied for the metric_key query parameter.
sitestringOptionalSite identifier used to scope or filter the operation.
environmentstringOptionalEnvironment identifier used to scope or filter the operation.
horizonintegerOptionalValue supplied for the horizon query parameter.

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

This operation does not accept a request body.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
metric_keyJSON valueRequiredValue of metric_key returned in the response body.
siteJSON valueRequiredValue of site returned in the response body.
environmentJSON valueRequiredValue of environment returned in the response body.
seriesJSON valueRequiredValue of series returned in the response body.
summaryJSON valueRequiredValue of summary returned in the response body.
trendJSON valueRequiredValue of trend returned in the response body.
forecastJSON valueRequiredValue of forecast returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request GET \
  --header 'Authorization: Bearer <token>' \
  'https://<your-host>/api/metrics/series'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "metric_key": null,
  "site": null,
  "environment": null,
  "series": null,
  "summary": null,
  "trend": null,
  "forecast": null
}

GET/api/metrics/series/aggregated

request access

Time-bucketed (hourly/daily/weekly/monthly) MIN/MAX/MEAN/COUNT rollups of a metric series for historical trend analysis.

Mirrors metrics_series's gating + #2 coherent-scope handling. Buckets are NON-EMPTY only (no gap filling); weekly is the ISO-8601 Monday-start week at UTC. request-tier (a metrics read). The scan is bounded to the last limit buckets' worth of time.

Permissions

Access classCredentialScoping
requestAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

GET https://<your-host>/api/metrics/series/aggregated

Path parameters

This operation has no path parameters.

Query parameters

NameTypeRequirementDescription
metric_keystringOptionalValue supplied for the metric_key query parameter.
sitestringOptionalSite identifier used to scope or filter the operation.
environmentstringOptionalEnvironment identifier used to scope or filter the operation.
granularitystringOptionalhourly | daily | weekly | monthly (allowlisted → a Postgres date_trunc field).
limitintegerOptionalMax buckets (default 365, clamped 1..=2000). Also bounds the scan window.

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

This operation does not accept a request body.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
metric_keyJSON valueRequiredValue of metric_key returned in the response body.
granularityJSON valueRequiredValue of granularity returned in the response body.
siteJSON valueRequiredValue of site returned in the response body.
environmentJSON valueRequiredValue of environment returned in the response body.
bucketsJSON valueRequiredValue of buckets returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request GET \
  --header 'Authorization: Bearer <token>' \
  'https://<your-host>/api/metrics/series/aggregated'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "metric_key": null,
  "granularity": null,
  "site": null,
  "environment": null,
  "buckets": null
}

GET/api/metrics/slo

request access

List SLO definitions.

Request-tier read.

Permissions

Access classCredentialScoping
requestAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

GET https://<your-host>/api/metrics/slo

Path parameters

This operation has no path parameters.

Query parameters

This operation has no query parameters.

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

This operation does not accept a request body.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
slosJSON valueRequiredValue of slos returned in the response body.
durablebooleanRequiredValue of durable returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request GET \
  --header 'Authorization: Bearer <token>' \
  'https://<your-host>/api/metrics/slo'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "slos": null,
  "durable": false
}

POST/api/metrics/slo

execute access

Define an SLO.

Execute-tier. 503 when no DB. good_metric_key/total_metric_key MUST be COUNTER-style event-count metrics — the status endpoint SUMs them over the window, which is only meaningful for additive samples (a gauge would produce nonsense compliance).

Permissions

Access classCredentialScoping
executeAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

POST https://<your-host>/api/metrics/slo

Path parameters

This operation has no path parameters.

Query parameters

This operation has no query parameters.

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
Content-TypestringRequiredRequired by the resolved Axum Json<T> request extractor; send application/json.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
Idempotency-KeystringOptionalOptional at-most-once retry key for human mutations. When omitted, the idempotency middleware passes the request through without deduplication.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

JSON structure: SloCreateRequest.

NameTypeRequirementDescription
namestringRequiredClient-supplied name for the resource or operation.
targetnumberRequiredValue of target in the JSON request body.
window_daysintegerOptionalValue of window_days in the JSON request body.
good_metric_keystringRequiredValue of good_metric_key in the JSON request body.
total_metric_keystringRequiredValue of total_metric_key in the JSON request body.
sitestringOptionalSite code targeted by the request.
environmentstringOptionalEnvironment targeted by the request.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
idJSON valueRequiredIdentifier of the returned resource.
createdbooleanRequiredValue of created returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '{"name":"<string>","target":0.0,"good_metric_key":"<string>","total_metric_key":"<string>"}' \
  'https://<your-host>/api/metrics/slo'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "id": null,
  "created": false
}

GET/api/metrics/slo/status

request access

Evaluate every enabled SLO over its window (sum good/total from metric_samples, compute attainment + error-budget burn).

Request-tier. Alerting-safe: the one batch aggregate fails the request loud (never a false compliant), and a window with no events is insufficient-data.

Permissions

Access classCredentialScoping
requestAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

GET https://<your-host>/api/metrics/slo/status

Path parameters

This operation has no path parameters.

Query parameters

This operation has no query parameters.

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

This operation does not accept a request body.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
slosJSON valueRequiredValue of slos returned in the response body.
breached_countJSON valueRequiredValue of breached_count returned in the response body.
errored_countJSON valueRequiredValue of errored_count returned in the response body.
overall_statusJSON valueRequiredValue of overall_status returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request GET \
  --header 'Authorization: Bearer <token>' \
  'https://<your-host>/api/metrics/slo/status'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "slos": null,
  "breached_count": null,
  "errored_count": null,
  "overall_status": null
}

DELETE/api/metrics/slo/{id}

execute access

Remove an SLO definition (swarm #20, CRUD completion).

Execute-tier. 404 if absent; 503 no DB.

Permissions

Access classCredentialScoping
executeAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

DELETE https://<your-host>/api/metrics/slo/{id}

Path parameters

NameTypeRequirementDescription
idstringRequiredIdentifier of the target resource in the request path.

Query parameters

This operation has no query parameters.

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
Idempotency-KeystringOptionalOptional at-most-once retry key for human mutations. When omitted, the idempotency middleware passes the request through without deduplication.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

This operation does not accept a request body.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
deletedJSON valueRequiredValue of deleted returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request DELETE \
  --header 'Authorization: Bearer <token>' \
  --header 'Idempotency-Key: <idempotency-key>' \
  'https://<your-host>/api/metrics/slo/<id>'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "deleted": null
}

PUT/api/metrics/slo/{id}

execute access

Update an SLO's mutable fields (name, target, window_days, enabled); omitted fields are left unchanged (PATCH semantics, swarm #20).

Execute-tier. 404 if absent; 503 no DB. The metric keys and scope are immutable here — recreate to re-target or re-scope.

Permissions

Access classCredentialScoping
executeAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

PUT https://<your-host>/api/metrics/slo/{id}

Path parameters

NameTypeRequirementDescription
idstringRequiredIdentifier of the target resource in the request path.

Query parameters

This operation has no query parameters.

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
Content-TypestringRequiredRequired by the resolved Axum Json<T> request extractor; send application/json.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
Idempotency-KeystringOptionalOptional at-most-once retry key for human mutations. When omitted, the idempotency middleware passes the request through without deduplication.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

JSON structure: SloUpdateRequest.

NameTypeRequirementDescription
namestringOptionalClient-supplied name for the resource or operation.
targetnumberOptionalValue of target in the JSON request body.
window_daysintegerOptionalValue of window_days in the JSON request body.
enabledbooleanOptionalWhether the requested capability should be enabled.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
updatedJSON valueRequiredValue of updated returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request PUT \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '{}' \
  'https://<your-host>/api/metrics/slo/<id>'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "updated": null
}

GET/api/metrics/what-if

request access

Project a metric forward under a hypothetical growth factor and report whether/when it would breach a capacity/cost ceiling (pure ryuki_engine::metric_planning).

metric_key and ceiling are required. Request-tier read. 503 when no database is configured; 500 on a query error.

Permissions

Access classCredentialScoping
requestAn authenticated session or API bearer token is required.The access class is enforced first; site and environment scopes narrow resources on scoped operations.

HTTP request

GET https://<your-host>/api/metrics/what-if

Path parameters

This operation has no path parameters.

Query parameters

NameTypeRequirementDescription
metric_keystringOptionalValue supplied for the metric_key query parameter.
sitestringOptionalSite identifier used to scope or filter the operation.
environmentstringOptionalEnvironment identifier used to scope or filter the operation.
horizonintegerOptionalPeriods to project forward (default 6, capped 100).
growthnumberOptionalHypothetical load/cost multiplier on the projection (default 1.0).
ceilingnumberOptionalCapacity/cost ceiling to test the projection against (required).

Request headers

NameTypeRequirementDescription
AuthorizationstringOptionalHuman credential alternative: supply one Bearer rys_... session token, ryk_... API token, or validated identity-provider JWT here. Do not combine it with X-Ryuki-Session-Id or the session cookie; conflicting carriers fail closed.
X-Ryuki-Session-IdstringOptionalOpaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request.
traceparentstringOptionalOptional correlation input. When the second dash-separated segment has 32 characters, Ryuki reuses it as the request correlation identifier; this is not full W3C validation.

Request body

This operation does not accept a request body.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
metric_keyJSON valueRequiredValue of metric_key returned in the response body.
siteJSON valueRequiredValue of site returned in the response body.
environmentJSON valueRequiredValue of environment returned in the response body.
ceilingJSON valueRequiredValue of ceiling returned in the response body.
growth_factorJSON valueRequiredValue of growth_factor returned in the response body.
breachesJSON valueRequiredValue of breaches returned in the response body.
first_breach_atJSON valueRequiredValue of first_breach_at returned in the response body.
peak_projectedJSON valueRequiredValue of peak_projected returned in the response body.
headroomJSON valueRequiredValue of headroom returned in the response body.
projectedJSON valueRequiredValue of projected returned in the response body.

Errors

JSON failures use one of the platform error envelopes and include the request correlation metadata when routing reaches the API middleware. See Errors for the exact shapes, authentication failures, retry guidance, and transport-level exceptions.

Examples

Request

curl --silent --show-error --globoff \
  --request GET \
  --header 'Authorization: Bearer <token>' \
  'https://<your-host>/api/metrics/what-if'

Schematic response body

Illustrative shape generated from the extracted field types, not a recorded live response. Values are placeholders; null marks a field whose type could not be resolved.

Success status: 200

{
  "metric_key": null,
  "site": null,
  "environment": null,
  "ceiling": null,
  "growth_factor": null,
  "breaches": null,
  "first_breach_at": null,
  "peak_projected": null,
  "headroom": null,
  "projected": null
}
Last updated 2026-07-16 · Generated from the API route registrations.