{
  "openapi": "3.1.0",
  "info": {
    "title": "TeamPager API",
    "version": "1.0.0",
    "description": "Read your on-call, respond to pages and manage boards, people and heartbeats from scripts, Terraform or an AI agent.\n\n**Authentication.** An owner creates an API key in the app (Organization → Integrations → API keys). Send it on every request as `Authorization: Bearer tpk_…`. A key belongs to the organization, not to a person; what it changes is signed with its name in Activity. Keep keys on servers and in secret stores, never in a web page.\n\n**Access.** Each key has one access level: *Read* (every GET), *Respond to pages* (Read, plus acknowledge, resolve and reopen pages), or *Read and write* (everything). A key without the access an operation needs gets `403 insufficient_scope`.\n\n**Limits.** 60 requests a minute per key and 120 for the whole organization; a write counts as two. Over that: `429 rate_limited` with `Retry-After` in seconds. Every answer carries `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`. Up to 10 active keys per organization. Same limits on every plan. Plan limits (people on rotas, boards, pages a month, heartbeats) apply exactly as in the app.\n\n**Retries.** Send `Idempotency-Key: <any unique string>` on a POST. Replaying the same request within 24 hours returns the first answer (with `Idempotent-Replayed: true`) instead of doing it twice; the same key with a different body is `422 idempotency_key_reused`.\n\n**Errors.** Always `{\"error\": {\"code\", \"message\", \"requestId\", \"details\"?}}`. Branch on `code`. An id from another organization is `404 not_found`. Unknown fields in a body are `400 unknown_fields`.\n\n**Ids.** Every id is stable. Phone numbers come back masked (`+1 ••• ••• 0344`).",
    "contact": {
      "email": "support@teampager.io"
    }
  },
  "servers": [
    {
      "url": "https://api.teampager.io",
      "description": "Production"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "On call",
      "description": "Who has the pager."
    },
    {
      "name": "Pages",
      "description": "Pages (alerts): list, acknowledge, resolve, reopen, or page someone."
    },
    {
      "name": "Boards",
      "description": "Boards (on-call schedules), their rotas, coverage and escalation chains."
    },
    {
      "name": "Time off",
      "description": "Absences: the person's slots become holes, nothing slides."
    },
    {
      "name": "People",
      "description": "The directory, how we reach each person, and mutes."
    },
    {
      "name": "Heartbeats",
      "description": "Pages when a job stops checking in."
    }
  ],
  "paths": {
    "/v1/on-call": {
      "get": {
        "operationId": "getOnCall",
        "tags": [
          "On call"
        ],
        "summary": "Who is on call right now on every board, and who is next.",
        "description": "The quickest answer to \"who do I call?\": one entry per board, one line per rota.",
        "x-teampager-access": "read",
        "x-teampager-access-text": "Any key (Read, Respond to pages, Read and write).",
        "responses": {
          "200": {
            "description": "Who is on call on every board.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnCallList"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/boards": {
      "get": {
        "operationId": "listBoards",
        "tags": [
          "Boards"
        ],
        "summary": "List the boards (schedules) with their rotas and who is on call now.",
        "x-teampager-access": "read",
        "x-teampager-access-text": "Any key (Read, Respond to pages, Read and write).",
        "responses": {
          "200": {
            "description": "Every board.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoardList"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createBoard",
        "tags": [
          "Boards"
        ],
        "summary": "Create a board with its first rota (members are person ids, in order).",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string (1–255 characters). Makes a retry safe for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "timezone": {
                    "type": "string",
                    "description": "IANA time zone. Default: the organization's."
                  },
                  "members": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Person id."
                    },
                    "description": "People who take turns, in order. At least one."
                  },
                  "handover": {
                    "type": "object",
                    "properties": {
                      "weekday": {
                        "type": "integer",
                        "description": "0 = Monday … 6 = Sunday.",
                        "minimum": 0,
                        "maximum": 6
                      },
                      "time": {
                        "type": "string",
                        "description": "`HH:MM`, local."
                      }
                    },
                    "additionalProperties": false
                  },
                  "slotUnit": {
                    "type": "string",
                    "enum": [
                      "week",
                      "day",
                      "hours_12",
                      "hours_8"
                    ],
                    "description": "Default `week`."
                  }
                },
                "required": [
                  "name",
                  "members"
                ],
                "additionalProperties": false
              },
              "example": {
                "name": "Platform",
                "timezone": "America/Toronto",
                "members": [
                  "$PERSON_ID"
                ],
                "handover": {
                  "weekday": 0,
                  "time": "09:00"
                },
                "slotUnit": "week"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new board.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoardDetail"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`, `invalid_name`, `invalid_members`, `invalid_handover`, `invalid_timezone`, `invalid_slot_unit`, `invalid_handover_weekday`, `invalid_handover_time`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`, `quota_schedules`, `quota_members`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_flight`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/boards/{id}": {
      "get": {
        "operationId": "getBoard",
        "tags": [
          "Boards"
        ],
        "summary": "One board: rotas, absences and the upcoming slots (forecast).",
        "description": "Use a slot's `startsAt` to change who covers it.",
        "x-teampager-access": "read",
        "x-teampager-access-text": "Any key (Read, Respond to pages, Read and write).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Board id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The board.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoardDetail"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateBoard",
        "tags": [
          "Boards"
        ],
        "summary": "Rename, pause or resume a board, or change a rota's members, timezone, handover or slot length.",
        "description": "Send only what changes. `members`, `handover` and `slotUnit` apply to `rotaId` (default: the first rota). Slots already planned keep their person; use coverage to change one slot.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Board id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "members": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Person id."
                    },
                    "description": "Replaces the rota's members, in order."
                  },
                  "handover": {
                    "type": "object",
                    "properties": {
                      "weekday": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 6
                      },
                      "time": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  },
                  "slotUnit": {
                    "type": "string",
                    "enum": [
                      "week",
                      "day",
                      "hours_12",
                      "hours_8"
                    ]
                  },
                  "paused": {
                    "type": "boolean",
                    "description": "`true` pauses the board: it pages nobody."
                  },
                  "rotaId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "name": "Platform on call"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The board, updated.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoardDetail"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`, `empty_patch`, `invalid_members`, `empty_rota`, `band_not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`, `quota_members`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/boards/{id}/on-call": {
      "get": {
        "operationId": "getBoardOnCall",
        "tags": [
          "On call"
        ],
        "summary": "Who is on call on this board right now, until when, and who is next.",
        "x-teampager-access": "read",
        "x-teampager-access-text": "Any key (Read, Respond to pages, Read and write).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Board id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Who is on call on this board.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnCall"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/boards/{id}/chain": {
      "get": {
        "operationId": "getChain",
        "tags": [
          "Boards"
        ],
        "summary": "The escalation chain of each rota on this board: who is paged next if nobody acknowledges.",
        "x-teampager-access": "read",
        "x-teampager-access-text": "Any key (Read, Respond to pages, Read and write).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Board id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The escalation chain of each rota.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Chain"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "replaceChain",
        "tags": [
          "Boards"
        ],
        "summary": "Replace the escalation chain of one rota.",
        "description": "Step 1 is always whoever is on call; send the steps after it (0 to 3). Escalation stops after the last one. An empty or unreachable step stops the chain: it never jumps ahead.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Board id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rotaId": {
                    "type": "string",
                    "description": "Default: the first rota.",
                    "format": "uuid"
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "targetKind": {
                          "type": "string",
                          "enum": [
                            "next_on_rota",
                            "person",
                            "everyone_else",
                            "one_by_one"
                          ]
                        },
                        "personId": {
                          "type": "string",
                          "description": "Required for `person`, refused otherwise."
                        },
                        "waitMinutes": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "enum": [
                                2,
                                5,
                                10,
                                15,
                                30
                              ],
                              "description": "Null = the board's default."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "targetKind"
                      ],
                      "additionalProperties": false
                    },
                    "description": "0 to 3 steps, in order."
                  }
                },
                "required": [
                  "steps"
                ],
                "additionalProperties": false
              },
              "example": {
                "steps": [
                  {
                    "targetKind": "next_on_rota",
                    "waitMinutes": 5
                  },
                  {
                    "targetKind": "everyone_else",
                    "waitMinutes": 10
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The chain, as stored.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Chain"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`, `invalid_steps`, `chain_too_long`, `invalid_target_kind`, `invalid_target_person`, `invalid_wait_minutes`, `duplicate_target`, `unknown_person`, `band_not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/people": {
      "get": {
        "operationId": "listPeople",
        "tags": [
          "People"
        ],
        "summary": "List the people in the organization.",
        "x-teampager-access": "read",
        "x-teampager-access-text": "Any key (Read, Respond to pages, Read and write).",
        "parameters": [
          {
            "name": "includeRemoved",
            "in": "query",
            "required": false,
            "description": "`true` to include people who left.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The directory.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonList"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createPerson",
        "tags": [
          "People"
        ],
        "summary": "Add a person to the directory.",
        "description": "They can go on rotas and be paged. Nobody is invited, no email is sent, and they get no login. `email` and `mobile` become their first channels.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string (1–255 characters). Makes a retry safe for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "email": {
                    "type": "string",
                    "description": "Becomes their first email channel.",
                    "format": "email"
                  },
                  "mobile": {
                    "type": "string",
                    "description": "E.164, e.g. `+14165550123`. Becomes an unverified SMS channel."
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "example": {
                "name": "Sam Rivera",
                "email": "sam@example.com"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new person.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Person"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`, `invalid_display_name`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_flight`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/people/{personId}": {
      "get": {
        "operationId": "getPerson",
        "tags": [
          "People"
        ],
        "summary": "One person and how we reach them (phone numbers are masked).",
        "x-teampager-access": "read",
        "x-teampager-access-text": "Any key (Read, Respond to pages, Read and write).",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "required": true,
            "description": "Person id (from GET /v1/people).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The person and their channels.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonDetail"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "renamePerson",
        "tags": [
          "People"
        ],
        "summary": "Rename a person.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "required": true,
            "description": "Person id (from GET /v1/people).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "example": {
                "name": "Sam Rivera-Ortiz"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The person, renamed.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Person"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`, `invalid_name`, `invalid_display_name`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/people/{personId}/channels": {
      "get": {
        "operationId": "listChannels",
        "tags": [
          "People"
        ],
        "summary": "How we reach this person, in order (phone numbers are masked).",
        "x-teampager-access": "read",
        "x-teampager-access-text": "Any key (Read, Respond to pages, Read and write).",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "required": true,
            "description": "Person id (from GET /v1/people).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Their channels.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelList"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "addChannel",
        "tags": [
          "People"
        ],
        "summary": "Add an email, SMS or voice channel.",
        "description": "A phone stays unverified until the person enters the code in the app. SMS is coming soon: texts don't page anyone yet; voice calls do.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "required": true,
            "description": "Person id (from GET /v1/people).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string (1–255 characters). Makes a retry safe for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "email",
                      "sms",
                      "voice"
                    ]
                  },
                  "address": {
                    "type": "string",
                    "description": "Email address, or phone number in E.164."
                  },
                  "rung": {
                    "type": "integer",
                    "enum": [
                      1,
                      2,
                      3
                    ],
                    "description": "Default: 1 for email, 2 for SMS, 3 for voice."
                  },
                  "ttsLocale": {
                    "type": "string",
                    "enum": [
                      "en-US",
                      "fr-FR"
                    ],
                    "description": "Voice only: the language the call speaks. Default `en-US`."
                  }
                },
                "required": [
                  "kind",
                  "address"
                ],
                "additionalProperties": false
              },
              "example": {
                "kind": "voice",
                "address": "+14165550123"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The channel. A phone is unverified until the person enters the code in the app.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Channel"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`, `invalid_kind`, `invalid_address`, `invalid_tts_locale`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_flight`, `channel_exists`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/absences": {
      "get": {
        "operationId": "listAbsences",
        "tags": [
          "Time off"
        ],
        "summary": "Absences that apply to every board.",
        "description": "Absences on a single board are in GET /v1/boards/{id}.",
        "x-teampager-access": "read",
        "x-teampager-access-text": "Any key (Read, Respond to pages, Read and write).",
        "responses": {
          "200": {
            "description": "Organization-wide absences.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgAbsenceList"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/alerts": {
      "get": {
        "operationId": "listAlerts",
        "tags": [
          "Pages"
        ],
        "summary": "List pages, newest first.",
        "description": "Without `status`, returns the pages that still need someone (`open` and `acked`).",
        "x-teampager-access": "read",
        "x-teampager-access-text": "Any key (Read, Respond to pages, Read and write).",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "`active` (default: open and acked), `all`, or a comma-separated list of `open`, `acked`, `resolved`.",
            "schema": {
              "type": "string"
            },
            "example": "all"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100, default 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "example": "5"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`nextCursor` from the previous response.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pages, newest first.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertList"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_status`, `invalid_cursor`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/alerts/{id}": {
      "get": {
        "operationId": "getAlert",
        "tags": [
          "Pages"
        ],
        "summary": "One page and its state.",
        "x-teampager-access": "read",
        "x-teampager-access-text": "Any key (Read, Respond to pages, Read and write).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Page id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The page.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/heartbeats": {
      "get": {
        "operationId": "listHeartbeats",
        "tags": [
          "Heartbeats"
        ],
        "summary": "List heartbeats and their state.",
        "description": "The ping URL is never returned after creation.",
        "x-teampager-access": "read",
        "x-teampager-access-text": "Any key (Read, Respond to pages, Read and write).",
        "responses": {
          "200": {
            "description": "Every heartbeat.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeartbeatList"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createHeartbeat",
        "tags": [
          "Heartbeats"
        ],
        "summary": "Create a heartbeat.",
        "description": "The ping URL is in this response only. Save it: it can't be read again. A retry with the same `Idempotency-Key` answers `409 already_created`, without the URL.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string (1–255 characters). Makes a retry safe for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "intervalMinutes": {
                    "type": "integer",
                    "description": "How often your job pings.",
                    "minimum": 1,
                    "maximum": 10080
                  },
                  "graceMinutes": {
                    "type": "integer",
                    "description": "Extra time before we page.",
                    "minimum": 1,
                    "maximum": 1440
                  },
                  "boardId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "Board to page. Default: the organization's default board.",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "intervalMinutes",
                  "graceMinutes"
                ],
                "additionalProperties": false
              },
              "example": {
                "name": "nightly-backup",
                "intervalMinutes": 1440,
                "graceMinutes": 60
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The heartbeat and its ping URL (once).",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeartbeatCreated"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`, `invalid_name`, `invalid_interval`, `invalid_grace`, `invalid_schedule_id`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_flight`, `limit_reached`, `already_created`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/heartbeats/{id}": {
      "get": {
        "operationId": "getHeartbeat",
        "tags": [
          "Heartbeats"
        ],
        "summary": "One heartbeat and its state.",
        "x-teampager-access": "read",
        "x-teampager-access-text": "Any key (Read, Respond to pages, Read and write).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Heartbeat id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The heartbeat.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Heartbeat"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateHeartbeat",
        "tags": [
          "Heartbeats"
        ],
        "summary": "Rename, pause, resume or retime a heartbeat.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Heartbeat id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "intervalMinutes": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10080
                  },
                  "graceMinutes": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1440
                  },
                  "boardId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paused": {
                    "type": "boolean",
                    "description": "`true` pauses it: silence pages nobody."
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "paused": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The heartbeat, updated.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Heartbeat"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`, `invalid_name`, `invalid_interval`, `invalid_grace`, `invalid_paused`, `invalid_schedule_id`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteHeartbeat",
        "tags": [
          "Heartbeats"
        ],
        "summary": "Delete a heartbeat.",
        "description": "Deleting twice is not an error.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Heartbeat id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/alerts/{id}/ack": {
      "post": {
        "operationId": "ackAlert",
        "tags": [
          "Pages"
        ],
        "summary": "Acknowledge a page: escalation stops.",
        "description": "Signed with the key's name; the page shows \"Acked through the API.\" Acknowledging twice is not an error.",
        "x-teampager-access": "respond",
        "x-teampager-access-text": "Respond to pages, or Read and write.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Page id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string (1–255 characters). Makes a retry safe for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The page, acknowledged.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_flight`, `already_resolved`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/alerts/{id}/resolve": {
      "post": {
        "operationId": "resolveAlert",
        "tags": [
          "Pages"
        ],
        "summary": "Resolve a page: it is over.",
        "x-teampager-access": "respond",
        "x-teampager-access-text": "Respond to pages, or Read and write.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Page id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string (1–255 characters). Makes a retry safe for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The page, resolved.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_flight`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/alerts/{id}/reopen": {
      "post": {
        "operationId": "reopenAlert",
        "tags": [
          "Pages"
        ],
        "summary": "Undo an acknowledgement: the page is open again.",
        "description": "Only an acknowledged page can be reopened. Escalation picks up at the next step, timed from now; people already paged aren't paged again.",
        "x-teampager-access": "respond",
        "x-teampager-access-text": "Respond to pages, or Read and write.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Page id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string (1–255 characters). Makes a retry safe for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The page, open again.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_flight`, `not_acked`, `already_resolved`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/pages": {
      "post": {
        "operationId": "createPage",
        "tags": [
          "Pages"
        ],
        "summary": "Page whoever is on call on a board now, like Page now in the app. Counts toward the monthly page quota.",
        "description": "Send an `Idempotency-Key` so a retry never pages twice.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string (1–255 characters). Makes a retry safe for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "What's wrong, as the person on call will read it.",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "boardId": {
                    "type": "string",
                    "description": "The board whose on-call person is paged.",
                    "format": "uuid"
                  }
                },
                "required": [
                  "title",
                  "boardId"
                ],
                "additionalProperties": false
              },
              "example": {
                "title": "Disk full on db-1",
                "boardId": "$BOARD_ID"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the page goes out within seconds.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageAccepted"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`, `summary_required`, `summary_too_long`, `invalid_schedule_id`, `unknown_schedule`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`, `quota_alerts`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_flight`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/boards/{id}/absences": {
      "post": {
        "operationId": "addAbsence",
        "tags": [
          "Time off"
        ],
        "summary": "Mark someone away on this board between two dates. Their slots become holes; nothing slides.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Board id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string (1–255 characters). Makes a retry safe for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "personId": {
                    "type": "string"
                  },
                  "startDate": {
                    "type": "string",
                    "description": "First day away, `YYYY-MM-DD`, in the board's time zone.",
                    "format": "date"
                  },
                  "endDate": {
                    "type": "string",
                    "description": "Last day away, inclusive. At most 26 weeks after the start.",
                    "format": "date"
                  }
                },
                "required": [
                  "personId",
                  "startDate",
                  "endDate"
                ],
                "additionalProperties": false
              },
              "example": {
                "personId": "$PERSON_ID",
                "startDate": "2027-01-04",
                "endDate": "2027-01-08"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The board, with the absence.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoardDetail"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`, `invalid_person_id`, `invalid_dates`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_flight`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/boards/{id}/absences/{absenceId}/cancel": {
      "post": {
        "operationId": "cancelAbsence",
        "tags": [
          "Time off"
        ],
        "summary": "Cancel an absence on this board.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Board id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "absenceId",
            "in": "path",
            "required": true,
            "description": "Absence id (from GET /v1/boards/{id}).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string (1–255 characters). Makes a retry safe for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The board, without the absence.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoardDetail"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_flight`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/boards/{id}/coverage": {
      "post": {
        "operationId": "changeCoverage",
        "tags": [
          "Boards"
        ],
        "summary": "Change who covers a slot: cover, swap, skip or move. Refused if the person is away.",
        "description": "`cover`: `personId` takes `slotStart`. `skip`: the slot becomes a hole. `swap` / `move`: exchange `slotStart` with `otherSlotStart`. Slot times come from `upcoming` in GET /v1/boards/{id}.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Board id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string (1–255 characters). Makes a retry safe for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "cover",
                      "swap",
                      "skip",
                      "move"
                    ]
                  },
                  "slotStart": {
                    "type": "string",
                    "description": "`startsAt` of the slot to change.",
                    "format": "date-time"
                  },
                  "otherSlotStart": {
                    "type": "string",
                    "description": "For `swap` and `move`.",
                    "format": "date-time"
                  },
                  "personId": {
                    "type": "string",
                    "description": "For `cover`."
                  },
                  "rotaId": {
                    "type": "string",
                    "description": "Default: the first rota.",
                    "format": "uuid"
                  }
                },
                "required": [
                  "kind",
                  "slotStart"
                ],
                "additionalProperties": false
              },
              "example": {
                "kind": "cover",
                "slotStart": "$SLOT_START",
                "personId": "$PERSON_ID"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The board, with the change.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoardDetail"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`, `invalid_kind`, `slot_required`, `slot_not_in_window`, `slot_in_past`, `slot_b_required`, `cover_user_required`, `both_slots_gaps`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_flight`, `cover_user_away`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/people/{personId}/mute": {
      "post": {
        "operationId": "mutePerson",
        "tags": [
          "People"
        ],
        "summary": "Mute a person for a while, or until someone unmutes them.",
        "description": "A muted person's steps are skipped right away and the page goes to the next step. Give one of `minutes`, `endsAt` or `until: \"unmute\"`.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "required": true,
            "description": "Person id (from GET /v1/people).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string (1–255 characters). Makes a retry safe for 24 hours.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "minutes": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 43200
                  },
                  "endsAt": {
                    "type": "string",
                    "description": "Within 30 days.",
                    "format": "date-time"
                  },
                  "until": {
                    "type": "string",
                    "enum": [
                      "unmute"
                    ],
                    "description": "No end: muted until someone unmutes. Shows a banner to the whole organization."
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "minutes": 60,
                "reason": "On a flight"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The mute.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MuteState"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`, `mute_end_required`, `invalid_mute_end`, `invalid_reason`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_in_flight`, `already_muted`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`idempotency_key_reused`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateMute",
        "tags": [
          "People"
        ],
        "summary": "Change when a mute ends.",
        "description": "`minutes` extends from the current end; `endsAt` sets a new end; `until: \"unmute\"` removes the end.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "required": true,
            "description": "Person id (from GET /v1/people).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "minutes": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 43200
                  },
                  "endsAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "until": {
                    "type": "string",
                    "enum": [
                      "unmute"
                    ]
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "minutes": 30
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The mute, with its new end.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MuteState"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`, `unknown_fields`, `mute_end_required`, `invalid_mute_end`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`, `not_muted`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "unmutePerson",
        "tags": [
          "People"
        ],
        "summary": "Unmute a person.",
        "description": "Unmuting someone who isn't muted is not an error.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "required": true,
            "description": "Person id (from GET /v1/people).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Unmuted.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/people/{personId}/channels/{channelId}": {
      "delete": {
        "operationId": "removeChannel",
        "tags": [
          "People"
        ],
        "summary": "Remove a channel.",
        "x-teampager-access": "write",
        "x-teampager-access-text": "Read and write.",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "required": true,
            "description": "Person id (from GET /v1/people).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "Channel id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests allowed per minute for this key.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests left in the current minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the minute resets.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`insufficient_scope`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "tpk_…",
        "description": "An organization API key, created by an owner in the app."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Every error has this shape.",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable, machine-readable code (snake_case). Branch on this, not on the message."
              },
              "message": {
                "type": "string",
                "description": "One sentence for a human."
              },
              "requestId": {
                "type": "string",
                "description": "Give this to support if you need help with a request."
              },
              "details": {
                "type": "object",
                "description": "Extra facts about the error, e.g. `limit` and `used` for a plan limit.",
                "additionalProperties": true
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "Person": {
        "type": "object",
        "description": "Someone in the directory. Being in the directory does not need a login.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Person id. Use it in members, chains, absences and coverage."
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "human",
              "channel"
            ],
            "description": "`human`, or `channel` for a shared inbox or team address."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended",
              "removed"
            ],
            "description": "`suspended` by directory sync (SCIM) is skipped when paged; `removed` left the organization."
          },
          "canSignIn": {
            "type": "boolean",
            "description": "True when the person has a login. People created through the API never do."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "kind",
          "status",
          "canSignIn",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "Channel": {
        "type": "object",
        "description": "One way to reach a person.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Channel id.",
            "format": "uuid"
          },
          "personId": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "email",
              "sms",
              "voice",
              "teams",
              "slack",
              "push",
              "webhook"
            ],
            "description": "How we reach the person. The API creates `email`, `sms` and `voice`; other kinds are read-only."
          },
          "address": {
            "type": "string",
            "description": "Email address, or phone number masked as `+1 ••• ••• 0344`."
          },
          "rung": {
            "type": "integer",
            "enum": [
              1,
              2,
              3
            ],
            "description": "Order of the ladder: 1 first, then 2, then 3."
          },
          "verified": {
            "type": "boolean",
            "description": "A phone stays unverified until the person enters the code in the app."
          },
          "optedOut": {
            "type": "boolean",
            "description": "The person replied STOP to texts."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "personId",
          "kind",
          "address",
          "rung",
          "verified",
          "optedOut",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "RotaMember": {
        "type": "object",
        "properties": {
          "personId": {
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "personId",
          "name"
        ],
        "additionalProperties": false
      },
      "Rota": {
        "type": "object",
        "description": "A rota: who takes turns, and who has the pager now.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Rota id (a board has one or two rotas).",
            "format": "uuid"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RotaMember"
            },
            "description": "In rotation order."
          },
          "onCall": {
            "anyOf": [
              {
                "type": "object",
                "description": "A person, or null when nobody is assigned.",
                "properties": {
                  "personId": {
                    "type": "string",
                    "description": "Person id."
                  },
                  "name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "Display name."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "personId",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "onCallUntil": {
            "anyOf": [
              {
                "type": "string",
                "description": "End of the current slot.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "paging": {
            "type": "boolean",
            "description": "True when this rota pages right now (its paging window is open)."
          },
          "pagingChangesAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "When `paging` flips next.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "next": {
            "anyOf": [
              {
                "type": "object",
                "description": "The next different person on call, or null if nobody is planned.",
                "properties": {
                  "personId": {
                    "type": "string"
                  },
                  "name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "from": {
                    "type": "string",
                    "description": "When they take over.",
                    "format": "date-time"
                  }
                },
                "required": [
                  "personId",
                  "name",
                  "from"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "members",
          "onCall",
          "onCallUntil",
          "paging",
          "pagingChangesAt",
          "next"
        ],
        "additionalProperties": false
      },
      "Board": {
        "type": "object",
        "description": "A board (an on-call schedule) and its rotas.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Board id.",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "timezone": {
            "type": "string",
            "description": "IANA time zone, e.g. `America/Toronto`."
          },
          "paused": {
            "type": "boolean",
            "description": "A paused board pages nobody."
          },
          "slotUnit": {
            "type": "string",
            "enum": [
              "week",
              "day",
              "hours_12",
              "hours_8"
            ],
            "description": "Length of one on-call slot."
          },
          "handover": {
            "type": "object",
            "properties": {
              "weekday": {
                "type": "integer",
                "description": "0 = Monday … 6 = Sunday.",
                "minimum": 0,
                "maximum": 6
              },
              "time": {
                "type": "string",
                "description": "Local time, `HH:MM`."
              }
            },
            "required": [
              "weekday",
              "time"
            ],
            "additionalProperties": false
          },
          "rotas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rota"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "timezone",
          "paused",
          "slotUnit",
          "handover",
          "rotas",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "Slot": {
        "type": "object",
        "properties": {
          "startsAt": {
            "type": "string",
            "description": "Use this exact value as `slotStart` in coverage changes.",
            "format": "date-time"
          },
          "endsAt": {
            "type": "string",
            "format": "date-time"
          },
          "onCall": {
            "anyOf": [
              {
                "type": "object",
                "description": "A person, or null when nobody is assigned.",
                "properties": {
                  "personId": {
                    "type": "string",
                    "description": "Person id."
                  },
                  "name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "Display name."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "personId",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "away": {
            "type": "boolean",
            "description": "True when the slot is a hole because its person is away."
          }
        },
        "required": [
          "startsAt",
          "endsAt",
          "onCall",
          "away"
        ],
        "additionalProperties": false
      },
      "BoardDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Board"
          },
          {
            "type": "object",
            "properties": {
              "absences": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Absence id. Use it to cancel.",
                      "format": "uuid"
                    },
                    "personId": {
                      "type": "string"
                    },
                    "startsAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "endsAt": {
                      "type": "string",
                      "description": "Exclusive.",
                      "format": "date-time"
                    },
                    "scope": {
                      "type": "string",
                      "enum": [
                        "board",
                        "org"
                      ],
                      "description": "`org` applies to every board."
                    }
                  },
                  "required": [
                    "id",
                    "personId",
                    "startsAt",
                    "endsAt",
                    "scope"
                  ],
                  "additionalProperties": false
                }
              },
              "upcoming": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "rotaId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "slots": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Slot"
                      },
                      "description": "Current and coming slots, in order."
                    }
                  },
                  "required": [
                    "rotaId",
                    "slots"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "absences",
              "upcoming"
            ]
          }
        ],
        "description": "A board with its absences and the coming slots (the forecast)."
      },
      "OnCall": {
        "type": "object",
        "description": "Who has the pager on a board, until when, and who is next.",
        "properties": {
          "board": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              },
              "timezone": {
                "type": "string"
              },
              "paused": {
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "name",
              "timezone",
              "paused"
            ],
            "additionalProperties": false
          },
          "at": {
            "type": "string",
            "description": "When this answer was computed.",
            "format": "date-time"
          },
          "rotas": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "onCall": {
                  "anyOf": [
                    {
                      "type": "object",
                      "description": "A person, or null when nobody is assigned.",
                      "properties": {
                        "personId": {
                          "type": "string",
                          "description": "Person id."
                        },
                        "name": {
                          "anyOf": [
                            {
                              "type": "string",
                              "description": "Display name."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "personId",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "onCallUntil": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "paging": {
                  "type": "boolean"
                },
                "pagingChangesAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "next": {
                  "anyOf": [
                    {
                      "type": "object",
                      "description": "The next different person on call, or null if nobody is planned.",
                      "properties": {
                        "personId": {
                          "type": "string"
                        },
                        "name": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "from": {
                          "type": "string",
                          "description": "When they take over.",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "personId",
                        "name",
                        "from"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "name",
                "onCall",
                "onCallUntil",
                "paging",
                "pagingChangesAt",
                "next"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "board",
          "at",
          "rotas"
        ],
        "additionalProperties": false
      },
      "ChainStep": {
        "type": "object",
        "properties": {
          "position": {
            "type": "integer",
            "description": "2, 3 or 4. Step 1 is always whoever is on call.",
            "minimum": 2,
            "maximum": 4
          },
          "targetKind": {
            "type": "string",
            "enum": [
              "next_on_rota",
              "person",
              "everyone_else",
              "one_by_one"
            ],
            "description": "`next_on_rota`, a named `person`, `everyone_else` on the rota, or `one_by_one`."
          },
          "personId": {
            "anyOf": [
              {
                "type": "string",
                "description": "Set when `targetKind` is `person`."
              },
              {
                "type": "null"
              }
            ]
          },
          "waitMinutes": {
            "anyOf": [
              {
                "type": "integer",
                "enum": [
                  2,
                  5,
                  10,
                  15,
                  30
                ],
                "description": "Wait before this step; null = the board's default."
              },
              {
                "type": "null"
              }
            ]
          },
          "personGone": {
            "type": "boolean",
            "description": "The named person left: this step is a hole and escalation stops there."
          }
        },
        "required": [
          "position",
          "targetKind",
          "personId",
          "waitMinutes",
          "personGone"
        ],
        "additionalProperties": false
      },
      "Chain": {
        "type": "object",
        "description": "If nobody acknowledges: who is paged next, after how long. Escalation stops after the last step.",
        "properties": {
          "boardId": {
            "type": "string",
            "format": "uuid"
          },
          "waitMinutes": {
            "anyOf": [
              {
                "type": "integer",
                "enum": [
                  2,
                  5,
                  10,
                  15,
                  30
                ],
                "description": "Board default wait between steps; null = the organization's."
              },
              {
                "type": "null"
              }
            ]
          },
          "rotas": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rotaId": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "steps": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ChainStep"
                  }
                }
              },
              "required": [
                "rotaId",
                "name",
                "steps"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "boardId",
          "waitMinutes",
          "rotas"
        ],
        "additionalProperties": false
      },
      "ActorRef": {
        "anyOf": [
          {
            "type": "object",
            "description": "Who did it: a person or an API key.",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "person",
                  "api_key"
                ]
              },
              "id": {
                "type": "string",
                "description": "Person id, or API key id."
              }
            },
            "required": [
              "kind",
              "id"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Alert": {
        "type": "object",
        "description": "A page (an alert that reached TeamPager).",
        "properties": {
          "id": {
            "type": "string",
            "description": "Page id.",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "acked",
              "resolved"
            ],
            "description": "`open` is still escalating, `acked` stopped escalating, `resolved` is over."
          },
          "boardId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "escalationStep": {
            "type": "integer",
            "description": "How far escalation went (1 = on call)."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "ackedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "ackedBy": {
            "$ref": "#/components/schemas/ActorRef"
          },
          "ackedVia": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "app",
                  "link",
                  "call",
                  "slack",
                  "api"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "reopenedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "resolvedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "resolvedBy": {
            "$ref": "#/components/schemas/ActorRef"
          }
        },
        "required": [
          "id",
          "title",
          "status",
          "boardId",
          "escalationStep",
          "createdAt",
          "ackedAt",
          "ackedBy",
          "ackedVia",
          "reopenedAt",
          "resolvedAt",
          "resolvedBy"
        ],
        "additionalProperties": false
      },
      "AlertList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Alert"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "description": "Pass as `cursor` to get the next page of results; null at the end."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "Heartbeat": {
        "type": "object",
        "description": "A heartbeat: pages when a job stops checking in.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Heartbeat id.",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "boardId": {
            "anyOf": [
              {
                "type": "string",
                "description": "Board paged when it goes silent; null = the organization's default board.",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "intervalMinutes": {
            "type": "integer"
          },
          "graceMinutes": {
            "type": "integer"
          },
          "state": {
            "type": "string",
            "enum": [
              "waiting",
              "up",
              "down",
              "paused"
            ],
            "description": "`waiting` for its first ping, `up`, `down` (silent: a page went out), or `paused`."
          },
          "lastPingAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "downSince": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "boardId",
          "intervalMinutes",
          "graceMinutes",
          "state",
          "lastPingAt",
          "downSince",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "HeartbeatCreated": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Heartbeat"
          },
          {
            "type": "object",
            "properties": {
              "pingUrl": {
                "type": "string",
                "description": "The URL your job calls. Returned once, here only; it can't be read again."
              }
            },
            "required": [
              "pingUrl"
            ]
          }
        ]
      },
      "OrgAbsence": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "personId": {
            "type": "string"
          },
          "startDate": {
            "type": "string",
            "description": "First day away, `YYYY-MM-DD`.",
            "format": "date"
          },
          "endDate": {
            "type": "string",
            "description": "Last day away, inclusive.",
            "format": "date"
          }
        },
        "required": [
          "id",
          "personId",
          "startDate",
          "endDate"
        ],
        "additionalProperties": false
      },
      "MuteState": {
        "type": "object",
        "properties": {
          "personId": {
            "type": "string"
          },
          "mute": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "endsAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "Null = muted until someone unmutes.",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "createdAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "endsAt",
                  "reason",
                  "createdAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "personId",
          "mute"
        ],
        "additionalProperties": false
      },
      "PageAccepted": {
        "type": "object",
        "properties": {
          "accepted": {
            "type": "boolean",
            "const": true
          },
          "deliveryId": {
            "type": "string",
            "description": "Delivery id. The page itself appears in GET /v1/alerts within seconds."
          }
        },
        "required": [
          "accepted",
          "deliveryId"
        ],
        "additionalProperties": false
      },
      "PersonDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Person"
          },
          {
            "type": "object",
            "properties": {
              "channels": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Channel"
                }
              }
            },
            "required": [
              "channels"
            ]
          }
        ]
      },
      "BoardList": {
        "type": "object",
        "description": "Every board.",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Board"
            }
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "OnCallList": {
        "type": "object",
        "description": "One entry per board.",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OnCall"
            }
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "PersonList": {
        "type": "object",
        "description": "The directory.",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Person"
            }
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "ChannelList": {
        "type": "object",
        "description": "In ladder order.",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Channel"
            }
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "OrgAbsenceList": {
        "type": "object",
        "description": "Absences that apply to every board.",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrgAbsence"
            }
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "HeartbeatList": {
        "type": "object",
        "description": "Every heartbeat.",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Heartbeat"
            }
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      }
    }
  }
}
