UI Theme Settings API
This page documents the 4 gateway endpoints tagged UI Theme 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.
| Method | Path | Summary |
|---|---|---|
| GET | /get/ui_theme_settings | Read the Admin UI logo and favicon |
| PATCH | /update/ui_theme_settings | Change the Admin UI logo and favicon |
| POST | /upload/logo | Upload a logo image for the Admin UI |
| GET | /get/ui_logo/{filename} | Download an uploaded Admin UI logo |
Endpoints
GET /get/ui_theme_settings
Read the Admin UI logo and favicon
Shows the logo and favicon the Admin UI uses: the stored branding, or the UI_LOGO_PATH, UI_LOGO_PATH_DARK
and SPANWAY_FAVICON_URL values when nothing is stored. Anyone may call it without a key, because the sign
in page shows the logo before anyone signs in. It changes nothing.
Docs (https://docs.spanway.ai/docs/admin_ui/ui_theme)
Example request:
curl -X GET "http://localhost:4000/get/ui_theme_settings"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The stored branding, or the UI_LOGO_PATH, UI_LOGO_PATH_DARK and SPANWAY_FAVICON_URL values | application/json UIThemeSettingsResponse |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
values | object | Yes | Values |
field_schema | object | Yes | Field Schema |
PATCH /update/ui_theme_settings
Change the Admin UI logo and favicon
Changes the logo shown at the top of the Admin UI sidebar, its dark mode variant and the browser favicon, for
every user. Each value must be a public http or https URL, or the path an upload through /upload/logo
returned. The branding is saved to the database config, applied at once and written to the audit log. Only
proxy admins may call it, and it needs store_model_in_db.
Docs (https://docs.spanway.ai/docs/admin_ui/ui_theme)
Request body (application/json, schema UIThemeConfig):
| Field | Type | Required | Description |
|---|---|---|---|
logo_url | string or null | No | URL or path to custom logo image. Can be a local file path or HTTP/HTTPS URL |
logo_url_dark | string or null | No | URL or path to a custom logo image for dark mode. Can be a local file path or HTTP/HTTPS URL. Leave unset to reuse logo_url in dark mode |
favicon_url | string or null | No | URL to custom favicon image. Must be an HTTP/HTTPS URL to a .ico, .png, or .svg file |
Example request:
curl -X PATCH "http://localhost:4000/update/ui_theme_settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"logo_url": "https://cdn.example.com/brand/logo.svg",
"logo_url_dark": "https://cdn.example.com/brand/logo-dark.svg",
"favicon_url": "https://cdn.example.com/brand/favicon.ico"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The branding is stored and applied to the running gateway | application/json UIThemeUpdateResponse |
| 400 | A URL is not a public http or https URL with a host | application/json ErrorDetail |
| 401 | No valid key was sent, or the key belongs to someone who is not a proxy admin | application/json ProxyError |
| 403 | The key passed the route check through allowed_routes or a custom role but is not a proxy admin key | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | store_model_in_db is off, so settings cannot be saved. Set store_model_in_db: true in general_settings | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | What changed |
status | string | Yes | Always success, failures are reported as HTTP errors |
theme_config | object | Yes | The logo and favicon URLs as stored |
POST /upload/logo
Upload a logo image for the Admin UI
Uploads a logo image (PNG, JPG, JPEG or SVG, at most 5 MB) as the file form field. The image is stored in
the gateway database, so every instance serves it and it survives restarts. The answer carries the url path
the gateway serves it from, which you then save as logo_url or logo_url_dark through
/update/ui_theme_settings. Every upload writes an audit row with the file name, media type and size. Only
proxy admins may call it.
Docs (https://docs.spanway.ai/docs/admin_ui/ui_theme)
Request body (multipart/form-data, object):
| Field | Type | Required | Description |
|---|---|---|---|
file | string | Yes | A .png, .jpg, .jpeg or .svg image |
Example request:
curl -X POST "http://localhost:4000/upload/logo" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-F file="@file.bin"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The image is stored in the gateway database and can be referenced from the theme settings | application/json LogoUploadResponse |
| 400 | The file is not a .png, .jpg, .jpeg or .svg image, or it is larger than 5 MB | application/json ErrorDetail |
| 401 | No valid key was sent, or the key belongs to someone who is not a proxy admin | application/json ProxyError |
| 403 | The key passed the route check through allowed_routes or a custom role but is not a proxy admin key | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 503 | The gateway has no database to store the logo in, or the write failed | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | What changed |
status | string | Yes | Always success, failures are reported as HTTP errors |
filename | string | Yes | Name the gateway stored the image under |
file_size | integer | Yes | Size of the stored image in bytes |
url | string | Yes | Path the gateway serves the image from, usable as logo_url or logo_url_dark |
GET /get/ui_logo/{filename}
Download an uploaded Admin UI logo
Serves a logo image stored through /upload/logo. Anyone may call it without a key, because the browser
loads the logo before anyone signs in. Only names the upload route generated are served, so nothing else in
the database is reachable.
Docs (https://docs.spanway.ai/docs/admin_ui/ui_theme)
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
filename | path | string | Yes |
Example request:
curl -X GET "http://localhost:4000/get/ui_logo/filename-123"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The image bytes, with its image media type | image/png string |
| 404 | No uploaded logo has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |