From 7fd9161ffaeef4046d669f801289abe2a80d0a4c Mon Sep 17 00:00:00 2001 From: Thally Docs Agent Date: Sun, 16 Aug 2026 19:02:17 +0000 Subject: [PATCH 1/4] docs: update for thallylabs/pulseforge-events#1 --- docs.json | 2 +- src/content/alert-rules.mdx | 143 +++++++++++++++++++++++++++++++++++ src/content/components.mdx | 15 +++- src/content/introduction.mdx | 11 ++- 4 files changed, 166 insertions(+), 5 deletions(-) create mode 100644 src/content/alert-rules.mdx diff --git a/docs.json b/docs.json index 5ea29e8..3e58dc9 100644 --- a/docs.json +++ b/docs.json @@ -31,7 +31,7 @@ }, { "group": "Client surfaces", - "pages": ["components", "customization"] + "pages": ["components", "customization", "alert-rules"] } ] }, diff --git a/src/content/alert-rules.mdx b/src/content/alert-rules.mdx new file mode 100644 index 0000000..920114e --- /dev/null +++ b/src/content/alert-rules.mdx @@ -0,0 +1,143 @@ +--- +title: Alert rules +description: Route incident events to email or webhook destinations with reusable alert rules. +--- + +Alert rules route incident events to email or webhook destinations, decoupling your incident creation logic from notification infrastructure. + +## What are alert rules? + +A rule selects which incident events trigger notifications (e.g., `incident.created` or `incident.resolved`), specifies where to send them (email or webhook), and can include a delivery cooldown to reduce alert fatigue. + +Each rule is independent, reusable, and available through the REST API and typed SDK methods. + +## Create a rule + +Use the SDK to set up a rule that sends new incidents to a webhook: + +```ts +import { createPulseforgeClient } from "@pulseforge/events/sdk"; + +const pulseforge = createPulseforgeClient({ + baseUrl: "https://status.example.com", + token: process.env.PULSEFORGE_TOKEN, +}); + +const rule = await pulseforge.createAlertRule({ + name: "Critical incident webhook", + eventTypes: ["incident.created"], + destination: { + kind: "webhook", + target: "https://alerts.internal.example.com/incidents", + }, + cooldownSeconds: 300, +}); +``` + +## Destination types + +### Email + +Send alerts to a single email address: + +```ts +destination: { + kind: "email", + target: "team@example.com", +} +``` + +### Webhook + +POST a JSON payload to an HTTPS URL. The payload includes the rule ID, event type, and incident details: + +```ts +destination: { + kind: "webhook", + target: "https://alerts.internal.example.com/incidents", +} +``` + +## Manage rules + +### List all rules + +```ts +const rules = await pulseforge.listAlertRules(); +``` + +### Get a specific rule + +```ts +const rule = await pulseforge.getAlertRule(ruleId); +``` + +### Update a rule + +Change the destination, cooldown, or pause delivery without recreating it: + +```ts +await pulseforge.updateAlertRule(ruleId, { + destination: { + kind: "email", + target: "new-team@example.com", + }, + isEnabled: true, +}); +``` + +### Delete a rule + +```ts +await pulseforge.deleteAlertRule(ruleId); +``` + +## Test a rule + +Queue a synthetic event to verify your destination is reachable and properly configured: + +```ts +const result = await pulseforge.testAlertRule(ruleId); +console.log(result.status); // "delivered" or "failed" +``` + +## View delivery history + +Inspect the most recent delivery attempts for a rule: + +```ts +const deliveries = await pulseforge.listAlertDeliveries(ruleId); +deliveries.forEach((d) => { + console.log(`${d.eventType}: ${d.status} at ${d.attemptedAt}`); +}); +``` + +## Embed the alert center + +Display alert rules in your operator dashboard using the `` web component. Register it once in your app: + +```html + +``` + +Then add the component to your page and assign an authenticated client: + +```html + + + +``` + +The component displays the count of configured rules and exposes a `refresh()` method to reload them after mutations. diff --git a/src/content/components.mdx b/src/content/components.mdx index 14aa2e3..c2c95aa 100644 --- a/src/content/components.mdx +++ b/src/content/components.mdx @@ -19,9 +19,22 @@ const pulseforge = createPulseforgeClient({ Omit `token` for calls that only read public status. -## Incident methods +## Status and incidents - `getStatus()` reads public service status. - `createIncident(input)` opens an incident. - `addIncidentUpdate(id, input)` extends its timeline. - `resolveIncident(id)` marks it resolved. + +## Alert rules + +Alert rules route incident events to email or webhook destinations. See +[Alert rules](/alert-rules) for full details and examples. + +- `listAlertRules()` returns all configured rules. +- `getAlertRule(id)` fetches a single rule. +- `createAlertRule(input)` creates a new rule. +- `updateAlertRule(id, input)` modifies a rule. +- `deleteAlertRule(id)` removes a rule. +- `testAlertRule(id)` sends a synthetic event to verify the destination. +- `listAlertDeliveries(id)` shows recent delivery attempts. diff --git a/src/content/introduction.mdx b/src/content/introduction.mdx index 6e7752e..369b43d 100644 --- a/src/content/introduction.mdx +++ b/src/content/introduction.mdx @@ -1,6 +1,8 @@ --- title: Pulseforge Events -description: Publish service status, manage incident timelines, and embed current availability. +description: >- + Publish service status, manage incident timelines, and embed current + availability. mode: home --- @@ -26,6 +28,9 @@ contracts on every surface. Call the Pulseforge API with typed request and response objects. + + Set up rules to send incident events to email or webhook destinations. + Review every status and incident endpoint from the OpenAPI reference. @@ -40,6 +45,6 @@ The status endpoint is public. Incident mutations require a bearer token and should run only from trusted server-side code. - The bundled store is in-memory. Supply durable storage before using - Pulseforge in a production incident workflow. + The bundled store is in-memory. Supply durable storage before using Pulseforge + in a production incident workflow. From 737bf28cf16dd18c0bb5d18aa3a4d1fe99c4bb48 Mon Sep 17 00:00:00 2001 From: Thally Docs Agent Date: Sun, 16 Aug 2026 19:03:22 +0000 Subject: [PATCH 2/4] docs: update for thallylabs/pulseforge-events#1 --- docs.json | 7 +++- src/content/server-setup.mdx | 81 ++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 src/content/server-setup.mdx diff --git a/docs.json b/docs.json index 3e58dc9..24671b0 100644 --- a/docs.json +++ b/docs.json @@ -31,7 +31,12 @@ }, { "group": "Client surfaces", - "pages": ["components", "customization", "alert-rules"] + "pages": [ + "server-setup", + "components", + "customization", + "alert-rules" + ] } ] }, diff --git a/src/content/server-setup.mdx b/src/content/server-setup.mdx new file mode 100644 index 0000000..695bb2c --- /dev/null +++ b/src/content/server-setup.mdx @@ -0,0 +1,81 @@ +--- +title: Server-side setup +description: Create and manage incident state using the Pulseforge store. +--- + +## Create a store + +The `createPulseforgeStore` function initializes in-memory incident and alert rule state. Use it on your backend to manage the complete lifecycle of incidents, updates, and alert routing: + +```ts +import { createPulseforgeStore } from "@pulseforge/events"; + +const store = createPulseforgeStore([ + { id: "api", name: "Events API", status: "operational" }, + { id: "db", name: "Database", status: "operational" }, +]); +``` + +By default, `createPulseforgeStore` initializes one service called "Events API". Pass an array of services to define your status page structure. + +## Incident operations + +### Create an incident + +```ts +const incident = store.createIncident({ + title: "High delivery latency detected", + severity: "degraded", + serviceIds: ["api"], +}); +``` + +### Add timeline updates + +```ts +store.addIncidentUpdate(incident.id, { + message: "Scaling database connections in progress", + status: "investigating", +}); +``` + +### Resolve an incident + +```ts +store.resolveIncident(incident.id); +``` + +## Check system status + +```ts +const status = store.getStatus(); +console.log(status.status); // "operational", "degraded", or "outage" +console.log(status.activeIncidents); // incidents not yet resolved +``` + +## Alert rules + +The store extends the alert rule registry, so you can manage rules through the same interface: + +```ts +const rule = store.createAlertRule({ + name: "Page on critical incidents", + eventTypes: ["incident.opened"], + destination: { + kind: "webhook", + target: "https://alerts.example.com/critical", + }, + cooldownSeconds: 300, +}); + +const allRules = store.listAlertRules(); +const testResult = store.testAlertRule(rule.id); +``` + +See [Alert rules](/alert-rules) for the full reference of rule management methods. + + + The store is in-memory only. Incidents and rules are lost when the process + restarts. For production use, persist store data to a durable backend and + restore it on startup. + From b8c9df0570e3701e42ec33cbba30181c5dde2ec2 Mon Sep 17 00:00:00 2001 From: Thally Docs Agent Date: Sun, 16 Aug 2026 19:04:10 +0000 Subject: [PATCH 3/4] docs: update for thallylabs/pulseforge-events#1 --- docs.json | 1 + src/content/http-server.mdx | 136 +++++++++++++++++++++++++++++++++++ src/content/introduction.mdx | 3 + 3 files changed, 140 insertions(+) create mode 100644 src/content/http-server.mdx diff --git a/docs.json b/docs.json index 24671b0..5bfd16f 100644 --- a/docs.json +++ b/docs.json @@ -32,6 +32,7 @@ { "group": "Client surfaces", "pages": [ + "http-server", "server-setup", "components", "customization", diff --git a/src/content/http-server.mdx b/src/content/http-server.mdx new file mode 100644 index 0000000..293dd8f --- /dev/null +++ b/src/content/http-server.mdx @@ -0,0 +1,136 @@ +--- +title: Deploy the HTTP server +description: Set up the Pulseforge HTTP server to serve the status API and handle incident mutations. +--- + +The `createPulseforgeApp` function creates a fetch-compatible HTTP request handler that serves the complete Pulseforge REST API. Deploy it to any Node.js or edge runtime that supports the Fetch API. + +## Create the handler + +Pass a store and a bearer token to `createPulseforgeApp`: + +```ts +import { createPulseforgeStore, createPulseforgeApp } from "@pulseforge/events"; + +const store = createPulseforgeStore([ + { id: "api", name: "Events API", status: "operational" }, + { id: "db", name: "Database", status: "operational" }, +]); + +const app = createPulseforgeApp({ + store, + token: process.env.PULSEFORGE_TOKEN, +}); + +export default { fetch: app }; +``` + +## Deploy to Node.js + +Use any Node.js HTTP server library. Here's an example with `http`: + +```ts +import { createServer } from "http"; + +const server = createServer(app); +server.listen(3000, () => { + console.log("Pulseforge API listening on http://localhost:3000"); +}); +``` + +Or with a web framework like Express: + +```ts +import express from "express"; + +const expressApp = express(); + +expressApp.all("*", (req, res) => { + const fetchRequest = new Request(`http://localhost:3000${req.url}`, { + method: req.method, + headers: req.headers, + body: req.body ? JSON.stringify(req.body) : undefined, + }); + + app(fetchRequest) + .then((response) => { + res.status(response.status); + response.headers.forEach((value, key) => { + res.setHeader(key, value); + }); + response.text().then((body) => { + res.send(body); + }); + }) + .catch((error) => { + res.status(500).json({ error: "Internal server error" }); + }); +}); + +expressApp.listen(3000); +``` + +## Deploy to Cloudflare Workers + +`createPulseforgeApp` returns a fetch handler compatible with Cloudflare Workers: + +```ts +import { createPulseforgeStore, createPulseforgeApp } from "@pulseforge/events"; + +export const onRequest = createPulseforgeApp({ + store: createPulseforgeStore(), + token: + new URL(import.meta.url).searchParams.get("PULSEFORGE_TOKEN") || + env.PULSEFORGE_TOKEN, +}); +``` + +Store the token in your environment variables and pass it to the handler. + +## Endpoints + +The HTTP server exposes these endpoints: + +### Public status + +- `GET /v1/status` — Read system status and active incidents (no auth required) + +### Incident management + +- `POST /v1/incidents` — Create an incident (requires auth) +- `POST /v1/incidents/:id/updates` — Add a timeline update (requires auth) +- `PATCH /v1/incidents/:id` — Resolve or escalate an incident (requires auth) + +### Alert rules + +- `GET /v1/alert-rules` — List all rules (requires auth) +- `POST /v1/alert-rules` — Create a rule (requires auth) +- `GET /v1/alert-rules/:id` — Fetch a specific rule (requires auth) +- `PATCH /v1/alert-rules/:id` — Update a rule (requires auth) +- `DELETE /v1/alert-rules/:id` — Delete a rule (requires auth) +- `POST /v1/alert-rules/:id/test` — Test a rule delivery (requires auth) +- `GET /v1/alert-rules/:id/deliveries` — List delivery history (requires auth) + +## Authentication + +The public `/v1/status` endpoint requires no token. All other endpoints require a bearer token in the `Authorization` header: + +```bash +curl https://status.example.com/v1/incidents \ + -X POST \ + -H "Authorization: Bearer YOUR_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "title": "Service outage", + "severity": "outage", + "serviceIds": ["api"] + }' +``` + +Use the typed SDK to manage authentication automatically—see [Browser SDK](/components) for details. + +## Next steps + +- Use the [Browser SDK](/components) to call the API from JavaScript +- Set up [alert rules](/alert-rules) to route incident events +- Embed the [status widget](/customization) on customer-facing pages diff --git a/src/content/introduction.mdx b/src/content/introduction.mdx index 369b43d..708abf9 100644 --- a/src/content/introduction.mdx +++ b/src/content/introduction.mdx @@ -22,6 +22,9 @@ a dependency-free status widget. Incident state flows through the same public contracts on every surface. + + Set up the HTTP request handler for your runtime environment. + Create an incident and publish the first timeline update. From c6c10c28b34971c13ebf1d914cb53a8fae0a542f Mon Sep 17 00:00:00 2001 From: kenny-io Date: Sun, 16 Aug 2026 23:07:03 +0400 Subject: [PATCH 4/4] docs: correct Pulseforge 1.1 reference --- openapi.yaml | 87 +++++++++++++++++++++- src/content/alert-rules.mdx | 22 ++++-- src/content/changelog.mdx | 6 ++ src/content/components.mdx | 2 +- src/content/http-server.mdx | 141 ++++++++++++------------------------ 5 files changed, 155 insertions(+), 103 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 54ad4e0..58f9d7a 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1,13 +1,14 @@ openapi: 3.1.0 info: title: Pulseforge Events API - version: 1.0.0 + version: 1.1.0 description: Publish public service status and manage incident timelines. servers: - url: https://status.example.com tags: - name: Status - name: Incidents + - name: Alert rules paths: /v1/status: get: @@ -54,7 +55,91 @@ paths: responses: '200': description: Incident resolved + /v1/alert-rules: + get: + operationId: listAlertRules + tags: [Alert rules] + summary: List alert rules + security: [{ bearerAuth: [] }] + responses: + '200': + description: Every alert rule visible to the token + post: + operationId: createAlertRule + tags: [Alert rules] + summary: Create an alert rule + description: Route selected incident events to an email or HTTPS webhook destination. + security: [{ bearerAuth: [] }] + responses: + '201': + description: Alert rule created and enabled + '400': + description: Invalid destination or cooldown + /v1/alert-rules/{ruleId}: + get: + operationId: getAlertRule + tags: [Alert rules] + summary: Get an alert rule + security: [{ bearerAuth: [] }] + parameters: + - $ref: '#/components/parameters/RuleId' + responses: + '200': + description: Alert rule details + '404': + description: Alert rule not found + patch: + operationId: updateAlertRule + tags: [Alert rules] + summary: Update an alert rule + description: Change routing, pause delivery, or adjust the cooldown. + security: [{ bearerAuth: [] }] + parameters: + - $ref: '#/components/parameters/RuleId' + responses: + '200': + description: Alert rule updated + delete: + operationId: deleteAlertRule + tags: [Alert rules] + summary: Delete an alert rule + security: [{ bearerAuth: [] }] + parameters: + - $ref: '#/components/parameters/RuleId' + responses: + '204': + description: Alert rule deleted + /v1/alert-rules/{ruleId}/test: + post: + operationId: testAlertRule + tags: [Alert rules] + summary: Record a test alert + description: Record a synthetic delivery attempt in the reference store. + security: [{ bearerAuth: [] }] + parameters: + - $ref: '#/components/parameters/RuleId' + responses: + '202': + description: Test delivery accepted + /v1/alert-rules/{ruleId}/deliveries: + get: + operationId: listAlertDeliveries + tags: [Alert rules] + summary: List alert delivery history + security: [{ bearerAuth: [] }] + parameters: + - $ref: '#/components/parameters/RuleId' + responses: + '200': + description: Delivery attempts for the alert rule components: + parameters: + RuleId: + in: path + name: ruleId + required: true + schema: + type: string securitySchemes: bearerAuth: type: http diff --git a/src/content/alert-rules.mdx b/src/content/alert-rules.mdx index 920114e..f35e9ce 100644 --- a/src/content/alert-rules.mdx +++ b/src/content/alert-rules.mdx @@ -7,7 +7,9 @@ Alert rules route incident events to email or webhook destinations, decoupling y ## What are alert rules? -A rule selects which incident events trigger notifications (e.g., `incident.created` or `incident.resolved`), specifies where to send them (email or webhook), and can include a delivery cooldown to reduce alert fatigue. +A rule selects which incident events trigger notifications (for example, +`incident.opened` or `incident.resolved`), specifies where to send them (email +or webhook), and can include a delivery cooldown to reduce alert fatigue. Each rule is independent, reusable, and available through the REST API and typed SDK methods. @@ -25,7 +27,7 @@ const pulseforge = createPulseforgeClient({ const rule = await pulseforge.createAlertRule({ name: "Critical incident webhook", - eventTypes: ["incident.created"], + eventTypes: ["incident.opened"], destination: { kind: "webhook", target: "https://alerts.internal.example.com/incidents", @@ -49,7 +51,7 @@ destination: { ### Webhook -POST a JSON payload to an HTTPS URL. The payload includes the rule ID, event type, and incident details: +Webhook destinations must use HTTPS: ```ts destination: { @@ -94,11 +96,13 @@ await pulseforge.deleteAlertRule(ruleId); ## Test a rule -Queue a synthetic event to verify your destination is reachable and properly configured: +The reference store records a synthetic successful delivery so you can verify +rule configuration and delivery-history handling. A production adapter should +replace this simulation with a real destination check: ```ts const result = await pulseforge.testAlertRule(ruleId); -console.log(result.status); // "delivered" or "failed" +console.log(result.delivery.status); // "delivered" in the reference store ``` ## View delivery history @@ -133,7 +137,7 @@ Then add the component to your page and assign an authenticated client: const client = createPulseforgeClient({ baseUrl: "https://status.example.com", - token: sessionStorage.getItem("token"), + token: operatorSession.accessToken, }); document.getElementById("alerts").client = client; @@ -141,3 +145,9 @@ Then add the component to your page and assign an authenticated client: ``` The component displays the count of configured rules and exposes a `refresh()` method to reload them after mutations. + + + Do not persist an incident-management token in browser storage or expose it + through markup. Supply a short-lived operator credential from your existing + authenticated application session. + diff --git a/src/content/changelog.mdx b/src/content/changelog.mdx index 95f0df6..d5fd201 100644 --- a/src/content/changelog.mdx +++ b/src/content/changelog.mdx @@ -3,6 +3,12 @@ title: Changelog description: Pulseforge Events product and documentation updates. --- +## 1.1.0 — 2026-08-16 + +- Added alert-rule creation, updates, deletion, test delivery, and history. +- Added seven alert-rule operations to the REST API and browser SDK. +- Added the authenticated `pulseforge-alert-center` operator widget. + ## 1.0.0 — 2026-08-16 - Added public status reads and authenticated incident management. diff --git a/src/content/components.mdx b/src/content/components.mdx index c2c95aa..47d3611 100644 --- a/src/content/components.mdx +++ b/src/content/components.mdx @@ -36,5 +36,5 @@ Alert rules route incident events to email or webhook destinations. See - `createAlertRule(input)` creates a new rule. - `updateAlertRule(id, input)` modifies a rule. - `deleteAlertRule(id)` removes a rule. -- `testAlertRule(id)` sends a synthetic event to verify the destination. +- `testAlertRule(id)` records a synthetic delivery in the reference store. - `listAlertDeliveries(id)` shows recent delivery attempts. diff --git a/src/content/http-server.mdx b/src/content/http-server.mdx index 293dd8f..0a938e8 100644 --- a/src/content/http-server.mdx +++ b/src/content/http-server.mdx @@ -1,136 +1,87 @@ --- -title: Deploy the HTTP server -description: Set up the Pulseforge HTTP server to serve the status API and handle incident mutations. +title: Deploy the HTTP handler +description: Serve the Pulseforge API from a runtime that accepts Fetch API requests. --- -The `createPulseforgeApp` function creates a fetch-compatible HTTP request handler that serves the complete Pulseforge REST API. Deploy it to any Node.js or edge runtime that supports the Fetch API. +`createPulseforgeApp` returns a function that accepts a web-standard `Request` +and returns a `Response`. Use it directly in a Fetch-compatible runtime or add +an explicit adapter for your Node.js framework. ## Create the handler -Pass a store and a bearer token to `createPulseforgeApp`: - ```ts -import { createPulseforgeStore, createPulseforgeApp } from "@pulseforge/events"; +import { createPulseforgeApp, createPulseforgeStore } from "@pulseforge/events"; const store = createPulseforgeStore([ { id: "api", name: "Events API", status: "operational" }, - { id: "db", name: "Database", status: "operational" }, + { id: "database", name: "Database", status: "operational" }, ]); const app = createPulseforgeApp({ store, token: process.env.PULSEFORGE_TOKEN, }); - -export default { fetch: app }; ``` -## Deploy to Node.js +Do not pass `app` directly to `node:http.createServer`: Node handlers receive +`IncomingMessage` and `ServerResponse`, not Fetch API request objects. Convert +those values through a tested adapter, or use a runtime with a native Fetch +entry point. -Use any Node.js HTTP server library. Here's an example with `http`: +## Cloudflare Workers -```ts -import { createServer } from "http"; - -const server = createServer(app); -server.listen(3000, () => { - console.log("Pulseforge API listening on http://localhost:3000"); -}); -``` - -Or with a web framework like Express: +Create the handler inside `fetch` so the management token comes from a Worker +secret rather than source code or a URL: ```ts -import express from "express"; - -const expressApp = express(); - -expressApp.all("*", (req, res) => { - const fetchRequest = new Request(`http://localhost:3000${req.url}`, { - method: req.method, - headers: req.headers, - body: req.body ? JSON.stringify(req.body) : undefined, - }); - - app(fetchRequest) - .then((response) => { - res.status(response.status); - response.headers.forEach((value, key) => { - res.setHeader(key, value); - }); - response.text().then((body) => { - res.send(body); - }); - }) - .catch((error) => { - res.status(500).json({ error: "Internal server error" }); - }); -}); +import { createPulseforgeApp, createPulseforgeStore } from "@pulseforge/events"; -expressApp.listen(3000); -``` - -## Deploy to Cloudflare Workers - -`createPulseforgeApp` returns a fetch handler compatible with Cloudflare Workers: +interface Env { + PULSEFORGE_TOKEN: string; +} -```ts -import { createPulseforgeStore, createPulseforgeApp } from "@pulseforge/events"; +export default { + fetch(request: Request, env: Env) { + const app = createPulseforgeApp({ + store: createPulseforgeStore(), + token: env.PULSEFORGE_TOKEN, + }); -export const onRequest = createPulseforgeApp({ - store: createPulseforgeStore(), - token: - new URL(import.meta.url).searchParams.get("PULSEFORGE_TOKEN") || - env.PULSEFORGE_TOKEN, -}); + return app(request); + }, +}; ``` -Store the token in your environment variables and pass it to the handler. +The included store is in-memory and does not provide durable Worker storage. +Use a persistent store adapter before relying on it for production incidents. ## Endpoints -The HTTP server exposes these endpoints: - ### Public status -- `GET /v1/status` — Read system status and active incidents (no auth required) +- `GET /v1/status` — Read service status and active incidents without authentication. ### Incident management -- `POST /v1/incidents` — Create an incident (requires auth) -- `POST /v1/incidents/:id/updates` — Add a timeline update (requires auth) -- `PATCH /v1/incidents/:id` — Resolve or escalate an incident (requires auth) +- `POST /v1/incidents` — Create an incident. +- `POST /v1/incidents/:id/updates` — Add a timeline update. +- `PATCH /v1/incidents/:id/resolve` — Resolve an incident. ### Alert rules -- `GET /v1/alert-rules` — List all rules (requires auth) -- `POST /v1/alert-rules` — Create a rule (requires auth) -- `GET /v1/alert-rules/:id` — Fetch a specific rule (requires auth) -- `PATCH /v1/alert-rules/:id` — Update a rule (requires auth) -- `DELETE /v1/alert-rules/:id` — Delete a rule (requires auth) -- `POST /v1/alert-rules/:id/test` — Test a rule delivery (requires auth) -- `GET /v1/alert-rules/:id/deliveries` — List delivery history (requires auth) - -## Authentication - -The public `/v1/status` endpoint requires no token. All other endpoints require a bearer token in the `Authorization` header: - -```bash -curl https://status.example.com/v1/incidents \ - -X POST \ - -H "Authorization: Bearer YOUR_TOKEN" \ - -H "Content-Type: application/json" \ - -d '{ - "title": "Service outage", - "severity": "outage", - "serviceIds": ["api"] - }' -``` +- `GET /v1/alert-rules` — List rules. +- `POST /v1/alert-rules` — Create a rule. +- `GET /v1/alert-rules/:id` — Fetch a rule. +- `PATCH /v1/alert-rules/:id` — Update a rule. +- `DELETE /v1/alert-rules/:id` — Delete a rule. +- `POST /v1/alert-rules/:id/test` — Record a synthetic delivery test. +- `GET /v1/alert-rules/:id/deliveries` — List delivery history. -Use the typed SDK to manage authentication automatically—see [Browser SDK](/components) for details. +Except for public status, every operation requires: -## Next steps +```http +Authorization: Bearer YOUR_TOKEN +``` -- Use the [Browser SDK](/components) to call the API from JavaScript -- Set up [alert rules](/alert-rules) to route incident events -- Embed the [status widget](/customization) on customer-facing pages +Use the [Browser SDK](/components) to call the same operations with typed input +and output, or review the generated [API reference](/api) for every endpoint.