User banner and upgrade notice
The user banner is a message a proxy admin publishes once and every dashboard user sees at the top of every page until it is taken down. It is for maintenance windows, policy changes and anything else people must read before they create keys or run requests. The upgrade notice is a second banner the dashboard shows on its own when the release feed reports a newer version than the one running. Both are read with routes any signed in user may call, and only a proxy admin can publish the user banner.
A real-world scenario
The platform team plans a database move for Saturday morning. On Friday the admin opens Admin Settings, chooses the UI Settings tab, turns on Publish user banner, types "Scheduled maintenance on Saturday 06:00 to 07:00 UTC. Requests keep working, the dashboard will be read only." with the Warning severity, checks the preview and presses Save banner. From then on everyone who opens the dashboard sees the yellow banner and can dismiss it for their own browser. On Monday the admin turns Publish user banner off and saves, and the banner is gone for everyone. A week later the dashboard shows the upgrade notice because a newer release was published, and the admin reads its release notes from the link in the notice.
Publish the banner
-
In the Admin UI open Settings, then Admin Settings, and choose the UI Settings tab. The User Banner card sits below the UI settings.
-
Turn on Publish user banner, type the Message in Markdown (up to 4000 characters, links open in a new tab), and pick the Severity, Info, Warning or Error. The Preview shows the banner as users will see it.
-
Press Save banner. The same save over the API is:
curl -X PATCH http://localhost:4000/update/user_banner \-H "Authorization: Bearer $SPANWAY_API_KEY" -H "Content-Type: application/json" \-d '{"enabled": true, "message": "**Scheduled maintenance** on Saturday 06:00 to 07:00 UTC.", "severity": "warning"}'Expected result:
{"message": "User banner updated successfully","banner": {"enabled": true,"message": "**Scheduled maintenance** on Saturday 06:00 to 07:00 UTC.","severity": "warning","revision": "7f3c2a9e4b1d4e8f9a0b1c2d3e4f5a6b"}} -
Open any dashboard page in another browser or as another user. The banner shows under the page header with a Dismiss banner button. Dismissing hides it in that browser only, and every save gets a new
revision, so a changed message comes back for people who dismissed the old one. -
To take the banner down, turn Publish user banner off and press Save banner, or send
{"enabled": false}. To read what is published, call the read route, which any signed in user may use:curl http://localhost:4000/get/user_banner -H "Authorization: Bearer $SPANWAY_API_KEY"
When audit logging is on (store_audit_logs with a license), every save writes an audit log row under the UI settings table, object_id user_banner, with the banner before and after, so you can see who published what. The banner is stored in the database, so a gateway without DATABASE_URL always reports an empty, disabled banner.
The upgrade notice
The dashboard asks GET /get/latest_release_info for the newest stable release and shows the upgrade notice when that version is newer than the running one. The notice names the version, links to its release notes and counts the new features, fixes and other updates. Close hides it in that browser for that release, and the next release brings it back.
The feed is opt-in. Set SPANWAY_RELEASE_CHECK_URL on the gateway to the release feed address given with your preview access. Without it, when SPANWAY_AIRGAPPED is set, or when the feed does not answer within five seconds, the route answers null and the dashboard shows nothing. A successful answer is cached for an hour and a failed fetch for five minutes, so the feed is never hammered.
To host your own feed, serve one JSON object for the newest release with three fields: tag_name, the version such as v2.0.1, html_url, the page the notice links to, such as your copy of the release notes, and body, the notes as Markdown. The notice counts the lines of body that start with * feat: as new features, * fix: as fixes, and other * bullets as other updates, so write one bullet per change:
{"tag_name": "v2.0.1", "html_url": "https://docs.spanway.ai/release_notes", "body": "* feat: per-event email switches\n* fix: readiness answers 503 while the database is stalled"}
curl http://localhost:4000/get/latest_release_info -H "Authorization: Bearer $SPANWAY_API_KEY"
Expected result:
{
"version": "2.1.0",
"new_features": 4,
"bug_fixes": 7,
"other_updates": 2,
"release_url": "https://docs.spanway.ai/release_notes"
}
Compare version with the x-spanway-version header that every model call answer carries (for example from /v1/chat/completions), with spanway_version in the /health/readiness/details answer, or with the image run as docker run --rm registry.spanway.ai/spanway/spanway-ai:2.0.0 --version, to see whether an upgrade is due. The release cycle page explains how to upgrade.
Routes
| Method | Path | Summary |
|---|---|---|
| GET | /get/user_banner | Read the dashboard banner |
| PATCH | /update/user_banner | Publish, change or unpublish the dashboard banner |
| GET | /get/latest_release_info | Latest release the gateway can upgrade to |
Errors
| Status | Route | Meaning | Fix |
|---|---|---|---|
401 Authentication Error, No api key passed in. | all three | The request carried no key or an invalid one. | Send Authorization: Bearer with a valid key. |
401 Authentication Error, Only proxy admin can be used to generate, delete, update info for new keys/users/teams. ... | PATCH /update/user_banner | An internal user tried to publish. The route check stops anyone who is not a proxy admin. | Use a proxy admin key, or ask an admin to publish. |
403 Only proxy admins can update the user banner. | PATCH /update/user_banner | The key may call the route through allowed_routes or a custom role, but is not a proxy admin. | Use a proxy admin key. |
422 {"detail": [{"type": "value_error", "loc": ["body"], "msg": "Value error, message must be non-empty when the banner is enabled"}]} | PATCH /update/user_banner | enabled is true with an empty message. The Admin UI disables Save banner in this case and shows "Add a message before publishing.". | Add a message or turn publishing off. |
422 {"detail": [{"type": "string_too_long", "loc": ["body", "message"], "msg": "String should have at most 4000 characters"}]} | PATCH /update/user_banner | The message is longer than 4000 characters. | Shorten the message. |
500 Database not connected. Please connect a database. | PATCH /update/user_banner | The gateway runs without a database, so there is nowhere to store the banner. | Set DATABASE_URL. |
Logs
| Level | Line | Meaning |
|---|---|---|
| DEBUG | Spanway: latest release info unavailable: release check disabled, SPANWAY_RELEASE_CHECK_URL is unset | No feed is configured, so the upgrade notice is off. Normal unless you expected the notice. |
| DEBUG | Spanway: latest release info unavailable: release check skipped, SPANWAY_AIRGAPPED is set | The gateway is air-gapped and never calls the feed. Normal. |
| DEBUG | Spanway: latest release info unavailable: release feed responded with status 503 or ConnectTimeout: ... | The feed did not answer. The dashboard shows no notice and the gateway tries again after five minutes. Check the network path if it persists. |
Related
- Admin Settings page for the UI Settings tab and the User Banner card.
- Home page for every banner the dashboard can show and who sees it.
- Release cycle for versions, tags and the upgrade steps.
- Air-gapped deployments for
SPANWAY_AIRGAPPED. - Audit logs for the rows a banner change writes.