Skip to main content

Coordination Redis Settings API

This page documents the 3 gateway endpoints tagged Coordination Redis Settings in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.

MethodPathSummary
GET/coordination_redis/settingsRead the coordination Redis settings
POST/coordination_redis/settingsSave the coordination Redis settings
POST/coordination_redis/settings/testTest a coordination Redis connection

Endpoints​

GET /coordination_redis/settings​

Read the coordination Redis settings

Read the Redis connection the gateway's replicas use to share rate limits, cooldowns and scheduled jobs. Proxy admins and admin viewers may call it. The answer holds the saved values with the password, sentinel password and url redacted, the definition of every setting the Admin UI shows, and where the active values come from. Nothing changes. Docs

Example request:

curl -X GET "http://localhost:4000/coordination_redis/settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The saved values, credentials redacted, with the field definitions and where the values come fromapplication/json CoordinationRedisSettingsResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key is not a proxy admin keyapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
valuesobjectYesCurrent coordination Redis settings, with credentials redacted
fieldsarray of CoordinationRedisSettingsFieldYesList of all configurable coordination Redis settings with metadata
sourceenum: "coordination_redis", "cache_backend", "environment" or nullYesWhere the proxy's coordination Redis comes from; null when it has none

POST /coordination_redis/settings​

Save the coordination Redis settings

Save the Redis connection the gateway's replicas use to share rate limits, cooldowns and scheduled jobs. Only proxy admins may call it, and the gateway needs a database with STORE_MODEL_IN_DB set. Values may be os.environ/VAR references, which are stored as written and resolved at startup. A credential sent back as REDACTED keeps its saved value. The settings are stored in the database and apply at the next restart, and the before and after are written to the audit log with credentials redacted. Docs

Parameters:

NameInTypeRequiredDescription
spanway-changed-byheaderstring or nullNoThe spanway-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability

Request body (application/json, schema CoordinationRedisSettingsRequest):

FieldTypeRequiredDescription
settingsobjectYesCoordination Redis connection params

Example request:

curl -X POST "http://localhost:4000/coordination_redis/settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"settings": {
"host": "redis.internal",
"port": 6379,
"password": "s3cret"
}
}'

Responses:

StatusDescriptionBody
200The settings are stored and take effect at the next restartapplication/json CoordinationRedisUpdateResponse
400A value is not a valid Redis connection parameter or no host, url or sentinel is givenapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key is not a proxy admin keyapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway runs without a databaseapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
messagestringYesWhat changed and that a restart applies it
statusstringYesAlways success, failures are reported as HTTP errors
settingsobjectYesThe saved settings with credentials redacted

POST /coordination_redis/settings/test​

Test a coordination Redis connection

Check that a Redis connection works before saving it. Only proxy admins may call it. The gateway builds a throwaway client from the settings sent, pings it once and reports the result, and nothing is saved or changed. A credential sent back as REDACTED uses the saved value. Docs

Request body (application/json, schema CoordinationRedisSettingsRequest):

FieldTypeRequiredDescription
settingsobjectYesCoordination Redis connection params

Example request:

curl -X POST "http://localhost:4000/coordination_redis/settings/test" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"settings": {
"host": "redis.internal",
"port": 6379,
"password": "s3cret"
}
}'

Responses:

StatusDescriptionBody
200The verdict of one ping with the submitted settings, a failure is a verdict and not an HTTP errorapplication/json CoordinationRedisTestResponse
400A value is not a valid Redis connection parameter or no host, url or sentinel is givenapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key is not a proxy admin keyapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
statusstringYesConnection status: 'healthy' or 'unhealthy'
errorstring or nullNoError message if the connection failed