|
| 1 | +--- |
| 2 | +title: "Embed status widgets" |
| 3 | +description: "Display status page data in your website or app with a badge, banner, or public JSON API" |
| 4 | +--- |
| 5 | + |
| 6 | +Public status pages provide three ways to embed status information: an always-visible status badge, an event-driven status banner, and a status summary API for custom integrations. |
| 7 | + |
| 8 | +In the Flashduty console, go to **Status Pages → select a public page → Widget** to preview a widget and copy the code for the current configuration. |
| 9 | + |
| 10 | +<Note> |
| 11 | +Widgets and the status summary API are available for public status pages only. They do not identify visitors and do not require an APP Key. |
| 12 | +</Note> |
| 13 | + |
| 14 | +## Status badge |
| 15 | + |
| 16 | +The badge always shows the current overall status. It works well in a website footer, help center, or console navigation. You can choose its theme, language, and size. |
| 17 | + |
| 18 | +Paste the script and `<flashduty-status-widget>` element generated by the console into your HTML: |
| 19 | + |
| 20 | +```html |
| 21 | +<script |
| 22 | + async |
| 23 | + src="https://statuspage.flashcat.cloud/status-page-widget/1.0.0/widget.js" |
| 24 | + integrity="sha384-rHeDWu6t1L4HVGFp/l/qBEogwjGqG64sKN2Sy1GzX10y49EOrKISEREQYGS2BBRW" |
| 25 | + crossorigin="anonymous"> |
| 26 | +</script> |
| 27 | + |
| 28 | +<flashduty-status-widget |
| 29 | + page="https://status.example.com" |
| 30 | + type="badge" |
| 31 | + theme="auto" |
| 32 | + locale="en" |
| 33 | + size="medium"> |
| 34 | +</flashduty-status-widget> |
| 35 | +``` |
| 36 | + |
| 37 | +Prefer the complete snippet generated by the console. The script URL is versioned, and its matching `integrity` value remains stable for that version. |
| 38 | + |
| 39 | +## Status banner |
| 40 | + |
| 41 | +The banner actively communicates incidents and maintenance: |
| 42 | + |
| 43 | +- It shows the event title and a details link during an incident or maintenance; it includes the latest public update when available, otherwise the current phase or start time |
| 44 | +- Scheduled maintenance appears automatically during the 24 hours before it starts |
| 45 | +- It takes up no space when there is no active event or upcoming maintenance |
| 46 | +- With multiple incidents, it shows the highest-impact incident first; when there is no incident, it shows the earliest active maintenance and indicates how many others exist |
| 47 | +- If a visitor dismisses an update, it stays hidden for that browser session and appears again when the event is updated |
| 48 | + |
| 49 | +```html |
| 50 | +<script |
| 51 | + async |
| 52 | + src="https://statuspage.flashcat.cloud/status-page-widget/1.0.0/widget.js" |
| 53 | + integrity="sha384-rHeDWu6t1L4HVGFp/l/qBEogwjGqG64sKN2Sy1GzX10y49EOrKISEREQYGS2BBRW" |
| 54 | + crossorigin="anonymous"> |
| 55 | +</script> |
| 56 | + |
| 57 | +<flashduty-status-widget |
| 58 | + page="https://status.example.com" |
| 59 | + type="banner" |
| 60 | + theme="auto" |
| 61 | + locale="en" |
| 62 | + position="top"> |
| 63 | +</flashduty-status-widget> |
| 64 | +``` |
| 65 | + |
| 66 | +## Status summary API |
| 67 | + |
| 68 | +If the built-in widgets do not fit your UI, read the public status summary and build your own component or server-side integration. |
| 69 | + |
| 70 | +```http |
| 71 | +GET {status-page-url}/api/widget/v1/summary.json |
| 72 | +``` |
| 73 | + |
| 74 | +For example: |
| 75 | + |
| 76 | +```bash |
| 77 | +curl 'https://status.example.com/api/widget/v1/summary.json' |
| 78 | +``` |
| 79 | + |
| 80 | +The endpoint is unauthenticated and supports cross-origin reads. `{status-page-url}` can be a custom status page domain or the default URL assigned by Flashduty. |
| 81 | + |
| 82 | +### Example response |
| 83 | + |
| 84 | +```json |
| 85 | +{ |
| 86 | + "schema_version": "1.0", |
| 87 | + "generated_at": "2026-07-14T03:25:35Z", |
| 88 | + "poll_after_seconds": 30, |
| 89 | + "max_stale_seconds": 120, |
| 90 | + "page": { |
| 91 | + "name": "Example Status", |
| 92 | + "url": "https://status.example.com" |
| 93 | + }, |
| 94 | + "overall": { |
| 95 | + "status": "partial_outage" |
| 96 | + }, |
| 97 | + "ongoing_incidents": [ |
| 98 | + { |
| 99 | + "id": "incident-123", |
| 100 | + "title": "Some API requests are failing", |
| 101 | + "phase": "investigating", |
| 102 | + "impact": "partial_outage", |
| 103 | + "started_at": "2026-07-14T03:07:35Z", |
| 104 | + "updated_at": "2026-07-14T03:25:35Z", |
| 105 | + "url": "https://status.example.com/incidents/incident-123", |
| 106 | + "last_update": { |
| 107 | + "at": "2026-07-14T03:25:35Z", |
| 108 | + "message": "We are investigating elevated error rates." |
| 109 | + }, |
| 110 | + "affected_components": [ |
| 111 | + { |
| 112 | + "id": "component-api", |
| 113 | + "name": "Public API", |
| 114 | + "group_name": "Core services", |
| 115 | + "status": "partial_outage" |
| 116 | + } |
| 117 | + ] |
| 118 | + } |
| 119 | + ], |
| 120 | + "in_progress_maintenances": [], |
| 121 | + "scheduled_maintenances": [] |
| 122 | +} |
| 123 | +``` |
| 124 | + |
| 125 | +### Response fields |
| 126 | + |
| 127 | +| Field | Description | |
| 128 | +| --- | --- | |
| 129 | +| `schema_version` | Response schema version, initially `1.0` | |
| 130 | +| `generated_at` | Time when the public status data last changed; remains stable while the snapshot content is unchanged | |
| 131 | +| `page.name` / `page.url` | Public status page name and URL | |
| 132 | +| `overall.status` | Overall status: `operational`, `degraded`, `partial_outage`, `full_outage`, or `maintenance` | |
| 133 | +| `ongoing_incidents` | Incidents currently in progress | |
| 134 | +| `in_progress_maintenances` | Maintenance currently in progress | |
| 135 | +| `scheduled_maintenances` | Scheduled maintenance starting within 72 hours, up to three entries | |
| 136 | +| `id` / `title` / `phase` | Event ID, public title, and current phase | |
| 137 | +| `url` / `updated_at` | Event details URL and last update time | |
| 138 | +| `last_update` | The latest public update, or `null` if no update has been published | |
| 139 | +| `affected_components` | Affected components that are visible on the status page | |
| 140 | +| `poll_after_seconds` | Recommended minimum polling interval | |
| 141 | +| `max_stale_seconds` | Treat the snapshot as stale if it cannot be refreshed within this period | |
| 142 | + |
| 143 | +Incident objects use `started_at` and `impact`. Maintenance objects use `starts_at`, `ends_at`, and `overdue`. A component includes `group_name` only when it belongs to a group. All three event arrays remain present when empty. All timestamps use ISO 8601. |
| 144 | + |
| 145 | +### Caching and errors |
| 146 | + |
| 147 | +- Responses include `Cache-Control` and `ETag`; send `If-None-Match` to receive `304 Not Modified` |
| 148 | +- In a browser, do not poll more frequently than `poll_after_seconds` |
| 149 | +- For high-traffic sites, proxy and cache the response through your own backend |
| 150 | +- The endpoint returns `404` when the page does not exist, is not public, or the deployment does not provide the Widget API |
| 151 | +- It returns `503` when the upstream status data is temporarily unavailable |
| 152 | + |
| 153 | +<Warning> |
| 154 | +Do not use the status summary API as a monitoring or alerting endpoint. It reflects information already published to the public status page and does not replace your internal monitoring system. |
| 155 | +</Warning> |
0 commit comments