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 class | Credential | Scoping |
|---|---|---|
request | An 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
| Name | Type | Requirement | Description |
|---|---|---|---|
Authorization | string | Optional | Human 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-Id | string | Optional | Opaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request. |
traceparent | string | Optional | Optional 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
| Status | Description | Body |
|---|---|---|
200 | OK | Value |
200 response body
Structure: Value.
| Name | Type | Requirement | Description |
|---|---|---|---|
preferred_site | JSON value | Required | Value of preferred_site returned in the response body. |
preferred_environment | JSON value | Required | Value of preferred_environment returned in the response body. |
durable | boolean | Required | Value 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 class | Credential | Scoping |
|---|---|---|
request | An 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
| Name | Type | Requirement | Description |
|---|---|---|---|
Authorization | string | Optional | Human 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-Type | string | Required | Required by the resolved Axum Json<T> request extractor; send application/json. |
X-Ryuki-Session-Id | string | Optional | Opaque rys_... session-token carrier used by the portal for mutations. Administrative session UUIDs cannot authenticate. Supply exactly one credential carrier per request. |
Idempotency-Key | string | Optional | Optional at-most-once retry key for human mutations. When omitted, the idempotency middleware passes the request through without deduplication. |
traceparent | string | Optional | Optional 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.
| Name | Type | Requirement | Description |
|---|---|---|---|
preferred_site | string | Optional | Value of preferred_site in the JSON request body. |
preferred_environment | string | Optional | Value of preferred_environment in the JSON request body. |
Response
| Status | Description | Body |
|---|---|---|
200 | OK | Value |
200 response body
Structure: Value.
| Name | Type | Requirement | Description |
|---|---|---|---|
preferred_site | JSON value | Required | Value of preferred_site returned in the response body. |
preferred_environment | JSON value | Required | Value of preferred_environment returned in the response body. |
durable | boolean | Required | Value 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
}