API

SafeHazeLLC REST API

Create windows, collect approvals, and list releases from your own tools. All requests use HTTPS and a workspace Bearer token.

Getting Started

Base URL

https://api.safehaze.online/v1

Auth

Authorization: Bearer <token>

Rate limit

120 requests per minute per token

Create an API token in workspace settings. Tokens inherit the permissions of the member who created them. Rotate a token by issuing a new one and revoking the old id.

curl https://api.safehaze.online/v1/windows \
  -H "Authorization: Bearer sh_live_xxx" \
  -H "Accept: application/json"

GET /windows

List change windows in the workspace. Filter by status or service slug.

curl "https://api.safehaze.online/v1/windows?status=open&limit=20" \
  -H "Authorization: Bearer sh_live_xxx"
{
  "data": [
    {
      "id": "win_8k2p",
      "service": "checkout-api",
      "title": "payments-v4 cutover",
      "status": "open",
      "starts_at": "2026-08-14T22:00:00Z",
      "ends_at": "2026-08-14T23:30:00Z",
      "approvals_required": 3,
      "approvals_granted": 2
    }
  ],
  "next_cursor": null
}

GET /windows/:id

Fetch a single window, including approval state and the linked ticket.

curl https://api.safehaze.online/v1/windows/win_8k2p \
  -H "Authorization: Bearer sh_live_xxx"
{
  "id": "win_8k2p",
  "service": "checkout-api",
  "status": "open",
  "ticket": "PAY-1842",
  "hold_reason": null,
  "owner": "usr_mira",
  "approvals": [
    { "role": "product", "state": "granted" },
    { "role": "platform", "state": "granted" },
    { "role": "risk", "state": "pending" }
  ]
}

POST /windows

Create a reserved change window. Conflicting services return HTTP 409 with the overlapping window id.

curl -X POST https://api.safehaze.online/v1/windows \
  -H "Authorization: Bearer sh_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "service": "checkout-api",
    "title": "payments-v4 cutover",
    "starts_at": "2026-08-21T22:00:00Z",
    "ends_at": "2026-08-21T23:30:00Z",
    "ticket": "PAY-1901"
  }'
{
  "id": "win_9m4q",
  "status": "draft",
  "conflict": null
}

POST /windows/:id/approvals

Grant or refuse an approval role. Expired grants are rejected and must be requested again.

curl -X POST https://api.safehaze.online/v1/windows/win_8k2p/approvals \
  -H "Authorization: Bearer sh_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "role": "risk", "state": "granted" }'
{
  "window_id": "win_8k2p",
  "role": "risk",
  "state": "granted",
  "ready_to_open": true
}

GET /releases

List published notes from closed windows. Useful for support boards and status pages you already operate.

curl "https://api.safehaze.online/v1/releases?since=2026-08-01" \
  -H "Authorization: Bearer sh_live_xxx"
{
  "data": [
    {
      "id": "rel_22c",
      "window_id": "win_7h1n",
      "summary": "Checkout retry budget raised to 3",
      "outcome": "success",
      "published_at": "2026-08-07T01:12:00Z"
    }
  ]
}

SDKs

Official clients wrap retries and pagination. They talk to the same Base URL and accept the same Bearer token.

JavaScript

npm install @safehaze/sdk. Works in Node 18+.

Python

pip install safehaze. Typed models for windows and approvals.

Go

module github.com/safehaze/sdk-go for pipeline jobs.

Questions about scopes or webhooks? Write to support@safehaze.online.