API reference
On-call paging as a primitive. Create alerts, wait for a human, watch heartbeats, read who is on call. Everything is JSON over HTTPS.
#Basics
Base URL https://api.treason.app (http://localhost:3100 in development). Send Authorization: Bearer <key>. Bodies and responses are JSON. Each operation below says which key scope it needs. See Errors, limits and conventions for status codes, rate limits, idempotency and pagination, and /openapi.json for the machine-readable description.
curl $TREASON_API_URL/v1/alerts \
-H "Authorization: Bearer $TREASON_API_KEY"Alerts
/v1/alertsalert keyCreate an alert
Accepts an alert, stores it, and starts paging whoever is on call for the team. Answers 202 once the alert is durably stored in two places. A repeat with the same alias while the alert is not closed is de-duplicated: it bumps dedupCount and does not page again. Send an Idempotency-Key header and a retried request returns the original result.
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Makes a retried request return the original result. |
| Field | Type | Description |
|---|---|---|
message* | string | What happened, in a sentence. Kept to 130 characters; longer text is not lost, it is kept in full in the description. |
alias | string | De-duplication key. Without one, every request is a new alert. |
description | string | Up to 15,000 characters. |
entity | string | What it is about: a host, a service, a job. |
source | string | Where it came from. |
priority | "P1" | "P2" | "P3" | "P4" | "P5" | P1 pages now; P4 and P5 only push. |
tags | string[] | |
details | object | Free-form key/value context. |
note | string | Added as a note on the alert. |
user | string | Who to record as the actor. |
teamId | string (uuid) | Which team to page. Optional when the organization has exactly one team. |
curl -X POST $TREASON_API_URL/v1/alerts \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"message":"API error rate above 5%","alias":"api-errors","priority":"P1","tags":["prod"],"source":"grafana"}'const { alert } = await treason.alerts.create({ message: "API error rate above 5%", alias: "api-errors", priority: "P1" });{
"requestId": "a3c1f7e0-0a0d-5b3c-8b43-0a1d3d9c4c2e",
"deduplicated": false,
"alert": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"alias": "api-errors",
"tinyId": 4821,
"status": "open",
"priority": "P1",
"message": "API error rate above 5%",
"description": null,
"entity": null,
"source": "grafana",
"tags": [
"prod"
],
"details": {},
"dedupCount": 1,
"createdAt": "2026-10-11T20:50:04.000Z",
"acknowledgedAt": null,
"closedAt": null,
"acknowledgedVia": null,
"acknowledgedBy": null
}
}Errors: 401403422429
/v1/alertsalert keyList alerts
Newest first. Page with before set to the previous response's next.
| Name | In | Type | Description |
|---|---|---|---|
status | query | "open" | "acknowledged" | "exhausted" | "closed" | "suppressed" | |
alias | query | string | |
limit | query | integer | |
before | query | string (date-time) | Only alerts created before this time. |
curl $TREASON_API_URL/v1/alerts \
-H "Authorization: Bearer $TREASON_API_KEY"const { alerts, next } = await treason.alerts.list({ status: "open", limit: 50 });
// or: for await (const a of treason.alerts.iterate({ status: "open" })) { ... }{
"alerts": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"alias": "string",
"tinyId": 1,
"status": "open",
"priority": "P1",
"message": "string",
"description": "string",
"entity": "string",
"source": "string",
"tags": [
"string"
],
"details": {},
"dedupCount": 1,
"createdAt": "2026-10-11T20:50:04.000Z",
"acknowledgedAt": "2026-10-11T20:50:04.000Z",
"closedAt": "2026-10-11T20:50:04.000Z",
"acknowledgedVia": "string",
"acknowledgedBy": {
"actor": "string",
"userId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"isTest": true,
"suppressedBy": "string",
"snoozedUntil": "2026-10-11T20:50:04.000Z"
}
],
"next": "string"
}Errors: 401403
/v1/alerts/summaryalert keyCount alerts by status
curl $TREASON_API_URL/v1/alerts/summary \
-H "Authorization: Bearer $TREASON_API_KEY"const { counts } = await treason.alerts.summary();{
"counts": {
"open": 1,
"acknowledged": 1,
"exhausted": 1,
"closed": 1,
"suppressed": 1
}
}Errors: 401403
/v1/alerts/{id}alert keyGet an alert, its events and every notification attempt
The event log is append-only. attempts lists every push, text and call we made, with the carrier's answer: the answer to "why did nobody get paged?"
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl $TREASON_API_URL/v1/alerts/:id \
-H "Authorization: Bearer $TREASON_API_KEY"const { alert, events, attempts } = await treason.alerts.get(id);{
"alert": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"alias": "string",
"tinyId": 1,
"status": "open",
"priority": "P1",
"message": "string",
"description": "string",
"entity": "string",
"source": "string",
"tags": [
"string"
],
"details": {},
"dedupCount": 1,
"createdAt": "2026-10-11T20:50:04.000Z",
"acknowledgedAt": "2026-10-11T20:50:04.000Z",
"closedAt": "2026-10-11T20:50:04.000Z",
"acknowledgedVia": "string",
"acknowledgedBy": {
"actor": "string",
"userId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"isTest": true,
"suppressedBy": "string",
"snoozedUntil": "2026-10-11T20:50:04.000Z"
},
"events": [
{
"id": 1,
"type": "string",
"actor": "string",
"payload": {},
"createdAt": "2026-10-11T20:50:04.000Z"
}
],
"attempts": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"userId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"step": 1,
"channel": "push",
"carrier": "string",
"kind": "page",
"status": "string",
"attemptNo": 1,
"costMicros": 1,
"error": "string",
"sentAt": "2026-10-11T20:50:04.000Z",
"deliveredAt": "2026-10-11T20:50:04.000Z",
"createdAt": "2026-10-11T20:50:04.000Z",
"why": {
"kind": "schedule",
"policy": "string",
"step": 1,
"round": 1,
"scheduleId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"scheduleName": "string",
"via": "override",
"teamName": "string",
"routedByRule": true,
"rule": {},
"text": "string"
}
}
]
}Errors: 401403404
/v1/alerts/{id}/ackalert keyAcknowledge an alert
Stops escalation. A late acknowledgement of an exhausted alert still works.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
user | string | Who is acknowledging. |
curl -X POST $TREASON_API_URL/v1/alerts/:id/ack \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"user":"string"}'await treason.alerts.ack(id, { user: "ana" });{
"outcome": "acknowledged"
}Errors: 401403404409
/v1/alerts/{id}/closealert keyClose an alert
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
user | string |
curl -X POST $TREASON_API_URL/v1/alerts/:id/close \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"user":"string"}'await treason.alerts.close(id);{
"outcome": "closed"
}Errors: 401403404
/v1/alerts/{id}/notesalert keyAdd a note to an alert
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
note* | string | |
user | string |
curl -X POST $TREASON_API_URL/v1/alerts/:id/notes \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"note":"string","user":"string"}'await treason.alerts.note(id, "restarted the pod");{
"ok": true
}Errors: 401403404422
Approvals
/v1/approvalsalert keyAsk a human to approve something
Pages the people who can answer (the team's policy, or userIds) along the real path, with escalation, retries and failover, and records the answer. They reply by text (Y4821 / N4821), press 1 or 9 on a call, or decide in the dashboard or app. **Software asks; only a human answers**: the key that creates an approval cannot decide it. Send an Idempotency-Key so a retry is the same question.
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string |
| Field | Type | Description |
|---|---|---|
title* | string | The question, in a sentence. |
description | string | |
context | object | What the human should see before deciding: the diff, the command, the amount. Up to 8 KB. |
teamId | string (uuid) | Page this team's escalation policy. Optional with a single team, or with relatedAlertId. |
userIds | string (uuid)[] | |
relatedAlertId | string (uuid) | The alert this question is about. The request and the answer go into its timeline; the approval is filed under its team and pages whoever acknowledged it first, unless teamId or userIds say otherwise. |
priority | "P1" | "P2" | "P3" | "P4" | "P5" | P1 pages now; P4 and P5 only push. |
timeoutSeconds | integer | 30 to 604800. Default 3600. |
onTimeout | "deny" | "approve" | What a timeout means. deny is the safe default. |
required | integer | Approvals needed. Any denial denies at once. Default 1. |
deciders | string (uuid)[] | Who may answer by text, call or app. Default: whoever was paged. |
curl -X POST $TREASON_API_URL/v1/approvals \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"Deploy v42 to production","context":{"commit":"9f31c2a","diff":"+42 -7"},"timeoutSeconds":900,"priority":"P2"}'const { approved } = await treason.approvals.ask({ title: "Deploy v42 to production", context: { commit: "9f31c2a" }, timeoutSeconds: 900 });
if (!approved) throw new Error("not approved");{
"approval": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"title": "string",
"description": "string",
"context": {},
"status": "pending",
"decision": "approve",
"requiredApprovals": 1,
"approvals": 1,
"votes": [
{
"by": "string",
"decision": "approve",
"note": "string",
"via": "string",
"at": "2026-10-11T20:50:04.000Z"
}
],
"deciders": [
"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"
],
"onTimeout": "deny",
"timeoutAt": "2026-10-11T20:50:04.000Z",
"alertId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"alertNumber": 1,
"relatedAlertId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"relatedAlertNumber": 1,
"requester": "string",
"createdAt": "2026-10-11T20:50:04.000Z",
"decidedAt": "2026-10-11T20:50:04.000Z",
"decidedBy": "string",
"note": "string"
}
}Errors: 401403409422
/v1/approvalsalert keyList approvals
| Name | In | Type | Description |
|---|---|---|---|
status | query | "pending" | "approved" | "denied" | "expired" | "cancelled" | |
limit | query | integer |
curl $TREASON_API_URL/v1/approvals \
-H "Authorization: Bearer $TREASON_API_KEY"const { approvals } = await treason.approvals.list({ status: "pending" });{
"approvals": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"title": "string",
"description": "string",
"context": {},
"status": "pending",
"decision": "approve",
"requiredApprovals": 1,
"approvals": 1,
"votes": [
{}
],
"deciders": [
"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"
],
"onTimeout": "deny",
"timeoutAt": "2026-10-11T20:50:04.000Z",
"alertId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"alertNumber": 1,
"relatedAlertId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"relatedAlertNumber": 1,
"requester": "string",
"createdAt": "2026-10-11T20:50:04.000Z",
"decidedAt": "2026-10-11T20:50:04.000Z",
"decidedBy": "string",
"note": "string"
}
]
}Errors: 401403422
/v1/approvals/{id}alert keyGet an approval
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl $TREASON_API_URL/v1/approvals/:id \
-H "Authorization: Bearer $TREASON_API_KEY"const { approval } = await treason.approvals.get(id); // or: await treason.approvals.wait(id){
"approval": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"title": "string",
"description": "string",
"context": {},
"status": "pending",
"decision": "approve",
"requiredApprovals": 1,
"approvals": 1,
"votes": [
{
"by": "string",
"decision": "approve",
"note": "string",
"via": "string",
"at": "2026-10-11T20:50:04.000Z"
}
],
"deciders": [
"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"
],
"onTimeout": "deny",
"timeoutAt": "2026-10-11T20:50:04.000Z",
"alertId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"alertNumber": 1,
"relatedAlertId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"relatedAlertNumber": 1,
"requester": "string",
"createdAt": "2026-10-11T20:50:04.000Z",
"decidedAt": "2026-10-11T20:50:04.000Z",
"decidedBy": "string",
"note": "string"
}
}Errors: 401403404
/v1/approvals/{id}/decisionadmin keyDecide an approval
Needs an **admin** key, which belongs to a person or the dashboard and not to the software that asked. The first denial denies; enough approvals approve. Deciding closes the alert, so paging stops.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
decision* | "approve" | "deny" | |
user | string | Who is deciding, for the record. |
note | string |
curl -X POST $TREASON_API_URL/v1/approvals/:id/decision \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"decision":"approve","user":"string","note":"string"}'await treason.approvals.decide(id, "approve", { user: "ana" }); // admin key: a person, never the requester{
"outcome": "decided",
"approval": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"title": "string",
"description": "string",
"context": {},
"status": "pending",
"decision": "approve",
"requiredApprovals": 1,
"approvals": 1,
"votes": [
{
"by": "string",
"decision": "approve",
"note": "string",
"via": "string",
"at": "2026-10-11T20:50:04.000Z"
}
],
"deciders": [
"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"
],
"onTimeout": "deny",
"timeoutAt": "2026-10-11T20:50:04.000Z",
"alertId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"alertNumber": 1,
"relatedAlertId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"relatedAlertNumber": 1,
"requester": "string",
"createdAt": "2026-10-11T20:50:04.000Z",
"decidedAt": "2026-10-11T20:50:04.000Z",
"decidedBy": "string",
"note": "string"
}
}Errors: 401403404409422
/v1/approvals/{id}/cancelalert keyWithdraw an approval
The requester no longer needs the answer. Only while pending.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X POST $TREASON_API_URL/v1/approvals/:id/cancel \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.approvals.cancel(id);{
"outcome": "cancelled",
"approval": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"title": "string",
"description": "string",
"context": {},
"status": "pending",
"decision": "approve",
"requiredApprovals": 1,
"approvals": 1,
"votes": [
{
"by": "string",
"decision": "approve",
"note": "string",
"via": "string",
"at": "2026-10-11T20:50:04.000Z"
}
],
"deciders": [
"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"
],
"onTimeout": "deny",
"timeoutAt": "2026-10-11T20:50:04.000Z",
"alertId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"alertNumber": 1,
"relatedAlertId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"relatedAlertNumber": 1,
"requester": "string",
"createdAt": "2026-10-11T20:50:04.000Z",
"decidedAt": "2026-10-11T20:50:04.000Z",
"decidedBy": "string",
"note": "string"
}
}Errors: 401403404409
Noise control
/v1/alerts/{id}/snoozealert keySnooze an alert
Acknowledges now and pages again, from the first step of the policy, if the alert is still open after minutes. Closing the alert cancels the snooze.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
minutes* | integer | |
user | string |
curl -X POST $TREASON_API_URL/v1/alerts/:id/snooze \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"minutes":1,"user":"string"}'await treason.alerts.snooze(id, 30, { user: "ana" }); // pages again in 30 minutes if still open{
"outcome": "snoozed",
"until": "2026-10-11T20:50:04.000Z"
}Errors: 401403404409422
/v1/maintenance-windowsadmin keyCreate a maintenance window
Alerts that arrive while a window is in effect are recorded and de-duplicated but do not page, are not billed, and do not fire webhooks. When it ends, those still open page (or are dropped, with onEnd: discard). A window covers everything, or just a team, an integration, or alerts matching conditions. It is one-off (startsAt, endsAt) or recurring (recurrence).
| Field | Type | Description |
|---|---|---|
name* | string | |
startsAt | string (date-time) | A one-off window: start... |
endsAt | string (date-time) | ...and end. |
recurrence | Recurrence | |
teamId | string (uuid) | null | |
integrationId | string (uuid) | null | |
conditions | Condition[] | All must match. Empty: every alert in scope. |
onEnd | "release" | "discard" | What happens to alerts still firing when the window ends: page for them (default) or drop them. |
curl -X POST $TREASON_API_URL/v1/maintenance-windows \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Weekly deploy","recurrence":{"days":[2],"time":"14:00","durationMinutes":60,"timezone":"America/New_York"},"conditions":[{"field":"tag","op":"is","value":"env:staging"}]}'await treason.maintenance.create({ name: "Weekly deploy", recurrence: { days: [2], time: "14:00", durationMinutes: 60, timezone: "America/New_York" } });
// or, for "I am deploying now": await treason.maintenance.start(60, { name: "Deploy", teamId });{
"window": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"startsAt": "2026-10-11T20:50:04.000Z",
"endsAt": "2026-10-11T20:50:04.000Z",
"recurrence": {
"days": [
1
],
"time": "string",
"durationMinutes": 1,
"timezone": "string"
},
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"integrationId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"conditions": [
{
"field": "message",
"key": "string",
"op": "is",
"value": "string",
"timezone": "string",
"days": [],
"from": "string",
"to": "string"
}
],
"onEnd": "release",
"active": true,
"activeUntil": "2026-10-11T20:50:04.000Z",
"createdBy": "string",
"createdAt": "2026-10-11T20:50:04.000Z"
}
}Errors: 401403422
/v1/maintenance-windowsread keyList maintenance windows
| Name | In | Type | Description |
|---|---|---|---|
active | query | "true" | Only windows in effect now. |
curl $TREASON_API_URL/v1/maintenance-windows \
-H "Authorization: Bearer $TREASON_API_KEY"const { windows } = await treason.maintenance.list({ active: true });{
"windows": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"startsAt": "2026-10-11T20:50:04.000Z",
"endsAt": "2026-10-11T20:50:04.000Z",
"recurrence": {
"days": [],
"time": "string",
"durationMinutes": 1,
"timezone": "string"
},
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"integrationId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"conditions": [
{}
],
"onEnd": "release",
"active": true,
"activeUntil": "2026-10-11T20:50:04.000Z",
"createdBy": "string",
"createdAt": "2026-10-11T20:50:04.000Z"
}
]
}Errors: 401403
/v1/maintenance-windows/{id}read keyGet a maintenance window
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl $TREASON_API_URL/v1/maintenance-windows/:id \
-H "Authorization: Bearer $TREASON_API_KEY"const { window } = await treason.maintenance.get(id);{
"window": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"startsAt": "2026-10-11T20:50:04.000Z",
"endsAt": "2026-10-11T20:50:04.000Z",
"recurrence": {
"days": [
1
],
"time": "string",
"durationMinutes": 1,
"timezone": "string"
},
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"integrationId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"conditions": [
{
"field": "message",
"key": "string",
"op": "is",
"value": "string",
"timezone": "string",
"days": [],
"from": "string",
"to": "string"
}
],
"onEnd": "release",
"active": true,
"activeUntil": "2026-10-11T20:50:04.000Z",
"createdBy": "string",
"createdAt": "2026-10-11T20:50:04.000Z"
}
}Errors: 401403404
/v1/maintenance-windows/{id}admin keyReplace a maintenance window
Shortening a window to the past releases what it was holding.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
name* | string | |
startsAt | string (date-time) | A one-off window: start... |
endsAt | string (date-time) | ...and end. |
recurrence | Recurrence | |
teamId | string (uuid) | null | |
integrationId | string (uuid) | null | |
conditions | Condition[] | All must match. Empty: every alert in scope. |
onEnd | "release" | "discard" | What happens to alerts still firing when the window ends: page for them (default) or drop them. |
curl -X PUT $TREASON_API_URL/v1/maintenance-windows/:id \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","startsAt":"2026-10-11T20:50:04.000Z","endsAt":"2026-10-11T20:50:04.000Z","recurrence":{"days":[1],"time":"string","durationMinutes":1,"timezone":"string"},"teamId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","integrationId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","conditions":[{"field":"message","key":"string","op":"is","value":"string","timezone":"string","days":[1],"from":"string","to":"string"}],"onEnd":"release"}'await treason.maintenance.replace(id, { name: "Deploy", startsAt, endsAt });{
"window": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"startsAt": "2026-10-11T20:50:04.000Z",
"endsAt": "2026-10-11T20:50:04.000Z",
"recurrence": {
"days": [
1
],
"time": "string",
"durationMinutes": 1,
"timezone": "string"
},
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"integrationId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"conditions": [
{
"field": "message",
"key": "string",
"op": "is",
"value": "string",
"timezone": "string",
"days": [],
"from": "string",
"to": "string"
}
],
"onEnd": "release",
"active": true,
"activeUntil": "2026-10-11T20:50:04.000Z",
"createdBy": "string",
"createdAt": "2026-10-11T20:50:04.000Z"
}
}Errors: 401403404422
/v1/maintenance-windows/{id}admin keyDelete a maintenance window
Ending maintenance early means the problem is real again: alerts the window was holding page now.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X DELETE $TREASON_API_URL/v1/maintenance-windows/:id \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.maintenance.delete(id); // ends it now: what it held pagesResponse 204: no body.
Errors: 401403404
/v1/routing-rulesadmin keyCreate a routing rule
Rules run on every new alert, in order. Each rule whose conditions match applies its actions, and later rules see the effect of earlier ones. Use them to re-prioritise, re-route to another team, tag, group related alerts into one page, or silence an alert by policy.
| Field | Type | Description |
|---|---|---|
name* | string | |
integrationId | string (uuid) | null | |
conditions | Condition[] | |
actions* | RuleActions | |
stop | boolean | Stop evaluating later rules after this one matches. |
enabled | boolean |
curl -X POST $TREASON_API_URL/v1/routing-rules \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Staging is never urgent","conditions":[{"field":"tag","op":"is","value":"env:staging"}],"actions":{"setPriority":"P5"}}'await treason.routing.create({ name: "Staging is never urgent", conditions: [{ field: "tag", op: "is", value: "env:staging" }], actions: { setPriority: "P5" } });{
"rule": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"position": 1,
"enabled": true,
"integrationId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"conditions": [
{
"field": "message",
"key": "string",
"op": "is",
"value": "string",
"timezone": "string",
"days": [],
"from": "string",
"to": "string"
}
],
"actions": {
"routeToTeamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"setPriority": "P1",
"suppress": true,
"addTags": [
"string"
],
"groupBy": [
"string"
],
"groupWindowMinutes": 1
},
"stop": true,
"createdAt": "2026-10-11T20:50:04.000Z"
}
}Errors: 401403422
/v1/routing-rulesread keyList routing rules, in order
curl $TREASON_API_URL/v1/routing-rules \
-H "Authorization: Bearer $TREASON_API_KEY"const { rules } = await treason.routing.list();{
"rules": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"position": 1,
"enabled": true,
"integrationId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"conditions": [
{}
],
"actions": {
"routeToTeamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"setPriority": "P1",
"suppress": true,
"addTags": [],
"groupBy": [],
"groupWindowMinutes": 1
},
"stop": true,
"createdAt": "2026-10-11T20:50:04.000Z"
}
]
}Errors: 401403
/v1/routing-rules/orderadmin keyReorder routing rules
ids must list every rule exactly once.
| Field | Type | Description |
|---|---|---|
ids* | string (uuid)[] |
curl -X PUT $TREASON_API_URL/v1/routing-rules/order \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"ids":["5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"]}'await treason.routing.reorder(ids);{
"rules": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"position": 1,
"enabled": true,
"integrationId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"conditions": [
{}
],
"actions": {
"routeToTeamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"setPriority": "P1",
"suppress": true,
"addTags": [],
"groupBy": [],
"groupWindowMinutes": 1
},
"stop": true,
"createdAt": "2026-10-11T20:50:04.000Z"
}
]
}Errors: 401403409422
/v1/routing-rules/{id}admin keyReplace a routing rule
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
name* | string | |
integrationId | string (uuid) | null | |
conditions | Condition[] | |
actions* | RuleActions | |
stop | boolean | Stop evaluating later rules after this one matches. |
enabled | boolean |
curl -X PUT $TREASON_API_URL/v1/routing-rules/:id \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","integrationId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","conditions":[{"field":"message","key":"string","op":"is","value":"string","timezone":"string","days":[1],"from":"string","to":"string"}],"actions":{"routeToTeamId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","setPriority":"P1","suppress":true,"addTags":["string"],"groupBy":["string"],"groupWindowMinutes":1},"stop":true,"enabled":true}'await treason.routing.replace(id, rule);{
"rule": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"position": 1,
"enabled": true,
"integrationId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"conditions": [
{
"field": "message",
"key": "string",
"op": "is",
"value": "string",
"timezone": "string",
"days": [],
"from": "string",
"to": "string"
}
],
"actions": {
"routeToTeamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"setPriority": "P1",
"suppress": true,
"addTags": [
"string"
],
"groupBy": [
"string"
],
"groupWindowMinutes": 1
},
"stop": true,
"createdAt": "2026-10-11T20:50:04.000Z"
}
}Errors: 401403404422
/v1/routing-rules/{id}admin keyDelete a routing rule
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X DELETE $TREASON_API_URL/v1/routing-rules/:id \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.routing.delete(id);Response 204: no body.
Errors: 401403404
Reports
/v1/reports/loadread keyWho is carrying the pager
Per person over a period: hours on call (to the minute, overrides included), the share at night and at weekends by the clock where they live, pages received, pages at night, and how fast they answer. With suggestions where the load is lopsided.
| Name | In | Type | Description |
|---|---|---|---|
days | query | integer | |
team | query | string (uuid) |
curl $TREASON_API_URL/v1/reports/load \
-H "Authorization: Bearer $TREASON_API_KEY"const { people, suggestions } = await treason.reports.load(30);{
"period": {
"from": "2026-10-11T20:50:04.000Z",
"to": "2026-10-11T20:50:04.000Z",
"days": 1
},
"totals": {
"onCallHours": 1,
"pages": 1,
"nightPages": 1
},
"people": [
{
"userId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"timezone": "string",
"onCallHours": 1,
"nightHours": 1,
"weekendHours": 1,
"pages": 1,
"nightPages": 1,
"acknowledged": 1,
"medianMinutesToAck": 1,
"shareOfHours": 1,
"shareOfPages": 1
}
],
"suggestions": [
{
"kind": "heavy_load",
"userId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"title": "string",
"detail": "string"
}
]
}Errors: 401403404422
/v1/reports/noiseread keyWhich alerts are noise
From what people actually did with alerts: how many were acknowledged, which resolved themselves, which repeat, and which source is loudest. suggestions are ranked, and many carry a ready-to-create routing rule or the organization setting that would apply them.
| Name | In | Type | Description |
|---|---|---|---|
days | query | integer |
curl $TREASON_API_URL/v1/reports/noise \
-H "Authorization: Bearer $TREASON_API_KEY"const { totals, topAliases, suggestions } = await treason.reports.noise(30);
for (const s of suggestions) if (s.rule) await treason.routing.create(s.rule); // apply what it suggests{
"period": {
"from": "2026-10-11T20:50:04.000Z",
"to": "2026-10-11T20:50:04.000Z",
"days": 1
},
"totals": {
"alerts": 1,
"acknowledged": 1,
"ackRate": 1,
"selfResolved": 1,
"suppressed": 1,
"repeats": 1,
"urgent": 1,
"urgentUnacknowledged": 1
},
"integrations": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"kind": "string",
"source": "string",
"alerts": 1,
"acknowledged": 1,
"ackRate": 1,
"selfResolved": 1,
"suppressed": 1,
"repeats": 1,
"medianMinutesToAck": 1
}
],
"topAliases": [
{
"alias": "string",
"message": "string",
"integrationId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"integrationName": "string",
"priority": "string",
"opened": 1,
"occurrences": 1,
"acknowledged": 1,
"selfResolved": 1,
"medianMinutesOpen": 1,
"lastAt": "2026-10-11T20:50:04.000Z"
}
],
"suggestions": [
{
"kind": "never_acknowledged",
"severity": "high",
"title": "string",
"detail": "string",
"rule": {
"name": "string",
"integrationId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"conditions": [],
"actions": {},
"stop": true,
"enabled": true
},
"org": {},
"alias": "string",
"integrationId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"
}
]
}Errors: 401403422
Reachability
/v1/readinessread keyCan the people who get paged be reached?
Per person: a verified phone, the app installed and allowed to ring through Do Not Disturb, notification rules that actually escalate, a recent test page. For the organization: who is on call right now and whether they can be paged, schedules with nobody on call in the next 14 days, empty policies and steps, and teams that receive alerts but have no policy.
curl $TREASON_API_URL/v1/readiness \
-H "Authorization: Bearer $TREASON_API_KEY"const { summary, onCallNow, people, gaps } = await treason.reachability.organization();
if (!summary.onCallReachable) await treason.page({ message: "Whoever is on call cannot be reached", priority: "P1" });{
"generatedAt": "2026-10-11T20:50:04.000Z",
"summary": {
"people": 1,
"ready": 1,
"warnings": 1,
"atRisk": 1,
"unreachable": 1,
"onCallReachable": true,
"gaps": 1
},
"onCallNow": [
{
"scheduleId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"scheduleName": "string",
"user": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"level": "string",
"issues": [
"string"
]
}
],
"people": [
{
"userId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"level": "ready",
"issues": [
{}
],
"lastTest": {
"alertId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"at": "2026-10-11T20:50:04.000Z",
"status": "string"
}
}
],
"gaps": [
{
"kind": "no_one_on_call",
"title": "string",
"detail": "string",
"scheduleId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"from": "2026-10-11T20:50:04.000Z",
"to": "2026-10-11T20:50:04.000Z"
}
]
}Errors: 401403
/v1/users/{id}/readinessread keyCan this person be reached?
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl $TREASON_API_URL/v1/users/:id/readiness \
-H "Authorization: Bearer $TREASON_API_KEY"const { readiness } = await treason.reachability.user(userId); // readiness.checks[].fix says how to repair each problem{
"readiness": {
"userId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"level": "ready",
"checks": [
{
"id": "string",
"status": "ok",
"title": "string",
"detail": "string",
"fix": "string"
}
],
"lastTest": {
"alertId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"at": "2026-10-11T20:50:04.000Z",
"status": "pending",
"acknowledged": true,
"channels": [
{}
]
}
}
}Errors: 401403404
/v1/users/{id}/test-pageadmin keySend a test page
A real page, along the real path, to one person. Without channels it uses their own notification rules and passes when they acknowledge it; with channels it tries each now and passes when each is delivered. A test is hidden from alert lists, counts, reports and billing, fires no webhook, and does not page admins if nobody answers. Carrier costs still apply.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
channels | "push" | "sms" | "voice"[] |
curl -X POST $TREASON_API_URL/v1/users/:id/test-page \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"channels":["push"]}'const result = await treason.reachability.testAndWait(userId, { channels: ["push", "sms"] }); // result.outcome: passed | failed | pending{
"alertId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"channels": [
"string"
]
}Errors: 401403404409422
/v1/users/{id}/test-pagesread keyRecent test pages and how they went
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) | |
limit | query | integer |
curl $TREASON_API_URL/v1/users/:id/test-pages \
-H "Authorization: Bearer $TREASON_API_KEY"const { testPages } = await treason.reachability.testPages(userId);{
"testPages": [
{
"alertId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"at": "2026-10-11T20:50:04.000Z",
"outcome": "pending",
"acknowledged": true,
"acknowledgedAfterSeconds": 1,
"channels": [
{}
]
}
]
}Errors: 401403404
Heartbeats
/v1/heartbeats/{name}admin keyCreate or update a heartbeat
Idempotent, so it can run on every deploy. A heartbeat expects a ping every intervalSeconds (plus graceSeconds). If one is missed, an alert opens with alias heartbeat:<name> and pages the team's escalation policy; the next ping closes it.
| Name | In | Type | Description |
|---|---|---|---|
name* | path | string | Letters, digits, dot, dash, underscore. |
| Field | Type | Description |
|---|---|---|
intervalSeconds* | integer | Between 10 seconds and one year. |
graceSeconds | integer | |
priority | "P1" | "P2" | "P3" | "P4" | "P5" | P1 pages now; P4 and P5 only push. |
message | string | null | |
enabled | boolean | |
teamId | string (uuid) | null |
curl -X PUT $TREASON_API_URL/v1/heartbeats/nightly-backup \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"intervalSeconds":86400,"graceSeconds":600,"priority":"P1","message":"The nightly backup did not report in"}'await treason.heartbeats.upsert("nightly-backup", { intervalSeconds: 86_400, graceSeconds: 600, priority: "P1" });{
"heartbeat": {
"name": "string",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"intervalSeconds": 1,
"graceSeconds": 1,
"priority": "P1",
"message": "string",
"enabled": true,
"state": "new",
"lastPingAt": "2026-10-11T20:50:04.000Z",
"downSince": "2026-10-11T20:50:04.000Z",
"dueAt": "2026-10-11T20:50:04.000Z",
"createdAt": "2026-10-11T20:50:04.000Z"
}
}Errors: 401403404422
/v1/heartbeats/{name}read keyGet a heartbeat
| Name | In | Type | Description |
|---|---|---|---|
name* | path | string | Letters, digits, dot, dash, underscore. |
curl $TREASON_API_URL/v1/heartbeats/nightly-backup \
-H "Authorization: Bearer $TREASON_API_KEY"const { heartbeat } = await treason.heartbeats.get("nightly-backup");{
"heartbeat": {
"name": "string",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"intervalSeconds": 1,
"graceSeconds": 1,
"priority": "P1",
"message": "string",
"enabled": true,
"state": "new",
"lastPingAt": "2026-10-11T20:50:04.000Z",
"downSince": "2026-10-11T20:50:04.000Z",
"dueAt": "2026-10-11T20:50:04.000Z",
"createdAt": "2026-10-11T20:50:04.000Z"
}
}Errors: 401403404
/v1/heartbeats/{name}admin keyDelete a heartbeat
| Name | In | Type | Description |
|---|---|---|---|
name* | path | string | Letters, digits, dot, dash, underscore. |
curl -X DELETE $TREASON_API_URL/v1/heartbeats/nightly-backup \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.heartbeats.delete("nightly-backup");Response 204: no body.
Errors: 401403404
/v1/heartbeatsread keyList heartbeats
curl $TREASON_API_URL/v1/heartbeats \
-H "Authorization: Bearer $TREASON_API_KEY"const { heartbeats } = await treason.heartbeats.list();{
"heartbeats": [
{
"name": "string",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"intervalSeconds": 1,
"graceSeconds": 1,
"priority": "P1",
"message": "string",
"enabled": true,
"state": "new",
"lastPingAt": "2026-10-11T20:50:04.000Z",
"downSince": "2026-10-11T20:50:04.000Z",
"dueAt": "2026-10-11T20:50:04.000Z",
"createdAt": "2026-10-11T20:50:04.000Z"
}
]
}Errors: 401403
/v1/heartbeats/{name}/pingalert keyPing a heartbeat
Records that the job is alive and moves the due time forward. If the heartbeat was down, its alert is closed and recovered is true. Any key that can create alerts can ping.
| Name | In | Type | Description |
|---|---|---|---|
name* | path | string | Letters, digits, dot, dash, underscore. |
curl -X POST $TREASON_API_URL/v1/heartbeats/nightly-backup/ping \
-H "Authorization: Bearer $TREASON_API_KEY"const { recovered } = await treason.heartbeats.ping("nightly-backup");{
"heartbeat": {
"name": "string",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"intervalSeconds": 1,
"graceSeconds": 1,
"priority": "P1",
"message": "string",
"enabled": true,
"state": "new",
"lastPingAt": "2026-10-11T20:50:04.000Z",
"downSince": "2026-10-11T20:50:04.000Z",
"dueAt": "2026-10-11T20:50:04.000Z",
"createdAt": "2026-10-11T20:50:04.000Z"
},
"recovered": true
}Errors: 401403404429
On call
/v1/teams/{id}/handoff-notesalert keyLeave a handoff note
What the person going off call wants the next person to know. Shown by GET /v1/oncall as handoff, in the dashboard, and sent as a handoff.note webhook.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
body* | string | |
userId | string (uuid) | Who is writing, for the byline. |
curl -X POST $TREASON_API_URL/v1/teams/:id/handoff-notes \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"body":"string","userId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"}'await treason.handoff.add(teamId, "Export is flaky: just re-run it. Do not touch the replica.", { userId: ana });{
"note": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"author": "string",
"authorId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"body": "string",
"createdAt": "2026-10-11T20:50:04.000Z"
}
}Errors: 401403404422
/v1/teams/{id}/handoff-notesalert keyHandoff notes
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) | |
limit | query | integer |
curl $TREASON_API_URL/v1/teams/:id/handoff-notes \
-H "Authorization: Bearer $TREASON_API_KEY"const { notes } = await treason.handoff.list(teamId);{
"notes": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"author": "string",
"authorId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"body": "string",
"createdAt": "2026-10-11T20:50:04.000Z"
}
]
}Errors: 401403404
/v1/oncallalert keyWho is on call
For a team, the person on call right now (or at at) for each of its schedules. Overrides win over rotations.
| Name | In | Type | Description |
|---|---|---|---|
team* | query | string | A team id or exact name. |
at | query | string (date-time) | Defaults to now. |
curl $TREASON_API_URL/v1/oncall \
-H "Authorization: Bearer $TREASON_API_KEY"const { schedules } = await treason.oncall.get("payments");{
"team": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"at": "2026-10-11T20:50:04.000Z",
"schedules": [
{
"scheduleId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"scheduleName": "string",
"onCall": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
}
}
],
"handoff": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"author": "string",
"authorId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"body": "string",
"createdAt": "2026-10-11T20:50:04.000Z"
}
}Errors: 401403404
Schedules
/v1/schedules/{id}/coverageadmin keyAsk for cover
"I am ill on Thursday, can someone take my shift?" Names a stretch of the requester's on-call time. When someone eligible (a member of the schedule's team) accepts, overrides are created for them covering exactly the minutes the requester was on call inside that stretch. The rotation itself is untouched.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
requesterId* | string (uuid) | Whose on-call time this is. They must be on call at some point in the window. |
startsAt* | string (date-time) | |
endsAt* | string (date-time) | |
note | string | Why, for whoever sees the request. |
offeredTo | string (uuid) | Ask one person (they accept or decline). Omit to ask anyone on the schedule's team. |
curl -X POST $TREASON_API_URL/v1/schedules/:id/coverage \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"requesterId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","startsAt":"2026-10-11T20:50:04.000Z","endsAt":"2026-10-11T20:50:04.000Z","note":"string","offeredTo":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"}'await treason.coverage.request(scheduleId, { requesterId: ana, startsAt: "2027-03-04T00:00:00Z", endsAt: "2027-03-06T00:00:00Z", note: "wedding" });{
"coverage": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"scheduleId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"scheduleName": "string",
"requester": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"startsAt": "2026-10-11T20:50:04.000Z",
"endsAt": "2026-10-11T20:50:04.000Z",
"note": "string",
"offeredTo": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"status": "open",
"takenBy": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"createdAt": "2026-10-11T20:50:04.000Z",
"resolvedAt": "2026-10-11T20:50:04.000Z"
}
}Errors: 401403404422
/v1/coverageread keyList cover requests
| Name | In | Type | Description |
|---|---|---|---|
status | query | "open" | "accepted" | "declined" | "cancelled" | "expired" | |
scheduleId | query | string (uuid) | |
limit | query | integer |
curl $TREASON_API_URL/v1/coverage \
-H "Authorization: Bearer $TREASON_API_KEY"const { coverage } = await treason.coverage.list({ status: "open" });{
"coverage": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"scheduleId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"scheduleName": "string",
"requester": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"startsAt": "2026-10-11T20:50:04.000Z",
"endsAt": "2026-10-11T20:50:04.000Z",
"note": "string",
"offeredTo": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"status": "open",
"takenBy": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"createdAt": "2026-10-11T20:50:04.000Z",
"resolvedAt": "2026-10-11T20:50:04.000Z"
}
]
}Errors: 401403422
/v1/coverage/{id}/acceptadmin keyTake a shift
Creates the overrides. The taker must be on the schedule's team, and the request open and not yet over.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
userId* | string (uuid) |
curl -X POST $TREASON_API_URL/v1/coverage/:id/accept \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"userId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"}'await treason.coverage.accept(id, bo); // Bo is now on call for Ana's minutes in that stretch{
"coverage": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"scheduleId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"scheduleName": "string",
"requester": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"startsAt": "2026-10-11T20:50:04.000Z",
"endsAt": "2026-10-11T20:50:04.000Z",
"note": "string",
"offeredTo": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"status": "open",
"takenBy": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"createdAt": "2026-10-11T20:50:04.000Z",
"resolvedAt": "2026-10-11T20:50:04.000Z"
},
"covered": [
{
"from": "2026-10-11T20:50:04.000Z",
"to": "2026-10-11T20:50:04.000Z"
}
]
}Errors: 401403404409422
/v1/coverage/{id}/declineadmin keyDecline an offered shift
Only the person it was offered to.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
userId* | string (uuid) |
curl -X POST $TREASON_API_URL/v1/coverage/:id/decline \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"userId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"}'await treason.coverage.decline(id, bo);{
"coverage": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"scheduleId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"scheduleName": "string",
"requester": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"startsAt": "2026-10-11T20:50:04.000Z",
"endsAt": "2026-10-11T20:50:04.000Z",
"note": "string",
"offeredTo": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"status": "open",
"takenBy": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"createdAt": "2026-10-11T20:50:04.000Z",
"resolvedAt": "2026-10-11T20:50:04.000Z"
}
}Errors: 401403404409
/v1/coverage/{id}/canceladmin keyWithdraw a cover request
If it was already taken, the cover is undone and its overrides removed.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X POST $TREASON_API_URL/v1/coverage/:id/cancel \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.coverage.cancel(id); // undoes the cover if it was taken{
"coverage": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"scheduleId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"scheduleName": "string",
"requester": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"startsAt": "2026-10-11T20:50:04.000Z",
"endsAt": "2026-10-11T20:50:04.000Z",
"note": "string",
"offeredTo": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"status": "open",
"takenBy": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
},
"createdAt": "2026-10-11T20:50:04.000Z",
"resolvedAt": "2026-10-11T20:50:04.000Z"
}
}Errors: 401403404409
/v1/calendar-feedsadmin keyCreate a calendar feed
A secret URL that Google Calendar, Apple Calendar or Outlook subscribes to, showing a schedule, a team, or one person's shifts (a week back to four months ahead, overrides included). The token is shown once; delete the feed to revoke it.
| Field | Type | Description |
|---|---|---|
scheduleId | string (uuid) | |
teamId | string (uuid) | |
userId | string (uuid) | |
label | string |
curl -X POST $TREASON_API_URL/v1/calendar-feeds \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"scheduleId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","teamId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","userId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","label":"string"}'const { url } = await treason.calendar.create({ scheduleId }); // subscribe a calendar app to this{
"feed": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"label": "string",
"scheduleId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"userId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"createdAt": "2026-10-11T20:50:04.000Z",
"lastReadAt": "2026-10-11T20:50:04.000Z"
},
"token": "string",
"url": "string"
}Errors: 401403422
/v1/calendar-feedsadmin keyList calendar feeds
curl $TREASON_API_URL/v1/calendar-feeds \
-H "Authorization: Bearer $TREASON_API_KEY"const { feeds } = await treason.calendar.list();{
"feeds": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"label": "string",
"scheduleId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"userId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"createdAt": "2026-10-11T20:50:04.000Z",
"lastReadAt": "2026-10-11T20:50:04.000Z"
}
]
}Errors: 401403
/v1/calendar-feeds/{id}admin keyDelete a calendar feed
Calendar apps subscribed to it stop updating.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X DELETE $TREASON_API_URL/v1/calendar-feeds/:id \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.calendar.delete(id);Response 204: no body.
Errors: 401403404
/v1/schedules/previewread keyPreview a schedule
Who would be on call at each of the given times if this schedule were saved. Saves nothing. Pass scheduleId to include that schedule's existing overrides (a replacement keeps them). This is what treason plan uses to show a rotation change as "Thursday 09:00 is Bo, not Ana".
| Field | Type | Description |
|---|---|---|
layers* | object[] | |
timezone | string | |
scheduleId | string (uuid) | |
at* | string (date-time)[] |
curl -X POST $TREASON_API_URL/v1/schedules/preview \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"layers":[{"rotationStart":"2026-10-11T20:50:04.000Z","rotationLength":{"days":1,"hours":1},"handoffTime":"string","members":["5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"]}],"timezone":"string","scheduleId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","at":["2026-10-11T20:50:04.000Z"]}'const { onCall } = await treason.schedules.preview({ timezone: "UTC", layers }, [new Date(), nextThursday], existingScheduleId);{
"onCall": [
{
"at": "2026-10-11T20:50:04.000Z",
"user": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
}
}
]
}Errors: 401403422
/v1/schedulesadmin keyCreate a schedule
| Field | Type | Description |
|---|---|---|
name* | string | |
teamId | string (uuid) | null | |
timezone | string | Default UTC. |
layers* | object[] |
curl -X POST $TREASON_API_URL/v1/schedules \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","teamId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","timezone":"string","layers":[{"rotationStart":"2026-10-11T20:50:04.000Z","rotationLength":{"days":1,"hours":1},"handoffTime":"string","members":["5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"]}]}'await treason.schedules.create({ name: "Primary", teamId, timezone: "UTC", layers: [{ rotationStart, rotationLength: { days: 7, hours: 0 }, handoffTime: "09:00", members }] });{
"schedule": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"timezone": "string",
"layers": [
{
"order": 1,
"rotationStart": "2026-10-11T20:50:04.000Z",
"handoffTime": "string",
"rotationLength": {},
"members": []
}
],
"overrides": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"userId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"startsAt": "2026-10-11T20:50:04.000Z",
"endsAt": "2026-10-11T20:50:04.000Z"
}
],
"onCall": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"
}
}Errors: 401403409422
/v1/schedulesread keyList schedules
curl $TREASON_API_URL/v1/schedules \
-H "Authorization: Bearer $TREASON_API_KEY"const { schedules } = await treason.schedules.list();{
"schedules": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"timezone": "string",
"layers": [
{}
],
"overrides": [
{}
],
"onCall": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"
}
]
}Errors: 401403
/v1/schedules/{id}read keyGet a schedule
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) | |
at | query | string (date-time) | Evaluate onCall at this time. Overrides ending in the last 90 days are included. |
curl $TREASON_API_URL/v1/schedules/:id \
-H "Authorization: Bearer $TREASON_API_KEY"const { schedule } = await treason.schedules.get(id, new Date());{
"schedule": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"timezone": "string",
"layers": [
{
"order": 1,
"rotationStart": "2026-10-11T20:50:04.000Z",
"handoffTime": "string",
"rotationLength": {},
"members": []
}
],
"overrides": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"userId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"startsAt": "2026-10-11T20:50:04.000Z",
"endsAt": "2026-10-11T20:50:04.000Z"
}
],
"onCall": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"
}
}Errors: 401403404
/v1/schedules/{id}admin keyReplace a schedule
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
name* | string | |
teamId | string (uuid) | null | |
timezone | string | Default UTC. |
layers* | object[] |
curl -X PUT $TREASON_API_URL/v1/schedules/:id \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","teamId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","timezone":"string","layers":[{"rotationStart":"2026-10-11T20:50:04.000Z","rotationLength":{"days":1,"hours":1},"handoffTime":"string","members":["5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"]}]}'await treason.schedules.replace(id, input);{
"schedule": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"timezone": "string",
"layers": [
{
"order": 1,
"rotationStart": "2026-10-11T20:50:04.000Z",
"handoffTime": "string",
"rotationLength": {},
"members": []
}
],
"overrides": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"userId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"startsAt": "2026-10-11T20:50:04.000Z",
"endsAt": "2026-10-11T20:50:04.000Z"
}
],
"onCall": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"
}
}Errors: 401403404409422
/v1/schedules/{id}admin keyDelete a schedule
Refused while an escalation policy still points at it, because that would page nobody.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X DELETE $TREASON_API_URL/v1/schedules/:id \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.schedules.delete(id);Response 204: no body.
Errors: 401403404409
/v1/schedules/{id}/overridesadmin keyAdd an override
Puts someone on call for a time range instead of the rotation.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
userId* | string (uuid) | |
startsAt* | string (date-time) | |
endsAt* | string (date-time) |
curl -X POST $TREASON_API_URL/v1/schedules/:id/overrides \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"userId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","startsAt":"2026-10-11T20:50:04.000Z","endsAt":"2026-10-11T20:50:04.000Z"}'await treason.schedules.addOverride(id, { userId, startsAt: new Date(), endsAt: later });{
"override": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"userId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"startsAt": "2026-10-11T20:50:04.000Z",
"endsAt": "2026-10-11T20:50:04.000Z"
}
}Errors: 401403404422
/v1/schedules/{id}/overrides/{oid}admin keyRemove an override
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) | |
oid* | path | string (uuid) |
curl -X DELETE $TREASON_API_URL/v1/schedules/:id/overrides/:oid \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.schedules.removeOverride(id, overrideId);Response 204: no body.
Errors: 401403404
Escalation
/v1/escalation-policiesadmin keyCreate an escalation policy
Each team has one policy.
| Field | Type | Description |
|---|---|---|
name* | string | |
teamId* | string (uuid) | |
repeatCount | integer | How many times to start over if nobody answers (default 0: tell admins and stop). |
steps* | PolicyStep[] |
curl -X POST $TREASON_API_URL/v1/escalation-policies \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","teamId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","repeatCount":1,"steps":[{"delayMinutes":1,"targets":[{}]}]}'await treason.policies.create({ name: "Default", teamId, repeatCount: 1, steps: [{ delayMinutes: 5, targets: [{ type: "schedule", id }] }] });{
"policy": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"repeatCount": 1,
"steps": [
{
"delayMinutes": 1,
"targets": []
}
]
}
}Errors: 401403409422
/v1/escalation-policiesread keyList escalation policies
curl $TREASON_API_URL/v1/escalation-policies \
-H "Authorization: Bearer $TREASON_API_KEY"const { policies } = await treason.policies.list();{
"policies": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"repeatCount": 1,
"steps": [
{}
]
}
]
}Errors: 401403
/v1/escalation-policies/{id}read keyGet an escalation policy
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl $TREASON_API_URL/v1/escalation-policies/:id \
-H "Authorization: Bearer $TREASON_API_KEY"const { policy } = await treason.policies.get(id);{
"policy": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"repeatCount": 1,
"steps": [
{
"delayMinutes": 1,
"targets": []
}
]
}
}Errors: 401403404
/v1/escalation-policies/{id}admin keyReplace an escalation policy
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
name* | string | |
teamId* | string (uuid) | |
repeatCount | integer | How many times to start over if nobody answers (default 0: tell admins and stop). |
steps* | PolicyStep[] |
curl -X PUT $TREASON_API_URL/v1/escalation-policies/:id \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","teamId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","repeatCount":1,"steps":[{"delayMinutes":1,"targets":[{}]}]}'await treason.policies.replace(id, input);{
"policy": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"repeatCount": 1,
"steps": [
{
"delayMinutes": 1,
"targets": []
}
]
}
}Errors: 401403404422
/v1/escalation-policies/{id}admin keyDelete an escalation policy
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X DELETE $TREASON_API_URL/v1/escalation-policies/:id \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.policies.delete(id);Response 204: no body.
Errors: 401403404
People
/v1/usersadmin keyCreate a person
| Field | Type | Description |
|---|---|---|
name* | string | |
timezone | string | |
email | string (email) | |
role | "responder" | "admin" | |
access | string[] | |
invited | boolean |
curl -X POST $TREASON_API_URL/v1/users \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","timezone":"string","email":"ana@example.com","role":"responder","access":["string"],"invited":true}'const { user } = await treason.users.create({ name: "Ana Lopez", timezone: "America/New_York" });{
"user": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"timezone": "string",
"email": "string",
"role": "responder",
"archived": true,
"createdAt": "2026-10-11T20:50:04.000Z",
"externalId": "string",
"invitedAt": "2026-10-11T20:50:04.000Z",
"pendingAccess": [
"string"
]
}
}Errors: 401403422
/v1/usersread keyList people
| Name | In | Type | Description |
|---|---|---|---|
archived | query | "true" | Include people who were removed. |
curl $TREASON_API_URL/v1/users \
-H "Authorization: Bearer $TREASON_API_KEY"const { users } = await treason.users.list();{
"users": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"timezone": "string",
"email": "string",
"role": "responder",
"archived": true,
"createdAt": "2026-10-11T20:50:04.000Z",
"externalId": "string",
"invitedAt": "2026-10-11T20:50:04.000Z",
"pendingAccess": [
"string"
]
}
]
}Errors: 401403
/v1/users/{id}read keyGet a person with contacts, rules and teams
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl $TREASON_API_URL/v1/users/:id \
-H "Authorization: Bearer $TREASON_API_KEY"const { user, contacts, rules, teams } = await treason.users.get(id);{
"user": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"timezone": "string",
"email": "string",
"role": "responder",
"archived": true,
"createdAt": "2026-10-11T20:50:04.000Z",
"externalId": "string",
"invitedAt": "2026-10-11T20:50:04.000Z",
"pendingAccess": [
"string"
]
},
"contacts": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"type": "sms",
"address": "string",
"verified": true,
"lastSeenAt": "2026-10-11T20:50:04.000Z"
}
],
"rules": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"channel": "push",
"delaySeconds": 1,
"priority": "urgent"
}
],
"teams": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string"
}
]
}Errors: 401403404
/v1/users/{id}admin keyUpdate a person
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
name | string | |
timezone | string | |
email | string | |
role | "responder" | "admin" | |
access | string[] | |
invited | boolean |
curl -X PATCH $TREASON_API_URL/v1/users/:id \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","timezone":"string","email":"string","role":"responder","access":["string"],"invited":true}'await treason.users.update(id, { role: "admin" });{
"user": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"timezone": "string",
"email": "string",
"role": "responder",
"archived": true,
"createdAt": "2026-10-11T20:50:04.000Z",
"externalId": "string",
"invitedAt": "2026-10-11T20:50:04.000Z",
"pendingAccess": [
"string"
]
}
}Errors: 401403404422
/v1/users/{id}admin keyRemove a person
Stops all paging for them and removes them from teams and schedules. History is kept.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X DELETE $TREASON_API_URL/v1/users/:id \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.users.delete(id);Response 204: no body.
Errors: 401403404
/v1/users/{id}/contactsadmin keyAdd a phone number or Slack member
A phone number gets a verification code by text first; alerts are never sent to an unverified number.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X POST $TREASON_API_URL/v1/users/:id/contacts \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"phone","number":"string"}'await treason.users.addPhone(id, "+14155550123"); // or addSlack(id, "U012ABCDE"){
"contacts": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"type": "sms",
"address": "string",
"verified": true,
"lastSeenAt": "2026-10-11T20:50:04.000Z"
}
]
}Errors: 401403404422
/v1/users/{id}/contacts/{cid}/verifyadmin keyVerify a phone number
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) | |
cid* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
code* | string |
curl -X POST $TREASON_API_URL/v1/users/:id/contacts/:cid/verify \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"code":"string"}'await treason.users.verifyContact(id, contactId, "123456");{
"verified": true
}Errors: 401403404422
/v1/users/{id}/contacts/{cid}/resendadmin keySend a new verification code
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) | |
cid* | path | string (uuid) |
curl -X POST $TREASON_API_URL/v1/users/:id/contacts/:cid/resend \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.users.resendCode(id, contactId);{
"sent": true
}Errors: 401403404429
/v1/users/{id}/contacts/{cid}admin keyRemove a contact
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) | |
cid* | path | string (uuid) |
curl -X DELETE $TREASON_API_URL/v1/users/:id/contacts/:cid \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.users.removeContact(id, contactId);Response 204: no body.
Errors: 401403404
/v1/users/{id}/rulesread keyGet how a person is paged
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl $TREASON_API_URL/v1/users/:id/rules \
-H "Authorization: Bearer $TREASON_API_KEY"const { rules } = await treason.users.rules(id);{
"rules": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"channel": "push",
"delaySeconds": 1,
"priority": "urgent"
}
]
}Errors: 401403404
/v1/users/{id}/rulesadmin keySet how a person is paged
The order and timing of push, text and call for P1 to P3 alerts. Without rules the default is push now, text after 2 minutes, call after 5.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
rules* | object[] |
curl -X PUT $TREASON_API_URL/v1/users/:id/rules \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"rules":[{"channel":"push","delaySeconds":1,"priority":"urgent"}]}'await treason.users.setRules(id, [{ channel: "push", delaySeconds: 0 }, { channel: "sms", delaySeconds: 120 }]);{
"rules": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"channel": "push",
"delaySeconds": 1,
"priority": "urgent"
}
]
}Errors: 401403404422
/v1/users/{id}/pairing-codesadmin keyCreate a code to pair the mobile app
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X POST $TREASON_API_URL/v1/users/:id/pairing-codes \
-H "Authorization: Bearer $TREASON_API_KEY"const { code } = await treason.users.pairingCode(id);{
"code": "string",
"expiresAt": "2026-10-11T20:50:04.000Z"
}Errors: 401403404
/v1/teamsadmin keyCreate a team
| Field | Type | Description |
|---|---|---|
name* | string |
curl -X POST $TREASON_API_URL/v1/teams \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string"}'const { team } = await treason.teams.create("Payments");{
"team": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"memberIds": [
"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"
]
}
}Errors: 401403409422
/v1/teamsread keyList teams
curl $TREASON_API_URL/v1/teams \
-H "Authorization: Bearer $TREASON_API_KEY"const { teams } = await treason.teams.list();{
"teams": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"memberIds": [
"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"
]
}
]
}Errors: 401403
/v1/teams/{id}admin keyRename a team
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
name* | string |
curl -X PATCH $TREASON_API_URL/v1/teams/:id \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string"}'await treason.teams.rename(id, "Payments Platform");{
"team": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"memberIds": [
"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"
]
}
}Errors: 401403404409422
/v1/teams/{id}admin keyDelete a team
Refused while integrations, schedules or a policy still use it.
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X DELETE $TREASON_API_URL/v1/teams/:id \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.teams.delete(id);Response 204: no body.
Errors: 401403404409
/v1/teams/{id}/membersadmin keySet a team's members
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
userIds* | string (uuid)[] |
curl -X PUT $TREASON_API_URL/v1/teams/:id/members \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"userIds":["5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"]}'await treason.teams.setMembers(id, [ana.id, bo.id]);{
"memberIds": [
"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11"
]
}Errors: 401403404422
Integrations
/v1/integrationsadmin keyCreate an alert source
inbound is the native endpoint for a monitoring tool (set source): it posts its own payload to /inbound/<source>?key=<key> and nothing needs translating. opsgenie_compat keys work with anything that speaks Opsgenie's API; email gives an address that turns mail into alerts. The key is shown once.
| Field | Type | Description |
|---|---|---|
name* | string | |
kind* | "opsgenie_compat" | "webhook" | "email" | "inbound" | |
teamId | string (uuid) | |
source | InboundSource | Which tool an inbound integration is the endpoint for. |
config | SourceConfig |
curl -X POST $TREASON_API_URL/v1/integrations \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","kind":"opsgenie_compat","teamId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","source":"alertmanager","config":{"defaultPriority":"P1","priorityMap":{},"insufficientData":"ignore","mapping":{"message":"string","alias":"string","description":"string","entity":"string","priority":"string","tags":"string","each":"string","resolveWhen":{"path":"string","values":[]},"priorityMap":{},"details":{}}}}'const { integration, key } = await treason.integrations.create({ name: "Alertmanager", kind: "opsgenie_compat", teamId });
// a native endpoint for a monitoring tool:
const { key: datadogKey } = await treason.integrations.createSource({ name: "Datadog", source: "datadog", teamId });{
"integration": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"kind": "opsgenie_compat",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"enabled": true,
"createdAt": "2026-10-11T20:50:04.000Z",
"emailAddress": "string",
"source": "alertmanager",
"config": {
"defaultPriority": "P1",
"priorityMap": {},
"insufficientData": "ignore",
"mapping": {
"message": "string",
"alias": "string",
"description": "string",
"entity": "string",
"priority": "string",
"tags": "string",
"each": "string",
"resolveWhen": {},
"priorityMap": {},
"details": {}
}
}
},
"key": "string"
}Errors: 401403422
/v1/integrationsread keyList alert sources
curl $TREASON_API_URL/v1/integrations \
-H "Authorization: Bearer $TREASON_API_KEY"const { integrations } = await treason.integrations.list();{
"integrations": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"kind": "opsgenie_compat",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"enabled": true,
"createdAt": "2026-10-11T20:50:04.000Z",
"emailAddress": "string",
"source": "alertmanager",
"config": {
"defaultPriority": "P1",
"priorityMap": {},
"insufficientData": "ignore",
"mapping": {}
}
}
]
}Errors: 401403
/v1/integrations/{id}admin keyUpdate an alert source
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
name | string | |
enabled | boolean | |
teamId | string (uuid) | null | |
config | SourceConfig |
curl -X PATCH $TREASON_API_URL/v1/integrations/:id \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","enabled":true,"teamId":"5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11","config":{"defaultPriority":"P1","priorityMap":{},"insufficientData":"ignore","mapping":{"message":"string","alias":"string","description":"string","entity":"string","priority":"string","tags":"string","each":"string","resolveWhen":{"path":"string","values":[]},"priorityMap":{},"details":{}}}}'await treason.integrations.update(id, { enabled: false });{
"integration": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"kind": "opsgenie_compat",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"enabled": true,
"createdAt": "2026-10-11T20:50:04.000Z",
"emailAddress": "string",
"source": "alertmanager",
"config": {
"defaultPriority": "P1",
"priorityMap": {},
"insufficientData": "ignore",
"mapping": {
"message": "string",
"alias": "string",
"description": "string",
"entity": "string",
"priority": "string",
"tags": "string",
"each": "string",
"resolveWhen": {},
"priorityMap": {},
"details": {}
}
}
}
}Errors: 401403404422
/v1/integrations/{id}admin keyDelete an alert source
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X DELETE $TREASON_API_URL/v1/integrations/:id \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.integrations.delete(id);Response 204: no body.
Errors: 401403404409
/v1/integrations/{id}/rotate-keyadmin keyReplace an alert source's key
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X POST $TREASON_API_URL/v1/integrations/:id/rotate-key \
-H "Authorization: Bearer $TREASON_API_KEY"const { key } = await treason.integrations.rotateKey(id);{
"integration": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"kind": "opsgenie_compat",
"teamId": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"enabled": true,
"createdAt": "2026-10-11T20:50:04.000Z",
"emailAddress": "string",
"source": "alertmanager",
"config": {
"defaultPriority": "P1",
"priorityMap": {},
"insufficientData": "ignore",
"mapping": {
"message": "string",
"alias": "string",
"description": "string",
"entity": "string",
"priority": "string",
"tags": "string",
"each": "string",
"resolveWhen": {},
"priorityMap": {},
"details": {}
}
}
},
"key": "string"
}Errors: 401403404
/v1/inbound/previewadmin keyPreview what a payload would do
Reads a sample payload the way an inbound integration would, and returns the alerts it would open or close, without creating anything. Use it to check a generic mapping or a Datadog template before pointing a tool at the endpoint.
| Field | Type | Description |
|---|---|---|
source* | InboundSource | Which tool an inbound integration is the endpoint for. |
payload* | any | The JSON the tool would send. |
headers | object | Headers that matter to the source, such as Sentry-Hook-Resource. |
config | SourceConfig |
curl -X POST $TREASON_API_URL/v1/inbound/preview \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"source":"alertmanager","payload":null,"headers":{},"config":{"defaultPriority":"P1","priorityMap":{},"insufficientData":"ignore","mapping":{"message":"string","alias":"string","description":"string","entity":"string","priority":"string","tags":"string","each":"string","resolveWhen":{"path":"string","values":[]},"priorityMap":{},"details":{}}}}'const { events } = await treason.integrations.preview({ source: "datadog", payload: sampleBody });{
"outcome": "events",
"reason": "string",
"events": [
{
"action": "trigger",
"alias": "string",
"message": "string",
"priority": "P1",
"description": "string",
"tags": [
"string"
],
"entity": "string",
"details": {}
}
]
}Errors: 401403422
Webhooks
/v1/webhooksadmin keyCreate a webhook endpoint
We POST each event to your https URL, signed with the returned secret (shown once). See the Webhooks guide for verification.
| Field | Type | Description |
|---|---|---|
url* | string (uri) | |
events | string[] | |
enabled | boolean |
curl -X POST $TREASON_API_URL/v1/webhooks \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/hooks/treason","events":["string"],"enabled":true}'const { webhook, secret } = await treason.webhookEndpoints.create({ url: "https://example.com/hooks/treason", events: ["alert.acknowledged"] });{
"webhook": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"url": "string",
"events": [
"alert.created"
],
"enabled": true,
"createdAt": "2026-10-11T20:50:04.000Z"
},
"secret": "string"
}Errors: 401403422
/v1/webhooksread keyList webhook endpoints
curl $TREASON_API_URL/v1/webhooks \
-H "Authorization: Bearer $TREASON_API_KEY"const { webhooks } = await treason.webhookEndpoints.list();{
"webhooks": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"url": "string",
"events": [
"alert.created"
],
"enabled": true,
"createdAt": "2026-10-11T20:50:04.000Z"
}
]
}Errors: 401403
/v1/webhooks/{id}admin keyUpdate a webhook endpoint
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
| Field | Type | Description |
|---|---|---|
url | string | |
events | string[] | |
enabled | boolean |
curl -X PATCH $TREASON_API_URL/v1/webhooks/:id \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"string","events":["string"],"enabled":true}'await treason.webhookEndpoints.update(id, { enabled: false });{
"webhook": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"url": "string",
"events": [
"alert.created"
],
"enabled": true,
"createdAt": "2026-10-11T20:50:04.000Z"
}
}Errors: 401403404422
/v1/webhooks/{id}admin keyDelete a webhook endpoint
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X DELETE $TREASON_API_URL/v1/webhooks/:id \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.webhookEndpoints.delete(id);Response 204: no body.
Errors: 401403404
Keys and organization
/v1/api-keysadmin keyCreate an API key
Scopes are not a ladder: alert creates, acknowledges, closes and reads alerts and pings heartbeats; read reads everything; admin does everything. The key is shown once.
| Field | Type | Description |
|---|---|---|
name* | string | |
scope* | "read" | "alert" | "admin" |
curl -X POST $TREASON_API_URL/v1/api-keys \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","scope":"read"}'const { apiKey, key } = await treason.apiKeys.create({ name: "deploy bot", scope: "alert" });{
"apiKey": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"scope": "read",
"prefix": "string",
"createdAt": "2026-10-11T20:50:04.000Z",
"revokedAt": "2026-10-11T20:50:04.000Z"
},
"key": "string"
}Errors: 401403422
/v1/api-keysadmin keyList API keys
curl $TREASON_API_URL/v1/api-keys \
-H "Authorization: Bearer $TREASON_API_KEY"const { apiKeys } = await treason.apiKeys.list();{
"apiKeys": [
{
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"scope": "read",
"prefix": "string",
"createdAt": "2026-10-11T20:50:04.000Z",
"revokedAt": "2026-10-11T20:50:04.000Z"
}
]
}Errors: 401403
/v1/api-keys/{id}admin keyRevoke an API key
| Name | In | Type | Description |
|---|---|---|---|
id* | path | string (uuid) |
curl -X DELETE $TREASON_API_URL/v1/api-keys/:id \
-H "Authorization: Bearer $TREASON_API_KEY"await treason.apiKeys.revoke(id);Response 204: no body.
Errors: 401403404
/v1/orgread keyGet the organization
curl $TREASON_API_URL/v1/org \
-H "Authorization: Bearer $TREASON_API_KEY"const { org } = await treason.account.org();{
"org": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"plan": "string",
"allowInternational": true,
"flapThreshold": 1,
"flapWindowMinutes": 1,
"flapHoldMinutes": 1,
"preshiftTestHours": 1
}
}Errors: 401403
/v1/orgadmin keyUpdate the organization
| Field | Type | Description |
|---|---|---|
name | string | |
allowInternational | boolean | |
flapThreshold | integer | |
flapWindowMinutes | integer | |
flapHoldMinutes | integer |
curl -X PATCH $TREASON_API_URL/v1/org \
-H "Authorization: Bearer $TREASON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","allowInternational":true,"flapThreshold":1,"flapWindowMinutes":1,"flapHoldMinutes":1}'await treason.account.updateOrg({ allowInternational: true });{
"org": {
"id": "5b0f0c5e-6c6e-5a3e-9f2b-0f6d6a2c9d11",
"name": "string",
"plan": "string",
"allowInternational": true,
"flapThreshold": 1,
"flapWindowMinutes": 1,
"flapHoldMinutes": 1,
"preshiftTestHours": 1
}
}Errors: 401403422
/v1/usageread keyUsage for a month
| Name | In | Type | Description |
|---|---|---|---|
period | query | string | YYYY-MM. Defaults to this month. |
curl $TREASON_API_URL/v1/usage \
-H "Authorization: Bearer $TREASON_API_KEY"const usage = await treason.account.usage("2026-10");{
"period": "string",
"units": [
{
"unit": "string",
"quantity": 1
}
],
"carrierCostMicros": 1
}Errors: 401403
/v1/auditread keyRecent configuration changes
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer |
curl $TREASON_API_URL/v1/audit \
-H "Authorization: Bearer $TREASON_API_KEY"const { events } = await treason.account.audit(50);{
"events": [
{
"id": 1,
"actor": "string",
"action": "string",
"entity": "string",
"entityId": "string",
"payload": {},
"createdAt": "2026-10-11T20:50:04.000Z"
}
]
}Errors: 401403
Objects
Alert
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
alias* | string | De-duplication key. A repeat with the same alias bumps dedupCount instead of paging again. |
tinyId* | integer | The short number people say out loud, such as 4821. |
status* | "open" | "acknowledged" | "exhausted" | "closed" | "suppressed" | |
priority* | "P1" | "P2" | "P3" | "P4" | "P5" | P1 pages now; P4 and P5 only push. |
message* | string | |
description* | string | null | |
entity* | string | null | |
source* | string | null | |
tags* | string[] | |
details* | object | |
dedupCount* | integer | |
createdAt* | string (date-time) | |
acknowledgedAt* | string (date-time) | null | |
closedAt* | string (date-time) | null | |
acknowledgedVia* | string | null | api, sms, voice, app, slack or snooze. |
acknowledgedBy* | AcknowledgedBy | Who acknowledged it. Null until someone does. |
teamId | string (uuid) | |
isTest | boolean | A test page. These are left out of lists, counts, reports and billing. |
suppressedBy* | string | null | Set while status is suppressed: maintenance:<id>, rule:<id>, group:<alert id> or flapping. A held alert is recorded but pages nobody. |
snoozedUntil* | string (date-time) | null | Set while an acknowledged alert is snoozed: it pages again at this time if it is still open. |
AcknowledgedBy
| Field | Type | Description |
|---|---|---|
actor* | string | Who did it, as recorded: sms:<user id>, app:<user id>, dashboard:<sign-in>, api_key:<id> and so on. |
userId* | string (uuid) | null | The person, when it was one (a phone, the app, Slack, a signed-in dashboard user, or the API naming a user). Null for an API key or an integration. |
name* | string | null | That person's name. |
AlertEvent
| Field | Type | Description |
|---|---|---|
id* | integer | |
type* | string | created, deduped, escalated, notified, delivered, acknowledged, closed, noted, suppressed, released, routed, grouped, snoozed, approval_requested, approval_vote, approval_decided. |
actor* | string | |
payload* | object | |
createdAt* | string (date-time) |
NotificationAttempt
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
userId* | string (uuid) | |
step* | integer | |
channel* | "push" | "sms" | "voice" | "slack" | |
carrier* | string | null | |
kind* | "page" | "summary" | |
status* | string | queued, sent, delivered, answered, failed, no_receipt, no_answer, collapsed. |
attemptNo* | integer | |
costMicros* | integer | null | |
error* | string | null | |
sentAt* | string (date-time) | null | |
deliveredAt* | string (date-time) | null | |
createdAt* | string (date-time) | |
why* | Why | null | Why this person was notified this way. Null for notifications sent before this was recorded. |
Why
| Field | Type | Description |
|---|---|---|
kind* | "schedule" | "user" | "team" | "responder" | "admin_notice" | "test" | "heartbeat" | |
policy | string | The escalation policy that paged them. |
step | integer | 1-based. |
round | integer | 0 on the first pass of the policy. |
scheduleId | string (uuid) | |
scheduleName | string | |
via | "override" | "rotation" | For schedule: what made them the person on call. |
teamName | string | |
routedByRule | boolean | A routing rule sent the alert to this team's policy. |
rule | object | |
text* | string | The whole answer as a sentence. |
CreateAlert
| Field | Type | Description |
|---|---|---|
message* | string | What happened, in a sentence. Kept to 130 characters; longer text is not lost, it is kept in full in the description. |
alias | string | De-duplication key. Without one, every request is a new alert. |
description | string | Up to 15,000 characters. |
entity | string | What it is about: a host, a service, a job. |
source | string | Where it came from. |
priority | "P1" | "P2" | "P3" | "P4" | "P5" | P1 pages now; P4 and P5 only push. |
tags | string[] | |
details | object | Free-form key/value context. |
note | string | Added as a note on the alert. |
user | string | Who to record as the actor. |
teamId | string (uuid) | Which team to page. Optional when the organization has exactly one team. |
User
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
name* | string | |
timezone* | string | An IANA zone, like America/New_York. |
email* | string | null | |
role* | "responder" | "admin" | |
archived* | boolean | |
createdAt* | string (date-time) | |
externalId* | string | null | The sign-in account linked to this person, once they have joined. |
invitedAt* | string (date-time) | null | |
pendingAccess* | string[] | null | What they may do once they accept their invitation. |
Contact
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
type* | "sms" | "voice" | "push" | "slack" | |
address* | string | Masked for phones. |
verified* | boolean | |
lastSeenAt* | string (date-time) | null |
Rule
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
channel* | "push" | "sms" | "voice" | |
delaySeconds* | integer | |
priority* | "urgent" | "low" |
Team
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
name* | string | |
memberIds* | string (uuid)[] |
RotationLayer
| Field | Type | Description |
|---|---|---|
order* | integer | |
rotationStart* | string (date-time) | When the first shift begins, at the handoff time. |
handoffTime* | string | HH:MM in the schedule's time zone. |
rotationLength* | object | |
members* | string (uuid)[] |
Override
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
userId* | string (uuid) | |
startsAt* | string (date-time) | |
endsAt* | string (date-time) |
Schedule
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
name* | string | |
teamId* | string (uuid) | null | |
timezone* | string | |
layers* | RotationLayer[] | |
overrides* | Override[] | |
onCall* | string (uuid) | null | Who is on call right now (or at at). |
ScheduleInput
| Field | Type | Description |
|---|---|---|
name* | string | |
teamId | string (uuid) | null | |
timezone | string | Default UTC. |
layers* | object[] |
PolicyStep
| Field | Type | Description |
|---|---|---|
delayMinutes* | integer | Wait this long for an acknowledgement, then go to the next step. |
targets* | object[] |
EscalationPolicyInput
| Field | Type | Description |
|---|---|---|
name* | string | |
teamId* | string (uuid) | |
repeatCount | integer | How many times to start over if nobody answers (default 0: tell admins and stop). |
steps* | PolicyStep[] |
EscalationPolicy
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
name* | string | |
teamId* | string (uuid) | |
repeatCount* | integer | |
steps* | PolicyStep[] |
InboundSource
SourceConfig
| Field | Type | Description |
|---|---|---|
defaultPriority | "P1" | "P2" | "P3" | "P4" | "P5" | P1 pages now; P4 and P5 only push. |
priorityMap | object | Maps the tool's own severity words (critical, Sev1...) to a priority. Wins over the built-in map. |
insufficientData | "ignore" | "trigger" | CloudWatch only: what to do with INSUFFICIENT_DATA. Default ignore. |
mapping | GenericMapping |
GenericMapping
| Field | Type | Description |
|---|---|---|
message* | string | A JSON path ($.alert.title), a template ({{ $.name }} is {{ $.status }}) or literal text. |
alias | string | Same alert, same alias. Defaults to a digest of the message. |
description | string | |
entity | string | |
priority | string | What to read; mapped through priorityMap, or understood as P1-P5 or a severity word. |
tags | string | A path to an array of strings or a comma-separated string. |
each | string | A path to an array holding one alert per element; other paths are then relative to each element. |
resolveWhen | object | |
priorityMap | object | |
details | object | Extra fields to keep on the alert: { name: path }. |
Integration
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
name* | string | |
kind* | "opsgenie_compat" | "webhook" | "email" | "inbound" | |
teamId* | string (uuid) | null | |
enabled* | boolean | |
createdAt* | string (date-time) | |
emailAddress | string | |
source | InboundSource | Which tool an inbound integration is the endpoint for. |
config | SourceConfig |
InboundPreview
| Field | Type | Description |
|---|---|---|
outcome* | "events" | "ignored" | "confirm" | |
reason | string | |
events* | object[] |
Webhook
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
url* | string | |
events* | "alert.created" | "alert.acknowledged" | "alert.closed" | "alert.exhausted" | "notification.failed" | "approval.requested" | "approval.decided" | "coverage.requested" | "coverage.accepted" | "coverage.cancelled" | "handoff.note"[] | |
enabled* | boolean | |
createdAt* | string (date-time) |
ApiKey
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
name* | string | |
scope* | "read" | "alert" | "admin" | |
prefix* | string | |
createdAt* | string (date-time) | |
revokedAt* | string (date-time) | null |
Org
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
name* | string | |
plan* | string | |
allowInternational* | boolean | |
flapThreshold* | integer | 0 turns flapping control off. Otherwise: an alias that opens this many times within flapWindowMinutes is held. |
flapWindowMinutes* | integer | |
flapHoldMinutes* | integer | How long a flapping alert is held before it pages if it is still open. |
preshiftTestHours* | integer | 0 is off. Otherwise someone about to go on call within this many hours gets a quiet push test (daytime only, at most weekly). |
ApprovalInput
| Field | Type | Description |
|---|---|---|
title* | string | The question, in a sentence. |
description | string | |
context | object | What the human should see before deciding: the diff, the command, the amount. Up to 8 KB. |
teamId | string (uuid) | Page this team's escalation policy. Optional with a single team, or with relatedAlertId. |
userIds | string (uuid)[] | |
relatedAlertId | string (uuid) | The alert this question is about. The request and the answer go into its timeline; the approval is filed under its team and pages whoever acknowledged it first, unless teamId or userIds say otherwise. |
priority | "P1" | "P2" | "P3" | "P4" | "P5" | P1 pages now; P4 and P5 only push. |
timeoutSeconds | integer | 30 to 604800. Default 3600. |
onTimeout | "deny" | "approve" | What a timeout means. deny is the safe default. |
required | integer | Approvals needed. Any denial denies at once. Default 1. |
deciders | string (uuid)[] | Who may answer by text, call or app. Default: whoever was paged. |
Approval
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
title* | string | |
description* | string | null | |
context* | object | |
status* | "pending" | "approved" | "denied" | "expired" | "cancelled" | |
decision* | "approve" | "deny" | "null" | null | The effective answer: the human's, or for expired what onTimeout says. Null while pending or cancelled. |
requiredApprovals* | integer | |
approvals* | integer | |
votes* | object[] | |
deciders* | string (uuid)[] | null | |
onTimeout* | "deny" | "approve" | |
timeoutAt* | string (date-time) | |
alertId* | string (uuid) | null | The page that asks the question. |
alertNumber* | integer | null | |
relatedAlertId* | string (uuid) | null | The alert the question is about, if the request named one. |
relatedAlertNumber* | integer | null | |
requester* | string | |
createdAt* | string (date-time) | |
decidedAt* | string (date-time) | null | |
decidedBy* | string | null | |
note* | string | null |
CoverageInput
| Field | Type | Description |
|---|---|---|
requesterId* | string (uuid) | Whose on-call time this is. They must be on call at some point in the window. |
startsAt* | string (date-time) | |
endsAt* | string (date-time) | |
note | string | Why, for whoever sees the request. |
offeredTo | string (uuid) | Ask one person (they accept or decline). Omit to ask anyone on the schedule's team. |
Coverage
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
scheduleId* | string (uuid) | |
scheduleName* | string | null | |
requester* | object | |
startsAt* | string (date-time) | |
endsAt* | string (date-time) | |
note* | string | null | |
offeredTo* | object | null | |
status* | "open" | "accepted" | "declined" | "cancelled" | "expired" | |
takenBy* | object | null | |
createdAt* | string (date-time) | |
resolvedAt* | string (date-time) | null |
HandoffNote
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
teamId* | string (uuid) | |
author* | string | |
authorId* | string (uuid) | null | |
body* | string | |
createdAt* | string (date-time) |
CalendarFeed
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
label* | string | |
scheduleId* | string (uuid) | null | |
teamId* | string (uuid) | null | |
userId* | string (uuid) | null | |
createdAt* | string (date-time) | |
lastReadAt* | string (date-time) | null |
LoadReport
| Field | Type | Description |
|---|---|---|
period* | object | |
totals* | object | |
people* | object[] | |
suggestions* | object[] |
Check
| Field | Type | Description |
|---|---|---|
id* | string | |
status* | "ok" | "info" | "warn" | "fail" | |
title* | string | |
detail* | string | |
fix | string |
TestResult
| Field | Type | Description |
|---|---|---|
alertId* | string (uuid) | |
at* | string (date-time) | |
outcome* | "pending" | "passed" | "failed" | |
acknowledged* | boolean | |
acknowledgedAfterSeconds* | integer | null | |
channels* | object[] |
Readiness
| Field | Type | Description |
|---|---|---|
userId* | string (uuid) | |
name* | string | |
level* | "ready" | "warnings" | "at_risk" | "unreachable" | unreachable: nothing verified to reach them by. at_risk: a check failed. warnings: reachable, but fragile. |
checks* | Check[] | |
lastTest* | object | null |
OrgReadiness
| Field | Type | Description |
|---|---|---|
generatedAt* | string (date-time) | |
summary* | object | |
onCallNow* | object[] | |
people* | object[] | |
gaps* | object[] |
NoiseReport
| Field | Type | Description |
|---|---|---|
period* | object | |
totals* | object | |
integrations* | object[] | |
topAliases* | object[] | |
suggestions* | object[] |
Condition
| Field | Type | Description |
|---|---|---|
field* | "message" | "description" | "alias" | "source" | "entity" | "priority" | "integration" | "team" | "tag" | "detail" | "time" | |
key | string | For detail: which detail. |
op | "is" | "is_not" | "contains" | "not_contains" | "glob" | "in" | "exists" | "not_exists" | Case-insensitive. glob supports * and ?. exists and not_exists are for tags and details. |
value | string | string[] | Text, or a list for in. integration and team conditions take ids. |
timezone | string | For time. |
days | integer[] | For time: 0 is Sunday. Omit for every day. |
from | string | For time: HH:MM. |
to | string | For time: HH:MM. Earlier than from runs past midnight. |
Recurrence
| Field | Type | Description |
|---|---|---|
days | integer[] | |
time* | string | HH:MM in timezone. |
durationMinutes* | integer | |
timezone* | string |
MaintenanceWindowInput
| Field | Type | Description |
|---|---|---|
name* | string | |
startsAt | string (date-time) | A one-off window: start... |
endsAt | string (date-time) | ...and end. |
recurrence | Recurrence | |
teamId | string (uuid) | null | |
integrationId | string (uuid) | null | |
conditions | Condition[] | All must match. Empty: every alert in scope. |
onEnd | "release" | "discard" | What happens to alerts still firing when the window ends: page for them (default) or drop them. |
MaintenanceWindow
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
name* | string | |
startsAt* | string (date-time) | null | |
endsAt* | string (date-time) | null | |
recurrence* | Recurrence | null | |
teamId* | string (uuid) | null | |
integrationId* | string (uuid) | null | |
conditions* | Condition[] | |
onEnd* | "release" | "discard" | |
active* | boolean | In effect right now. |
activeUntil* | string (date-time) | null | |
createdBy* | string | null | |
createdAt* | string (date-time) |
RuleActions
| Field | Type | Description |
|---|---|---|
routeToTeamId | string (uuid) | Page this team's escalation policy instead of the integration's. |
setPriority | "P1" | "P2" | "P3" | "P4" | "P5" | P1 pages now; P4 and P5 only push. |
suppress | boolean | Record the alert but never page for it. |
addTags | string[] | |
groupBy | string[] | One page per group: the first alert pages, later ones attach to it until it closes. Fields: message, alias, source, entity, priority, integration, team, tag:<name>, detail:<key>. |
groupWindowMinutes | integer | How long after the first alert others join its group. Default 10. |
RoutingRuleInput
| Field | Type | Description |
|---|---|---|
name* | string | |
integrationId | string (uuid) | null | |
conditions | Condition[] | |
actions* | RuleActions | |
stop | boolean | Stop evaluating later rules after this one matches. |
enabled | boolean |
RoutingRule
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | |
name* | string | |
position* | integer | |
enabled* | boolean | |
integrationId* | string (uuid) | null | |
conditions* | Condition[] | |
actions* | RuleActions | |
stop* | boolean | |
createdAt* | string (date-time) |
Heartbeat
| Field | Type | Description |
|---|---|---|
name* | string | |
teamId* | string (uuid) | null | |
intervalSeconds* | integer | How often a ping is expected. |
graceSeconds* | integer | Extra time allowed before it counts as missed. |
priority* | "P1" | "P2" | "P3" | "P4" | "P5" | P1 pages now; P4 and P5 only push. |
message* | string | null | Custom alert text. |
enabled* | boolean | |
state* | "new" | "up" | "down" | new until the first ping; down while its alert is open. |
lastPingAt* | string (date-time) | null | |
downSince* | string (date-time) | null | |
dueAt* | string (date-time) | When the next ping must arrive by. |
createdAt* | string (date-time) |
HeartbeatInput
| Field | Type | Description |
|---|---|---|
intervalSeconds* | integer | Between 10 seconds and one year. |
graceSeconds | integer | |
priority | "P1" | "P2" | "P3" | "P4" | "P5" | P1 pages now; P4 and P5 only push. |
message | string | null | |
enabled | boolean | |
teamId | string (uuid) | null |
WebhookEvent
| Field | Type | Description |
|---|---|---|
id* | string (uuid) | Unique per delivery attempt group: use it to de-duplicate. |
type* | "alert.created" | "alert.acknowledged" | "alert.closed" | "alert.exhausted" | "notification.failed" | "approval.requested" | "approval.decided" | "coverage.requested" | "coverage.accepted" | "coverage.cancelled" | "handoff.note" | |
occurredAt* | string (date-time) | |
data* | object |