Skip to main content

Config.yaml API

This page documents the 3 gateway endpoints tagged config.yaml 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
POST/config/field/updateUpdate one general setting
GET/config/listList the general settings and their current values
POST/config/field/deleteReset one general setting to its default

Endpoints​

POST /config/field/update​

Update one general setting

Update one field of the general settings and apply it to the running gateway.

The value is validated against the settings schema, stored in the database and applied without a restart. Fields owned by the config file cannot be changed here. Proxy admin only.

Request body (application/json, schema ConfigFieldUpdate):

FieldTypeRequiredDescription
field_namestringYesField Name
field_valueanyYesField Value
config_type"general_settings"YesConfig Type

Example request:

curl -X POST "http://localhost:4000/config/field/update" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"config_type": "general_settings",
"field_name": "max_parallel_requests",
"field_value": 100
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json ConfigFieldUpdateResponse
400Unknown field, invalid value or no databaseapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key is not a proxy adminapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
config_type"general_settings"YesConfig Type
field_namestringYesField Name
field_valueJsonValueYes
messagestringYesMessage

GET /config/list​

List the general settings and their current values

List every general setting the Admin UI can edit, with its type, description, current value, default and where the value comes from (config file, database, environment or default). Secret values are redacted. Admin roles only.

Parameters:

NameInTypeRequiredDescription
config_typequery"general_settings"Yes

Example request:

curl -X GET "http://localhost:4000/config/list?config_type=string" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json array of ConfigList
400No database is connectedapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key is not a proxy admin or admin viewerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

POST /config/field/delete​

Reset one general setting to its default

Remove the value stored in the database for one general setting, so its default applies again.

The Admin UI calls this when an admin clears a field. The change applies at once on the gateway that served the call and on every other gateway at its next settings sync, and an audit row records the before and after values with secrets redacted. Fields owned by the config file cannot be reset here. Proxy admin only.

Request body (application/json, schema ConfigFieldDelete):

FieldTypeRequiredDescription
config_type"general_settings"YesConfig Type
field_namestringYesField Name

Example request:

curl -X POST "http://localhost:4000/config/field/delete" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"config_type": "general_settings",
"field_name": "user_url_validation"
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json ConfigFieldDeleteResponse
400Unknown field, no general settings stored yet, no database, or the config file owns itapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key is not a proxy adminapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
config_type"general_settings"YesConfig Type
field_namestringYesThe setting that was removed, so its default applies again
messagestringYesMessage