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.
| Method | Path | Summary |
|---|---|---|
| POST | /config/field/update | Update one general setting |
| GET | /config/list | List the general settings and their current values |
| POST | /config/field/delete | Reset 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):
| Field | Type | Required | Description |
|---|---|---|---|
field_name | string | Yes | Field Name |
field_value | any | Yes | Field Value |
config_type | "general_settings" | Yes | Config 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:
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | application/json ConfigFieldUpdateResponse |
| 400 | Unknown field, invalid value or no database | application/json ErrorDetail |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 403 | The key is not a proxy admin | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
config_type | "general_settings" | Yes | Config Type |
field_name | string | Yes | Field Name |
field_value | JsonValue | Yes | |
message | string | Yes | Message |
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:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
config_type | query | "general_settings" | Yes |
Example request:
curl -X GET "http://localhost:4000/config/list?config_type=string" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | application/json array of ConfigList |
| 400 | No database is connected | application/json ErrorDetail |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 403 | The key is not a proxy admin or admin viewer | application/json ErrorDetail |
| 422 | Validation Error | application/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):
| Field | Type | Required | Description |
|---|---|---|---|
config_type | "general_settings" | Yes | Config Type |
field_name | string | Yes | Field 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:
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | application/json ConfigFieldDeleteResponse |
| 400 | Unknown field, no general settings stored yet, no database, or the config file owns it | application/json ErrorDetail |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 403 | The key is not a proxy admin | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
config_type | "general_settings" | Yes | Config Type |
field_name | string | Yes | The setting that was removed, so its default applies again |
message | string | Yes | Message |