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

Me API

Self-service endpoints for the signed-in user's own scope preferences; writes are keyed on the verified session identity.

2 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/me/preferences

request access

The CURRENT user's scope preferences (#59).

Keyed on the verified session.user_id; returns nulls when none are set. Self-service (any authenticated user); empty + durable:false with no DB.

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/me/preferences

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
preferred_siteJSON valueRequiredValue of preferred_site returned in the response body.
preferred_environmentJSON valueRequiredValue of preferred_environment 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/me/preferences'

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

{
  "preferred_site": null,
  "preferred_environment": null,
  "durable": false
}

PUT/api/me/preferences

request access

Set the CURRENT user's scope preferences (#59).

Full replace (absent/null/empty clears a field). Keyed on the verified session.user_id — a client cannot write another user's preferences. Self-service; 503 with no DB.

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

PUT https://<your-host>/api/me/preferences

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: UserPreferencesRequest.

NameTypeRequirementDescription
preferred_sitestringOptionalValue of preferred_site in the JSON request body.
preferred_environmentstringOptionalValue of preferred_environment in the JSON request body.

Response

StatusDescriptionBody
200OKValue

200 response body

Structure: Value.

NameTypeRequirementDescription
preferred_siteJSON valueRequiredValue of preferred_site returned in the response body.
preferred_environmentJSON valueRequiredValue of preferred_environment 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 PUT \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '{}' \
  'https://<your-host>/api/me/preferences'

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

{
  "preferred_site": null,
  "preferred_environment": null,
  "durable": false
}
Last updated 2026-07-16 · Generated from the API route registrations.