{
    "openapi": "3.1.2",
    "info": {
        "title": "NOCgenie API",
        "version": "1.0.0+7b7d43464053",
        "description": "NOCgenie REST API. Authenticate with `Authorization: Bearer <token>` (Sanctum). Mobile apps use the short-lived access token from POST /auth/mobile/login and rotate it with POST /auth/mobile/refresh."
    },
    "servers": [
        {
            "url": "https://app.nocgenie.com/api/v1",
            "description": "NOCgenie"
        }
    ],
    "security": [
        {
            "http": []
        }
    ],
    "paths": {
        "/user": {
            "get": {
                "responses": {
                    "200": {
                        "description": "`User`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/User"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me": {
            "delete": {
                "operationId": "me.delete",
                "description": "Delete the signed-in user's own account (Apple guideline 5.1.1(v)). `DELETE /me` and `POST /me/delete` are the same; use POST if your client can't send a body with DELETE.\n\n**Re-authentication:** `password` (plus `mfa_code` when two-factor is on). SSO users have no password: a sign-in in the last 10 minutes on this web session or mobile device counts. Otherwise 403 `reauth_required`.\n\n**Refused (409):** `last_owner` (transfer ownership first: POST /organization/owner) or `sole_member` (close the organization: POST /organization/close).\n\n**What happens:**\n- The user row is anonymised (\"Deleted user\"), so alert and audit history stay attributed.\n- Contact methods, notification rules, devices, quiet hours, every token, refresh token and session are removed.\n- So are rotation places, current and future overrides, escalation steps naming the user, and team memberships.\n- Anything that leaves with nobody to page (a schedule, rotation, policy or team step) is audited, and the org's admins are emailed.\n- A confirmation goes to the old address (never to test recipients).\n- The seat count, and the Stripe quantity, update through the normal path.",
                "summary": "Delete my account",
                "tags": [
                    "AccountDeletion"
                ],
                "parameters": [
                    {
                        "name": "password",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "maxLength": 255
                        }
                    },
                    {
                        "name": "mfa_code",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "maxLength": 16
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "password": {
                                        "type": "string",
                                        "description": "Required unless the user signs in with SSO."
                                    },
                                    "mfa_code": {
                                        "type": "string",
                                        "description": "When two-factor authentication is on (password users)."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "422": {
                        "description": "invalid_password or invalid_mfa_code (with errors).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccountDeletionRefusal"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "Deleted. Every token is revoked, so sign the user out locally.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "deleted": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "roster_gaps": {
                                            "type": "integer",
                                            "description": "How many schedules, rotations, policies or team steps were left with nobody to page (admins were emailed)."
                                        }
                                    },
                                    "required": [
                                        "deleted",
                                        "message",
                                        "roster_gaps"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "reauth_required, or a token without the profile scope.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccountDeletionRefusal"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "last_owner or sole_member.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccountDeletionRefusal"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "profile.update",
                "tags": [
                    "Profile"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "maxLength": 255
                                    },
                                    "timezone": {
                                        "type": "string"
                                    },
                                    "mobile": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 32
                                    },
                                    "notify_email": {
                                        "type": "boolean",
                                        "description": "With no enabled new-alert rule matching the alert, page the first enabled contact\nmethod straight away. Not a master switch: rules still fire, and the zero-send\nfallback still pages if nothing else was sent (docs/notifications.md)."
                                    },
                                    "notify_sms": {
                                        "type": "boolean",
                                        "description": "Also SMS the profile `mobile` on every new-alert page, in addition to the rules (not\na master switch). Needs a verified `mobile` and a plan with SMS/voice (422 otherwise)."
                                    },
                                    "notify_voice": {
                                        "type": "boolean",
                                        "description": "Also call the profile `mobile` on every new-alert page, in addition to the rules (not\na master switch). Needs a verified `mobile` and a plan with SMS/voice (422 otherwise)."
                                    },
                                    "critical_alerts": {
                                        "type": "boolean",
                                        "description": "iOS critical alerts for P1 pushes (the app also needs the OS permission)."
                                    },
                                    "call_voice": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "#962: the Deepgram voice for this user's alert calls, one of `GET /voices`.\nnull = use the organization's default.",
                                        "enum": [
                                            "aura-2-thalia-en",
                                            "aura-2-theia-en",
                                            "aura-2-hyperion-en",
                                            "aura-2-pandora-en",
                                            "aura-2-draco-en",
                                            "aura-2-electra-en",
                                            "aura-2-orpheus-en",
                                            "aura-2-zeus-en",
                                            null
                                        ]
                                    },
                                    "quiet_hours": {
                                        "description": "Quiet hours (see the QuietHours schema). Send null to clear.",
                                        "anyOf": [
                                            {
                                                "$ref": "#/components/schemas/QuietHours"
                                            },
                                            {
                                                "type": "null"
                                            }
                                        ]
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "Changing the password or the email requires the current password."
                                    },
                                    "current_password": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/User"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, or a plan gate (PlanGateError: code plan_feature_unavailable or plan_limit_reached).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/PlanGateError"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "errors": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "errors"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/delete": {
            "post": {
                "operationId": "me.delete.post",
                "description": "Delete the signed-in user's own account (Apple guideline 5.1.1(v)). `DELETE /me` and `POST /me/delete` are the same; use POST if your client can't send a body with DELETE.\n\n**Re-authentication:** `password` (plus `mfa_code` when two-factor is on). SSO users have no password: a sign-in in the last 10 minutes on this web session or mobile device counts. Otherwise 403 `reauth_required`.\n\n**Refused (409):** `last_owner` (transfer ownership first: POST /organization/owner) or `sole_member` (close the organization: POST /organization/close).\n\n**What happens:**\n- The user row is anonymised (\"Deleted user\"), so alert and audit history stay attributed.\n- Contact methods, notification rules, devices, quiet hours, every token, refresh token and session are removed.\n- So are rotation places, current and future overrides, escalation steps naming the user, and team memberships.\n- Anything that leaves with nobody to page (a schedule, rotation, policy or team step) is audited, and the org's admins are emailed.\n- A confirmation goes to the old address (never to test recipients).\n- The seat count, and the Stripe quantity, update through the normal path.",
                "summary": "Delete my account",
                "tags": [
                    "AccountDeletion"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "password": {
                                        "type": "string",
                                        "description": "Required unless the user signs in with SSO."
                                    },
                                    "mfa_code": {
                                        "type": "string",
                                        "description": "When two-factor authentication is on (password users)."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "422": {
                        "description": "invalid_password or invalid_mfa_code (with errors).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccountDeletionRefusal"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "Deleted. Every token is revoked, so sign the user out locally.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "deleted": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "roster_gaps": {
                                            "type": "integer",
                                            "description": "How many schedules, rotations, policies or team steps were left with nobody to page (admins were emailed)."
                                        }
                                    },
                                    "required": [
                                        "deleted",
                                        "message",
                                        "roster_gaps"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "reauth_required, or a token without the profile scope.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccountDeletionRefusal"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "last_owner or sole_member.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccountDeletionRefusal"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts": {
            "get": {
                "operationId": "alerts.index",
                "description": "- `status`: one status, a comma-separated list (`open,acknowledged`) or an\n  array (`status[]=open&status[]=acknowledged`).\n- `sort`: up to three comma-separated keys from created_at, priority and\n  updated_at, each optionally prefixed with `-` for descending. `priority`\n  ascending puts P1 first. Default `-created_at` (newest first). Ties are\n  always broken by id, in the direction of the last key, so pages are stable.\n  Open alerts by priority, oldest first: `status=open&sort=priority,created_at`.\n\nPagination links (next_page_url etc.) carry these filters, sort and\nper_page (#615), normalized; no other query param is echoed.\n\nEach alert also carries service, host, acknowledged_by_user and\nclosed_by_user ({id, name} or null).",
                "summary": "The organization's alerts, paginated",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "priority",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "P1",
                                "P2",
                                "P3",
                                "P4",
                                "P5"
                            ]
                        }
                    },
                    {
                        "name": "team_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Comma-separated sort keys from created_at, priority, updated_at; prefix `-` for descending. `priority` ascending puts P1 first. Default `-created_at` (newest first). Ties are broken by id in the direction of the last key. Open alerts by priority, oldest first: `status=open&sort=priority,created_at`.",
                        "schema": {
                            "type": "string",
                            "pattern": "^-?(created_at|priority|updated_at)(,-?(created_at|priority|updated_at)){0,2}$",
                            "default": "-created_at"
                        },
                        "example": "priority,created_at"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Filter by one or more statuses: `status=open`, `status=open,acknowledged` or `status[]=open&status[]=acknowledged`.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string",
                                    "description": "One status or a comma-separated list, e.g. `open,acknowledged`.",
                                    "pattern": "^\\s*(open|acknowledged|closed|snoozed)?\\s*(,\\s*(open|acknowledged|closed|snoozed)?\\s*)*$"
                                },
                                {
                                    "type": "array",
                                    "description": "As `status[]=open&status[]=acknowledged`.",
                                    "items": {
                                        "type": "string",
                                        "enum": [
                                            "open",
                                            "acknowledged",
                                            "closed",
                                            "snoozed"
                                        ]
                                    }
                                }
                            ]
                        },
                        "example": "open,acknowledged"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "current_page": {
                                            "type": "integer",
                                            "minimum": 1
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/AlertView"
                                            }
                                        },
                                        "first_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "from": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ],
                                            "minimum": 1
                                        },
                                        "last_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "last_page": {
                                            "type": "integer",
                                            "minimum": 1
                                        },
                                        "links": {
                                            "type": "array",
                                            "description": "Generated paginator links.",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "url": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "label": {
                                                        "type": "string"
                                                    },
                                                    "active": {
                                                        "type": "boolean"
                                                    }
                                                },
                                                "required": [
                                                    "url",
                                                    "label",
                                                    "active"
                                                ]
                                            }
                                        },
                                        "next_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "path": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "description": "Base path for paginator generated URLs."
                                        },
                                        "per_page": {
                                            "type": "integer",
                                            "description": "Number of items shown per page.",
                                            "minimum": 0
                                        },
                                        "prev_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "to": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ],
                                            "description": "Number of the last item in the slice.",
                                            "minimum": 1
                                        },
                                        "total": {
                                            "type": "integer",
                                            "description": "Total number of items being paginated.",
                                            "minimum": 0
                                        }
                                    },
                                    "required": [
                                        "current_page",
                                        "data",
                                        "first_page_url",
                                        "from",
                                        "last_page_url",
                                        "last_page",
                                        "links",
                                        "next_page_url",
                                        "path",
                                        "per_page",
                                        "prev_page_url",
                                        "to",
                                        "total"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}": {
            "get": {
                "operationId": "alerts.show",
                "summary": "The alert with its timeline, team, integration, owner and delivery log, plus the #611 fields",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AlertView"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}/acknowledge": {
            "post": {
                "operationId": "alerts.acknowledge",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Alert"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}/unacknowledge": {
            "post": {
                "operationId": "alert.unacknowledge",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Alert"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}/close": {
            "post": {
                "operationId": "alerts.close",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": "string",
                                        "maxLength": 2000
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Alert"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}/reopen": {
            "post": {
                "operationId": "alert.reopen",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "409": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "active_alert_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "active_alert_id"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Alert"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}/snooze": {
            "post": {
                "operationId": "alert.snooze",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "until": {
                                        "type": "string",
                                        "format": "date-time"
                                    }
                                },
                                "required": [
                                    "until"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Alert"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}/assign": {
            "post": {
                "operationId": "alert.assign",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_id": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "user_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Alert"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}/take-ownership": {
            "post": {
                "operationId": "alert.takeOwnership",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Alert"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}/notes": {
            "post": {
                "operationId": "alert.addNote",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": "string",
                                        "maxLength": 2000
                                    }
                                },
                                "required": [
                                    "note"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Alert"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}/escalate": {
            "post": {
                "operationId": "alert.escalate",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Alert"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}/priority": {
            "post": {
                "operationId": "alert.changePriority",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "priority": {
                                        "type": "string",
                                        "enum": [
                                            "P1",
                                            "P2",
                                            "P3",
                                            "P4",
                                            "P5"
                                        ]
                                    }
                                },
                                "required": [
                                    "priority"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Alert"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}/tags": {
            "post": {
                "operationId": "alert.addTags",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "maxLength": 64
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "tags"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Alert"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "alert.removeTags",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "tags[]",
                        "in": "query",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "maxLength": 64
                            },
                            "minItems": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Alert"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}/details": {
            "patch": {
                "operationId": "alert.updateDetails",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "details": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "details"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Alert"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}/responders": {
            "post": {
                "operationId": "alert.addResponder",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "user",
                                            "team"
                                        ]
                                    },
                                    "id": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "type",
                                    "id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Alert"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/{alert}/actions/{action}": {
            "post": {
                "operationId": "alert.runCustomAction",
                "summary": "Fire a user-defined custom action (outbound webhook) for the alert",
                "tags": [
                    "Alert"
                ],
                "parameters": [
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "action",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alerts/bulk": {
            "post": {
                "operationId": "alert.bulk",
                "summary": "Bulk lifecycle action across many alerts: {ids:[], action:ack|close|snooze, ...}",
                "tags": [
                    "Alert"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "minItems": 1,
                                        "maxItems": 500
                                    },
                                    "action": {
                                        "type": "string",
                                        "enum": [
                                            "acknowledge",
                                            "close",
                                            "snooze"
                                        ]
                                    },
                                    "until": {
                                        "type": "string",
                                        "format": "date-time"
                                    }
                                },
                                "required": [
                                    "ids",
                                    "action"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "affected": {
                                            "type": "integer",
                                            "minimum": 0
                                        },
                                        "action": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "affected",
                                        "action"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alert-policies": {
            "get": {
                "operationId": "alertPolicy.index",
                "tags": [
                    "AlertPolicy"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/AlertPolicy"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "alertPolicy.store",
                "tags": [
                    "AlertPolicy"
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/alert-policies/{id}": {
            "get": {
                "operationId": "alertPolicy.show",
                "tags": [
                    "AlertPolicy"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "alertPolicy.update",
                "tags": [
                    "AlertPolicy"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": [
                                        "object",
                                        "null"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "alertPolicy.destroy",
                "tags": [
                    "AlertPolicy"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tokens": {
            "get": {
                "operationId": "tokens.index",
                "tags": [
                    "ApiToken"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "tokens.store",
                "tags": [
                    "ApiToken"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "abilities": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "enum": [
                                                "*",
                                                "alerts:read",
                                                "alerts:write",
                                                "schedules:read",
                                                "schedules:write",
                                                "config:read",
                                                "config:write",
                                                "users:read",
                                                "users:write",
                                                "reports:read",
                                                "reports:write",
                                                "profile:read",
                                                "profile:write",
                                                "organization:read",
                                                "organization:write",
                                                "billing:read",
                                                "billing:write"
                                            ]
                                        }
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "token": {
                                            "type": "string"
                                        },
                                        "name": {
                                            "type": "string"
                                        },
                                        "abilities": {
                                            "anyOf": [
                                                {
                                                    "type": "string"
                                                },
                                                {
                                                    "type": "array",
                                                    "prefixItems": [
                                                        {
                                                            "type": "string",
                                                            "const": "*"
                                                        }
                                                    ],
                                                    "minItems": 1,
                                                    "maxItems": 1
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "token",
                                        "name",
                                        "abilities"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tokens/{tokenId}": {
            "delete": {
                "operationId": "tokens.destroy",
                "tags": [
                    "ApiToken"
                ],
                "parameters": [
                    {
                        "name": "tokenId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Token revoked."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/audit-logs": {
            "get": {
                "operationId": "audit.index",
                "tags": [
                    "AuditLog"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "current_page": {
                                            "type": "integer",
                                            "minimum": 1
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/AuditLog"
                                            }
                                        },
                                        "first_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "from": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ],
                                            "minimum": 1
                                        },
                                        "last_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "last_page": {
                                            "type": "integer",
                                            "minimum": 1
                                        },
                                        "links": {
                                            "type": "array",
                                            "description": "Generated paginator links.",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "url": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "label": {
                                                        "type": "string"
                                                    },
                                                    "active": {
                                                        "type": "boolean"
                                                    }
                                                },
                                                "required": [
                                                    "url",
                                                    "label",
                                                    "active"
                                                ]
                                            }
                                        },
                                        "next_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "path": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "description": "Base path for paginator generated URLs."
                                        },
                                        "per_page": {
                                            "type": "integer",
                                            "description": "Number of items shown per page.",
                                            "minimum": 0
                                        },
                                        "prev_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "to": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ],
                                            "description": "Number of the last item in the slice.",
                                            "minimum": 1
                                        },
                                        "total": {
                                            "type": "integer",
                                            "description": "Total number of items being paginated.",
                                            "minimum": 0
                                        }
                                    },
                                    "required": [
                                        "current_page",
                                        "data",
                                        "first_page_url",
                                        "from",
                                        "last_page_url",
                                        "last_page",
                                        "links",
                                        "next_page_url",
                                        "path",
                                        "per_page",
                                        "prev_page_url",
                                        "to",
                                        "total"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/mfa/verify": {
            "post": {
                "operationId": "auth.mfa.verify",
                "summary": "Second login step (P1-10): {mfa_token, code} where code is a TOTP code or\na recovery code. Issues the web token, or the mobile token set when the\nchallenge came from POST auth/mobile/login",
                "tags": [
                    "Auth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "mfa_token": {
                                        "type": "string",
                                        "maxLength": 128
                                    },
                                    "code": {
                                        "type": "string",
                                        "maxLength": 32
                                    },
                                    "device": {
                                        "type": "object",
                                        "description": "#313: the mobile challenge carries the login's installation_id; an app\nmay also send it here.",
                                        "properties": {
                                            "installation_id": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                                                "maxLength": 64
                                            }
                                        }
                                    }
                                },
                                "required": [
                                    "mfa_token",
                                    "code"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`MobileTokenResponse`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "array"
                                        },
                                        {
                                            "$ref": "#/components/schemas/MobileTokenResponse"
                                        },
                                        {
                                            "type": "string"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "This sign-in has expired. Start again."
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "mfa_challenge_expired"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/login": {
            "post": {
                "operationId": "auth.login",
                "summary": "Local credential login -> API token (for the SPA / CLI)",
                "tags": [
                    "Auth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "password": {
                                        "type": "string"
                                    },
                                    "device": {
                                        "type": "string",
                                        "description": "#395: a client never picks a server-only token name (e.g. 'sso').",
                                        "maxLength": 64
                                    }
                                },
                                "required": [
                                    "email",
                                    "password"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/forgot-password": {
            "post": {
                "operationId": "auth.forgot",
                "summary": "Email a password-setup link (used for \"forgot password\"). Always 200 \u2014 no enumeration",
                "tags": [
                    "Auth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "turnstile_token": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2048
                                    }
                                },
                                "required": [
                                    "email"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "If that email has an account, a reset link is on its way."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/set-password": {
            "post": {
                "operationId": "auth.set_password",
                "summary": "Set a password from an invite / reset token, then sign in",
                "tags": [
                    "Auth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "token": {
                                        "type": "string"
                                    },
                                    "password": {
                                        "type": "string"
                                    },
                                    "device": {
                                        "type": "string",
                                        "description": "#395: a client never picks a server-only token name (e.g. 'sso').",
                                        "maxLength": 64
                                    }
                                },
                                "required": [
                                    "email",
                                    "token",
                                    "password"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/verify-email/{id}/{hash}": {
            "get": {
                "operationId": "auth.verify_email",
                "summary": "Signed link from the verification email",
                "tags": [
                    "Auth"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "hash",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "302": {
                        "description": "",
                        "headers": {
                            "Location": {
                                "required": true,
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "verified": {
                                            "type": "boolean"
                                        }
                                    },
                                    "required": [
                                        "verified"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "That verification link is invalid."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/oidc/redirect": {
            "get": {
                "operationId": "auth.oidc.redirect",
                "summary": "Begin OIDC SSO",
                "tags": [
                    "Auth"
                ],
                "responses": {
                    "302": {
                        "description": "",
                        "headers": {
                            "Location": {
                                "required": true,
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/oidc/callback": {
            "get": {
                "operationId": "auth.oidc.callback",
                "summary": "OIDC callback, shared by every flow (the IdP has one redirect_uri): verify\nthe state, exchange the code with the PKCE verifier, check the nonce,\nprovision, then hand off. Web: redirect to the SPA with a one-time code\n(never a token) that it trades via POST auth/sso/exchange. Other flows\n(mobile, #314): the flow's own SsoFlow handler finishes or fails it",
                "tags": [
                    "Auth"
                ],
                "responses": {
                    "302": {
                        "description": "",
                        "headers": {
                            "Location": {
                                "required": true,
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                },
                                                "expires_in": {
                                                    "type": "integer",
                                                    "const": 60
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "expires_in"
                                            ]
                                        },
                                        {
                                            "type": "object"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "anyOf": [
                                                {
                                                    "type": "string"
                                                },
                                                {
                                                    "type": "string",
                                                    "enum": [
                                                        "Single sign-on failed. Try again, or contact your administrator if it keeps happening."
                                                    ]
                                                }
                                            ]
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "sso_failed"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "message"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "const": "Sign-in was cancelled or refused by your identity provider."
                                                },
                                                "error": {
                                                    "type": "string",
                                                    "const": "access_denied"
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "error"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/sso/exchange": {
            "post": {
                "operationId": "auth.sso.exchange",
                "summary": "POST auth/sso/exchange {code}: trade the one-time code from the web SSO\ncallback for the session token (#319). Single use, 60 seconds, web codes\nonly. The same response body as the old callback token",
                "tags": [
                    "Auth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "code": {
                                        "type": "string",
                                        "maxLength": 128
                                    }
                                },
                                "required": [
                                    "code"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        },
                        "headers": {
                            "Cache-Control": {
                                "schema": {
                                    "type": "string",
                                    "const": "no-store"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "This sign-in link has expired or was already used. Start again."
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "sso_code_invalid"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/me": {
            "get": {
                "operationId": "auth.me",
                "tags": [
                    "Auth"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/logout": {
            "post": {
                "operationId": "auth.logout",
                "tags": [
                    "Auth"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "device_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "push_token": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 512
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Logged out."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/session": {
            "post": {
                "operationId": "auth.session",
                "summary": "Move a pre-#588 SPA sign-in (a bearer token in localStorage) into a cookie\nsession, keeping the same token as its backing, so nobody is signed out by the\nswitch. Only sign-in tokens (session/SSO), and only from the SPA itself",
                "tags": [
                    "Auth"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "session": {
                                            "type": "boolean"
                                        }
                                    },
                                    "required": [
                                        "session"
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                "Only the web app can start a cookie session."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                "This token cannot start a web session."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/accept-terms": {
            "post": {
                "operationId": "auth.accept_terms",
                "summary": "POST /auth/accept-terms {accept_terms: true, terms_version}: record that\nthis user accepted the current terms, privacy policy and AUP (#225). The\nversion must be the current one, so the user saw what they accepted.\nIdempotent: accepting again keeps the first acceptance",
                "tags": [
                    "Auth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "accept_terms": {
                                        "enum": [
                                            "yes",
                                            "on",
                                            "1",
                                            1,
                                            "true",
                                            true
                                        ]
                                    },
                                    "terms_version": {
                                        "type": "string",
                                        "enum": [
                                            "2026-11-13.2"
                                        ]
                                    }
                                },
                                "required": [
                                    "terms_version"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "terms_acceptance_required": {
                                            "type": "boolean"
                                        },
                                        "terms_accepted_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "terms_version": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "terms_acceptance_required",
                                        "terms_accepted_at",
                                        "terms_version"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/email/verification-notification": {
            "post": {
                "operationId": "auth.verify_email.resend",
                "summary": "Re-send the verification email to the signed-in user",
                "tags": [
                    "Auth"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "const": "Verification email sent."
                                                }
                                            },
                                            "required": [
                                                "message"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "const": "Your email is already verified."
                                                }
                                            },
                                            "required": [
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/auto-top-up": {
            "get": {
                "operationId": "billing.auto-top-up",
                "summary": "GET /billing/auto-top-up",
                "tags": [
                    "AutoTopUp"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "enabled": {
                                            "type": "boolean"
                                        },
                                        "card": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "properties": {
                                                "brand": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last4": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "brand",
                                                "last4"
                                            ]
                                        },
                                        "timezone": {
                                            "type": "string"
                                        },
                                        "period": {
                                            "type": "string"
                                        },
                                        "resets_at": {
                                            "type": "string"
                                        },
                                        "total_cap": {
                                            "type": [
                                                "number",
                                                "null"
                                            ]
                                        },
                                        "total_spent_this_month": {
                                            "type": "number"
                                        },
                                        "channels": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "channel": {
                                                        "type": "string"
                                                    },
                                                    "unit": {
                                                        "type": "string"
                                                    },
                                                    "available": {
                                                        "type": "boolean"
                                                    },
                                                    "state": {
                                                        "type": "string",
                                                        "enum": [
                                                            "active",
                                                            "cap_reached",
                                                            "requires_action",
                                                            "in_flight",
                                                            "needs_card",
                                                            "unavailable",
                                                            "off",
                                                            "disabled"
                                                        ]
                                                    },
                                                    "enabled": {
                                                        "type": "boolean"
                                                    },
                                                    "threshold": {
                                                        "type": [
                                                            "integer",
                                                            "null"
                                                        ]
                                                    },
                                                    "pack": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "packs": {
                                                        "type": "array",
                                                        "description": "Each pack's top-up price inc GST (what counts against the maximum).",
                                                        "items": {
                                                            "type": "array",
                                                            "items": {}
                                                        }
                                                    },
                                                    "monthly_cap": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "suggested_monthly_cap": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "top_up_amount": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "spent_this_month": {
                                                        "type": "number"
                                                    },
                                                    "remaining_this_month": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "balance": {
                                                        "type": "integer"
                                                    },
                                                    "consecutive_failures": {
                                                        "type": "integer"
                                                    },
                                                    "disabled_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "disabled_reason": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "disabled_by": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "next_trigger": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            },
                                                            {
                                                                "type": "string",
                                                                "enum": [
                                                                    "Waiting for a saved card",
                                                                    "Paused: this month\u2019s maximum is reached. Resumes next month",
                                                                    "A top-up is being charged",
                                                                    "Waiting for the card to be authenticated (see the email); no new top-up until then",
                                                                    "Not available right now"
                                                                ]
                                                            }
                                                        ]
                                                    },
                                                    "last": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "channel": {
                                                                "type": "string"
                                                            },
                                                            "pack": {
                                                                "type": "string"
                                                            },
                                                            "credits": {
                                                                "type": "integer"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "trigger": {
                                                                "type": "string"
                                                            },
                                                            "balance_at_trigger": {
                                                                "type": "integer"
                                                            },
                                                            "estimated": {
                                                                "type": "number"
                                                            },
                                                            "amount": {
                                                                "type": [
                                                                    "number",
                                                                    "null"
                                                                ]
                                                            },
                                                            "currency": {
                                                                "type": "string"
                                                            },
                                                            "stripe_invoice_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "failure_code": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "failure_message": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "created_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "paid_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "failed_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "channel",
                                                            "pack",
                                                            "credits",
                                                            "status",
                                                            "trigger",
                                                            "balance_at_trigger",
                                                            "estimated",
                                                            "amount",
                                                            "currency",
                                                            "stripe_invoice_id",
                                                            "failure_code",
                                                            "failure_message",
                                                            "created_at",
                                                            "paid_at",
                                                            "failed_at"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "channel",
                                                    "unit",
                                                    "available",
                                                    "state",
                                                    "enabled",
                                                    "threshold",
                                                    "pack",
                                                    "packs",
                                                    "monthly_cap",
                                                    "suggested_monthly_cap",
                                                    "top_up_amount",
                                                    "spent_this_month",
                                                    "remaining_this_month",
                                                    "balance",
                                                    "consecutive_failures",
                                                    "disabled_at",
                                                    "disabled_reason",
                                                    "disabled_by",
                                                    "next_trigger",
                                                    "last"
                                                ]
                                            }
                                        },
                                        "history": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "channel": {
                                                        "type": "string"
                                                    },
                                                    "pack": {
                                                        "type": "string"
                                                    },
                                                    "credits": {
                                                        "type": "integer"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "trigger": {
                                                        "type": "string"
                                                    },
                                                    "balance_at_trigger": {
                                                        "type": "integer"
                                                    },
                                                    "estimated": {
                                                        "type": "number"
                                                    },
                                                    "amount": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "currency": {
                                                        "type": "string"
                                                    },
                                                    "stripe_invoice_id": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "failure_code": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "failure_message": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "paid_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "failed_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "channel",
                                                    "pack",
                                                    "credits",
                                                    "status",
                                                    "trigger",
                                                    "balance_at_trigger",
                                                    "estimated",
                                                    "amount",
                                                    "currency",
                                                    "stripe_invoice_id",
                                                    "failure_code",
                                                    "failure_message",
                                                    "created_at",
                                                    "paid_at",
                                                    "failed_at"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "enabled",
                                        "card",
                                        "timezone",
                                        "period",
                                        "resets_at",
                                        "total_cap",
                                        "total_spent_this_month",
                                        "channels",
                                        "history"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "billing.auto-top-up.total",
                "summary": "PUT /billing/auto-top-up {total_cap: A$ inc GST | null}",
                "tags": [
                    "AutoTopUp"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "total_cap": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "minimum": 1,
                                        "maximum": 10000
                                    }
                                },
                                "required": [
                                    "total_cap"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "enabled": {
                                            "type": "boolean"
                                        },
                                        "card": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "properties": {
                                                "brand": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last4": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "brand",
                                                "last4"
                                            ]
                                        },
                                        "timezone": {
                                            "type": "string"
                                        },
                                        "period": {
                                            "type": "string"
                                        },
                                        "resets_at": {
                                            "type": "string"
                                        },
                                        "total_cap": {
                                            "type": [
                                                "number",
                                                "null"
                                            ]
                                        },
                                        "total_spent_this_month": {
                                            "type": "number"
                                        },
                                        "channels": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "channel": {
                                                        "type": "string"
                                                    },
                                                    "unit": {
                                                        "type": "string"
                                                    },
                                                    "available": {
                                                        "type": "boolean"
                                                    },
                                                    "state": {
                                                        "type": "string",
                                                        "enum": [
                                                            "active",
                                                            "cap_reached",
                                                            "requires_action",
                                                            "in_flight",
                                                            "needs_card",
                                                            "unavailable",
                                                            "off",
                                                            "disabled"
                                                        ]
                                                    },
                                                    "enabled": {
                                                        "type": "boolean"
                                                    },
                                                    "threshold": {
                                                        "type": [
                                                            "integer",
                                                            "null"
                                                        ]
                                                    },
                                                    "pack": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "packs": {
                                                        "type": "array",
                                                        "description": "Each pack's top-up price inc GST (what counts against the maximum).",
                                                        "items": {
                                                            "type": "array",
                                                            "items": {}
                                                        }
                                                    },
                                                    "monthly_cap": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "suggested_monthly_cap": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "top_up_amount": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "spent_this_month": {
                                                        "type": "number"
                                                    },
                                                    "remaining_this_month": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "balance": {
                                                        "type": "integer"
                                                    },
                                                    "consecutive_failures": {
                                                        "type": "integer"
                                                    },
                                                    "disabled_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "disabled_reason": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "disabled_by": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "next_trigger": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "null"
                                                            },
                                                            {
                                                                "type": "string",
                                                                "enum": [
                                                                    "Waiting for a saved card",
                                                                    "Paused: this month\u2019s maximum is reached. Resumes next month",
                                                                    "A top-up is being charged",
                                                                    "Waiting for the card to be authenticated (see the email); no new top-up until then",
                                                                    "Not available right now"
                                                                ]
                                                            }
                                                        ]
                                                    },
                                                    "last": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "channel": {
                                                                "type": "string"
                                                            },
                                                            "pack": {
                                                                "type": "string"
                                                            },
                                                            "credits": {
                                                                "type": "integer"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "trigger": {
                                                                "type": "string"
                                                            },
                                                            "balance_at_trigger": {
                                                                "type": "integer"
                                                            },
                                                            "estimated": {
                                                                "type": "number"
                                                            },
                                                            "amount": {
                                                                "type": [
                                                                    "number",
                                                                    "null"
                                                                ]
                                                            },
                                                            "currency": {
                                                                "type": "string"
                                                            },
                                                            "stripe_invoice_id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "failure_code": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "failure_message": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "created_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "paid_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "failed_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "channel",
                                                            "pack",
                                                            "credits",
                                                            "status",
                                                            "trigger",
                                                            "balance_at_trigger",
                                                            "estimated",
                                                            "amount",
                                                            "currency",
                                                            "stripe_invoice_id",
                                                            "failure_code",
                                                            "failure_message",
                                                            "created_at",
                                                            "paid_at",
                                                            "failed_at"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "channel",
                                                    "unit",
                                                    "available",
                                                    "state",
                                                    "enabled",
                                                    "threshold",
                                                    "pack",
                                                    "packs",
                                                    "monthly_cap",
                                                    "suggested_monthly_cap",
                                                    "top_up_amount",
                                                    "spent_this_month",
                                                    "remaining_this_month",
                                                    "balance",
                                                    "consecutive_failures",
                                                    "disabled_at",
                                                    "disabled_reason",
                                                    "disabled_by",
                                                    "next_trigger",
                                                    "last"
                                                ]
                                            }
                                        },
                                        "history": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "channel": {
                                                        "type": "string"
                                                    },
                                                    "pack": {
                                                        "type": "string"
                                                    },
                                                    "credits": {
                                                        "type": "integer"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "trigger": {
                                                        "type": "string"
                                                    },
                                                    "balance_at_trigger": {
                                                        "type": "integer"
                                                    },
                                                    "estimated": {
                                                        "type": "number"
                                                    },
                                                    "amount": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "currency": {
                                                        "type": "string"
                                                    },
                                                    "stripe_invoice_id": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "failure_code": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "failure_message": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "paid_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "failed_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "channel",
                                                    "pack",
                                                    "credits",
                                                    "status",
                                                    "trigger",
                                                    "balance_at_trigger",
                                                    "estimated",
                                                    "amount",
                                                    "currency",
                                                    "stripe_invoice_id",
                                                    "failure_code",
                                                    "failure_message",
                                                    "created_at",
                                                    "paid_at",
                                                    "failed_at"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "enabled",
                                        "card",
                                        "timezone",
                                        "period",
                                        "resets_at",
                                        "total_cap",
                                        "total_spent_this_month",
                                        "channels",
                                        "history"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/auto-top-up/card": {
            "post": {
                "operationId": "billing.auto-top-up.card",
                "summary": "POST /billing/auto-top-up/card: a Stripe Checkout (setup mode) to save a card",
                "tags": [
                    "AutoTopUp"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "url": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "url"
                                    ]
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Could not start saving a card. Please try again."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "This organization is closing; no card is needed."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/auto-top-up/{channel}": {
            "put": {
                "operationId": "billing.auto-top-up.update",
                "summary": "PUT /billing/auto-top-up/{channel} {enabled, threshold, pack, monthly_cap}",
                "tags": [
                    "AutoTopUp"
                ],
                "parameters": [
                    {
                        "name": "channel",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "enabled": {
                                        "type": "boolean"
                                    },
                                    "threshold": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "minimum": 1,
                                        "maximum": 10000000
                                    },
                                    "pack": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "monthly_cap": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "description": "A$ inc GST. Required when turning it on (the UI pre-fills a suggestion).",
                                        "minimum": 1,
                                        "maximum": 5000
                                    }
                                },
                                "required": [
                                    "enabled"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/plans": {
            "get": {
                "operationId": "billing.plans",
                "summary": "Public plan catalogue for the pricing page / signup",
                "tags": [
                    "Billing"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "plans": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "code": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "price_per_user": {
                                                        "type": "string"
                                                    },
                                                    "price_per_user_yearly": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "currency": {
                                                        "type": "string"
                                                    },
                                                    "max_users": {
                                                        "type": "string"
                                                    },
                                                    "voice_sms": {
                                                        "type": "string"
                                                    },
                                                    "quota": {
                                                        "type": "string"
                                                    },
                                                    "blurb": {
                                                        "type": "string"
                                                    },
                                                    "billable": {
                                                        "type": "boolean"
                                                    }
                                                },
                                                "required": [
                                                    "code",
                                                    "name",
                                                    "price_per_user",
                                                    "price_per_user_yearly",
                                                    "currency",
                                                    "max_users",
                                                    "voice_sms",
                                                    "quota",
                                                    "blurb",
                                                    "billable"
                                                ]
                                            }
                                        },
                                        "default": {
                                            "type": "string"
                                        },
                                        "prices_include_gst": {
                                            "type": "boolean"
                                        }
                                    },
                                    "required": [
                                        "plans",
                                        "default",
                                        "prices_include_gst"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/billing/summary": {
            "get": {
                "operationId": "billing.summary",
                "summary": "Current org's plan + pooled usage (for the Settings \u2192 Billing tab)",
                "tags": [
                    "Billing"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/sms-credits": {
            "get": {
                "operationId": "billing.sms-credits",
                "summary": "SMS or call pack balance, catalogue and ledger history (newest first).\nGET billing/sms-credits and billing/voice-credits. Each channel has its\nown balance and history",
                "tags": [
                    "Billing"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/voice-credits": {
            "get": {
                "operationId": "billing.voice-credits",
                "summary": "SMS or call pack balance, catalogue and ledger history (newest first).\nGET billing/sms-credits and billing/voice-credits. Each channel has its\nown balance and history",
                "tags": [
                    "Billing"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/checkout": {
            "post": {
                "operationId": "billing.checkout",
                "summary": "Start a Stripe Checkout session to subscribe/switch to a paid plan",
                "tags": [
                    "Billing"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "plan": {
                                        "type": "string",
                                        "enum": [
                                            "business",
                                            "pro"
                                        ]
                                    },
                                    "interval": {
                                        "type": "string",
                                        "enum": [
                                            "month",
                                            "year"
                                        ]
                                    }
                                },
                                "required": [
                                    "plan"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/portal": {
            "post": {
                "operationId": "billing.portal",
                "summary": "Stripe-hosted billing portal (update card, invoices, cancel)",
                "tags": [
                    "Billing"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "url": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "url"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                "No billing account yet \u2014 subscribe to a paid plan first."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/invoices": {
            "get": {
                "operationId": "billing.invoices",
                "summary": "The organization's invoices (subscriptions and packs), newest first, with links\nto Stripe's hosted invoice page and PDF. Admins only, like the rest of billing",
                "tags": [
                    "Billing"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Invoices are unavailable right now. Try again shortly."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/details": {
            "put": {
                "operationId": "billing.details",
                "summary": "Set the billing email (invoices go here) and/or ABN (printed on GST tax invoices)",
                "tags": [
                    "Billing"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "billing_email": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "abn": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "billing_email",
                                        "abn"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/cancel": {
            "post": {
                "operationId": "billing.cancel",
                "summary": "Cancel the plan at the end of the paid period (P1-21). Paging, SMS/voice\nand seats carry on until then; the plan then drops to Free when Stripe\ndeletes the subscription (webhook) or, failing that, on the hourly\nbilling:sync-plans. Without {\"confirm\": true} nothing changes and the\nresponse is a 422 preview of what would happen (the confirm step)",
                "tags": [
                    "Billing"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "ok": {
                                                    "type": "boolean"
                                                },
                                                "plan": {
                                                    "type": "string",
                                                    "const": "free"
                                                },
                                                "cancel_at": {
                                                    "type": "null"
                                                }
                                            },
                                            "required": [
                                                "ok",
                                                "plan",
                                                "cancel_at"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "ok": {
                                                    "type": "boolean"
                                                },
                                                "plan": {
                                                    "type": "string"
                                                },
                                                "cancel_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "ok",
                                                "plan",
                                                "cancel_at"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "ok": {
                                                    "type": "boolean"
                                                },
                                                "plan": {
                                                    "type": "string"
                                                },
                                                "cancel_at": {
                                                    "type": "string"
                                                },
                                                "already": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "ok",
                                                "plan",
                                                "cancel_at",
                                                "already"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Your organization is on a complimentary plan arranged with Athena Networks. To change plans, contact Athena support."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/resume": {
            "post": {
                "operationId": "billing.resume",
                "summary": "Undo a scheduled cancellation while the paid period lasts",
                "tags": [
                    "Billing"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "ok": {
                                            "type": "boolean"
                                        },
                                        "plan": {
                                            "type": "string"
                                        },
                                        "cancel_at": {
                                            "type": "null"
                                        }
                                    },
                                    "required": [
                                        "ok",
                                        "plan",
                                        "cancel_at"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "There is no scheduled cancellation to undo."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "This organization is closing. The owner can undo the closure in Settings \u2192 Company."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/sms-packs/checkout": {
            "post": {
                "operationId": "billing.sms-packs.checkout",
                "summary": "Start a one-off Stripe Checkout payment for an SMS or call pack (credited\nby webhook only). POST billing/sms-packs/checkout and\nbilling/voice-packs/checkout. 422 while the packs are dormant",
                "tags": [
                    "Billing"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "pack": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "pack"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/billing/voice-packs/checkout": {
            "post": {
                "operationId": "billing.voice-packs.checkout",
                "summary": "Start a one-off Stripe Checkout payment for an SMS or call pack (credited\nby webhook only). POST billing/sms-packs/checkout and\nbilling/voice-packs/checkout. 422 while the packs are dormant",
                "tags": [
                    "Billing"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "pack": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "pack"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/voice/bridge-callback": {
            "post": {
                "operationId": "voice.bridge_callback",
                "tags": [
                    "BridgeCallback"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "action": {
                                        "type": "string",
                                        "enum": [
                                            "acknowledge",
                                            "acknowledge_assign"
                                        ]
                                    },
                                    "alert_id": {
                                        "type": "integer"
                                    },
                                    "user_id": {
                                        "type": "integer"
                                    },
                                    "dtmf": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "notification_log_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                },
                                "required": [
                                    "action",
                                    "alert_id",
                                    "user_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "ok": {
                                            "type": "boolean"
                                        },
                                        "alert_status": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "ok",
                                        "alert_status"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "const": "unknown alert/user"
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "const": "unauthorized"
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/chatops/{action}/{alert}": {
            "get": {
                "operationId": "chatops.action",
                "tags": [
                    "ChatOps"
                ],
                "parameters": [
                    {
                        "name": "action",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            },
            "post": {
                "operationId": "chatops.perform",
                "tags": [
                    "ChatOps"
                ],
                "parameters": [
                    {
                        "name": "action",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "alert",
                        "in": "path",
                        "required": true,
                        "description": "The alert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/legal": {
            "get": {
                "operationId": "legal.show",
                "summary": "Public: the current terms version and document links (P1-4)",
                "tags": [
                    "Company"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "version": {
                                            "type": "string"
                                        },
                                        "draft": {
                                            "type": "boolean"
                                        },
                                        "documents": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "version",
                                        "draft",
                                        "documents"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/register": {
            "post": {
                "operationId": "company.register",
                "summary": "Public: provision a new company + its first admin, returning an API token",
                "tags": [
                    "Company"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "company_name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "admin_name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "admin_email": {
                                        "type": "string",
                                        "format": "email",
                                        "description": "#887: no unique rule here. A taken email gets the same answer as a new one.",
                                        "maxLength": 255
                                    },
                                    "password": {
                                        "type": "string"
                                    },
                                    "timezone": {
                                        "type": "string"
                                    },
                                    "plan": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "The paid plan picked on the form, offered after the email is confirmed.",
                                        "enum": [
                                            "free",
                                            "business",
                                            "pro",
                                            null
                                        ]
                                    },
                                    "turnstile_token": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2048
                                    },
                                    "accept_terms": {
                                        "description": "P1-4: the terms, privacy policy and AUP must be accepted, and the\nclient must have shown the current version.",
                                        "enum": [
                                            "yes",
                                            "on",
                                            "1",
                                            1,
                                            "true",
                                            true
                                        ]
                                    },
                                    "terms_version": {
                                        "type": "string",
                                        "enum": [
                                            "2026-11-13.2"
                                        ]
                                    }
                                },
                                "required": [
                                    "company_name",
                                    "admin_name",
                                    "admin_email",
                                    "password"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "check_email"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Check your email. We sent a link to confirm your address and finish setting up. Then sign in with your email and password."
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/signup-config": {
            "get": {
                "operationId": "auth.signup_config",
                "summary": "Public: what the sign-up form needs (bot check site key, password length)",
                "tags": [
                    "Company"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "turnstile_site_key": {
                                            "type": "string"
                                        },
                                        "password_min_length": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "turnstile_site_key",
                                        "password_min_length"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/organization": {
            "get": {
                "operationId": "company.show",
                "summary": "Current company",
                "tags": [
                    "Company"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/Organization"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "company.update",
                "summary": "Admin: update company name / settings (defaults, suppression, webhooks, custom actions)",
                "tags": [
                    "Company"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "settings": {
                                        "type": "object",
                                        "properties": {
                                            "default_priority": {
                                                "type": "string",
                                                "enum": [
                                                    "P1",
                                                    "P2",
                                                    "P3",
                                                    "P4",
                                                    "P5"
                                                ]
                                            },
                                            "suppress_priorities": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string",
                                                    "enum": [
                                                        "P1",
                                                        "P2",
                                                        "P3",
                                                        "P4",
                                                        "P5"
                                                    ]
                                                }
                                            },
                                            "outbound_webhooks": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                }
                                            },
                                            "custom_actions": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                }
                                            },
                                            "oncall_reminder_minutes": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 1440
                                            },
                                            "shift_change_mode": {
                                                "type": "string",
                                                "description": "Org default for how shifts change (schedules can override): handoff (Opsgenie) | overlap.",
                                                "enum": [
                                                    "handoff",
                                                    "overlap"
                                                ]
                                            },
                                            "templates": {
                                                "type": "array",
                                                "description": "Per-channel notification message templates ({{placeholder}} substitution).",
                                                "items": {
                                                    "type": "object",
                                                    "properties": {
                                                        "subject": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "maxLength": 500
                                                        },
                                                        "body": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "maxLength": 5000
                                                        }
                                                    }
                                                }
                                            },
                                            "global_channels": {
                                                "type": "object",
                                                "description": "Global chat/webhook destinations (fire once per alert).",
                                                "properties": {
                                                    "slack_webhook_url": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "uri",
                                                        "maxLength": 1000
                                                    },
                                                    "teams_webhook_url": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "uri",
                                                        "maxLength": 1000
                                                    },
                                                    "webhook_url": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "uri",
                                                        "maxLength": 1000
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "require_mfa": {
                                        "type": "boolean",
                                        "description": "Require two-factor for every password sign-in in the org (P1-10)."
                                    },
                                    "call_voice": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "#962: the default Deepgram voice for alert calls, one of `GET /voices`.\nnull = NOCgenie's default. Each user can override it in their profile.",
                                        "enum": [
                                            "aura-2-thalia-en",
                                            "aura-2-theia-en",
                                            "aura-2-hyperion-en",
                                            "aura-2-pandora-en",
                                            "aura-2-draco-en",
                                            "aura-2-electra-en",
                                            "aura-2-orpheus-en",
                                            "aura-2-zeus-en",
                                            null
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/Organization"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/organization/sso": {
            "get": {
                "operationId": "organization.sso",
                "summary": "Admin, read-only (#720): how the org's people can sign in with single sign-on.\nConnections map an identity provider to this org, so they are created and\nchanged by Athena (`php artisan sso:connect`), never self-served: a\ncustomer-made mapping could claim another tenant's identity provider",
                "tags": [
                    "Company"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "enforced": {
                                            "type": "boolean"
                                        },
                                        "single_idp_fallback": {
                                            "type": "boolean"
                                        },
                                        "connections": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "protocol": {
                                                        "type": "string"
                                                    },
                                                    "issuer": {
                                                        "type": "string"
                                                    },
                                                    "provider": {
                                                        "type": "string"
                                                    },
                                                    "allowed_domains": {
                                                        "type": "array",
                                                        "items": {}
                                                    },
                                                    "default_role": {
                                                        "type": "string"
                                                    },
                                                    "enabled": {
                                                        "type": "boolean"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "protocol",
                                                    "issuer",
                                                    "provider",
                                                    "allowed_domains",
                                                    "default_role",
                                                    "enabled"
                                                ]
                                            }
                                        },
                                        "entra": {
                                            "type": "object",
                                            "description": "Self-service (Microsoft Entra ID); SAML, Okta, Google etc. still go through support.",
                                            "properties": {
                                                "available": {
                                                    "type": "boolean"
                                                },
                                                "admin_consent_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "available",
                                                "admin_consent_url"
                                            ]
                                        },
                                        "you_sign_in_with_sso": {
                                            "type": "string"
                                        },
                                        "jit_roles": {
                                            "type": "array",
                                            "prefixItems": [
                                                {
                                                    "type": "string",
                                                    "const": "responder"
                                                },
                                                {
                                                    "type": "string",
                                                    "const": "read_only"
                                                },
                                                {
                                                    "type": "string",
                                                    "const": "roster"
                                                },
                                                {
                                                    "type": "string",
                                                    "const": "admin"
                                                }
                                            ],
                                            "minItems": 4,
                                            "maxItems": 4
                                        },
                                        "managed_by": {
                                            "type": "string",
                                            "const": "support@athenanetworks.com.au"
                                        }
                                    },
                                    "required": [
                                        "enforced",
                                        "single_idp_fallback",
                                        "connections",
                                        "entra",
                                        "you_sign_in_with_sso",
                                        "jit_roles",
                                        "managed_by"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/organization/sso/connect": {
            "post": {
                "operationId": "organization.sso.connect",
                "summary": "Admin: start \"Connect Microsoft Entra ID\". Returns the Microsoft sign-in URL; the\ncallback connects the tenant of whoever signs in (SsoSelfService). Browser only:\nthe leg is bound to this session and its signed-in admin",
                "tags": [
                    "Company"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "url": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "url"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                "Connect single sign-on from the NOCgenie website, signed in with your password."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/organization/sso/connections/{id}": {
            "patch": {
                "operationId": "organization.sso.update",
                "summary": "Admin: change a connection's email domains, joining role or on/off",
                "tags": [
                    "Company"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "allowed_domains": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "pattern": "^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$",
                                            "maxLength": 253
                                        },
                                        "maxItems": 50
                                    },
                                    "default_role": {
                                        "type": "string",
                                        "enum": [
                                            "responder",
                                            "read_only",
                                            "roster",
                                            "admin"
                                        ]
                                    },
                                    "enabled": {
                                        "type": "boolean"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "enforced": {
                                            "type": "boolean"
                                        },
                                        "single_idp_fallback": {
                                            "type": "boolean"
                                        },
                                        "connections": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "protocol": {
                                                        "type": "string"
                                                    },
                                                    "issuer": {
                                                        "type": "string"
                                                    },
                                                    "provider": {
                                                        "type": "string"
                                                    },
                                                    "allowed_domains": {
                                                        "type": "array",
                                                        "items": {}
                                                    },
                                                    "default_role": {
                                                        "type": "string"
                                                    },
                                                    "enabled": {
                                                        "type": "boolean"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "protocol",
                                                    "issuer",
                                                    "provider",
                                                    "allowed_domains",
                                                    "default_role",
                                                    "enabled"
                                                ]
                                            }
                                        },
                                        "entra": {
                                            "type": "object",
                                            "description": "Self-service (Microsoft Entra ID); SAML, Okta, Google etc. still go through support.",
                                            "properties": {
                                                "available": {
                                                    "type": "boolean"
                                                },
                                                "admin_consent_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "available",
                                                "admin_consent_url"
                                            ]
                                        },
                                        "you_sign_in_with_sso": {
                                            "type": "string"
                                        },
                                        "jit_roles": {
                                            "type": "array",
                                            "prefixItems": [
                                                {
                                                    "type": "string",
                                                    "const": "responder"
                                                },
                                                {
                                                    "type": "string",
                                                    "const": "read_only"
                                                },
                                                {
                                                    "type": "string",
                                                    "const": "roster"
                                                },
                                                {
                                                    "type": "string",
                                                    "const": "admin"
                                                }
                                            ],
                                            "minItems": 4,
                                            "maxItems": 4
                                        },
                                        "managed_by": {
                                            "type": "string",
                                            "const": "support@athenanetworks.com.au"
                                        }
                                    },
                                    "required": [
                                        "enforced",
                                        "single_idp_fallback",
                                        "connections",
                                        "entra",
                                        "you_sign_in_with_sso",
                                        "jit_roles",
                                        "managed_by"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "organization.sso.delete",
                "summary": "Admin: remove a connection (people already signed up keep their accounts)",
                "tags": [
                    "Company"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "enforced": {
                                            "type": "boolean"
                                        },
                                        "single_idp_fallback": {
                                            "type": "boolean"
                                        },
                                        "connections": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "protocol": {
                                                        "type": "string"
                                                    },
                                                    "issuer": {
                                                        "type": "string"
                                                    },
                                                    "provider": {
                                                        "type": "string"
                                                    },
                                                    "allowed_domains": {
                                                        "type": "array",
                                                        "items": {}
                                                    },
                                                    "default_role": {
                                                        "type": "string"
                                                    },
                                                    "enabled": {
                                                        "type": "boolean"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "protocol",
                                                    "issuer",
                                                    "provider",
                                                    "allowed_domains",
                                                    "default_role",
                                                    "enabled"
                                                ]
                                            }
                                        },
                                        "entra": {
                                            "type": "object",
                                            "description": "Self-service (Microsoft Entra ID); SAML, Okta, Google etc. still go through support.",
                                            "properties": {
                                                "available": {
                                                    "type": "boolean"
                                                },
                                                "admin_consent_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "available",
                                                "admin_consent_url"
                                            ]
                                        },
                                        "you_sign_in_with_sso": {
                                            "type": "string"
                                        },
                                        "jit_roles": {
                                            "type": "array",
                                            "prefixItems": [
                                                {
                                                    "type": "string",
                                                    "const": "responder"
                                                },
                                                {
                                                    "type": "string",
                                                    "const": "read_only"
                                                },
                                                {
                                                    "type": "string",
                                                    "const": "roster"
                                                },
                                                {
                                                    "type": "string",
                                                    "const": "admin"
                                                }
                                            ],
                                            "minItems": 4,
                                            "maxItems": 4
                                        },
                                        "managed_by": {
                                            "type": "string",
                                            "const": "support@athenanetworks.com.au"
                                        }
                                    },
                                    "required": [
                                        "enforced",
                                        "single_idp_fallback",
                                        "connections",
                                        "entra",
                                        "you_sign_in_with_sso",
                                        "jit_roles",
                                        "managed_by"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/organization/sso/enforcement": {
            "put": {
                "operationId": "organization.sso.enforcement",
                "summary": "Admin: require single sign-on (password sign-in refused) or not",
                "tags": [
                    "Company"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "enforced": {
                                        "type": "boolean"
                                    }
                                },
                                "required": [
                                    "enforced"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "enforced": {
                                            "type": "boolean"
                                        },
                                        "single_idp_fallback": {
                                            "type": "boolean"
                                        },
                                        "connections": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "protocol": {
                                                        "type": "string"
                                                    },
                                                    "issuer": {
                                                        "type": "string"
                                                    },
                                                    "provider": {
                                                        "type": "string"
                                                    },
                                                    "allowed_domains": {
                                                        "type": "array",
                                                        "items": {}
                                                    },
                                                    "default_role": {
                                                        "type": "string"
                                                    },
                                                    "enabled": {
                                                        "type": "boolean"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "protocol",
                                                    "issuer",
                                                    "provider",
                                                    "allowed_domains",
                                                    "default_role",
                                                    "enabled"
                                                ]
                                            }
                                        },
                                        "entra": {
                                            "type": "object",
                                            "description": "Self-service (Microsoft Entra ID); SAML, Okta, Google etc. still go through support.",
                                            "properties": {
                                                "available": {
                                                    "type": "boolean"
                                                },
                                                "admin_consent_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "available",
                                                "admin_consent_url"
                                            ]
                                        },
                                        "you_sign_in_with_sso": {
                                            "type": "string"
                                        },
                                        "jit_roles": {
                                            "type": "array",
                                            "prefixItems": [
                                                {
                                                    "type": "string",
                                                    "const": "responder"
                                                },
                                                {
                                                    "type": "string",
                                                    "const": "read_only"
                                                },
                                                {
                                                    "type": "string",
                                                    "const": "roster"
                                                },
                                                {
                                                    "type": "string",
                                                    "const": "admin"
                                                }
                                            ],
                                            "minItems": 4,
                                            "maxItems": 4
                                        },
                                        "managed_by": {
                                            "type": "string",
                                            "const": "support@athenanetworks.com.au"
                                        }
                                    },
                                    "required": [
                                        "enforced",
                                        "single_idp_fallback",
                                        "connections",
                                        "entra",
                                        "you_sign_in_with_sso",
                                        "jit_roles",
                                        "managed_by"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/contact-methods": {
            "get": {
                "operationId": "contactMethod.index",
                "tags": [
                    "ContactMethod"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/ContactMethod"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "contactMethod.store",
                "tags": [
                    "ContactMethod"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "email",
                                            "sms",
                                            "voice",
                                            "push",
                                            "slack",
                                            "teams",
                                            "webhook"
                                        ]
                                    },
                                    "value": {
                                        "type": "string",
                                        "maxLength": 512
                                    },
                                    "enabled": {
                                        "type": "boolean"
                                    },
                                    "meta": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "required": [
                                    "type",
                                    "value"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/ContactMethod"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, or a plan gate (PlanGateError: code plan_feature_unavailable or plan_limit_reached).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/PlanGateError"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "errors": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "errors"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/contact-methods/{contactMethod}": {
            "put": {
                "operationId": "contactMethod.update",
                "tags": [
                    "ContactMethod"
                ],
                "parameters": [
                    {
                        "name": "contactMethod",
                        "in": "path",
                        "required": true,
                        "description": "The contact method ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "email",
                                            "sms",
                                            "voice",
                                            "push",
                                            "slack",
                                            "teams",
                                            "webhook"
                                        ]
                                    },
                                    "value": {
                                        "type": "string",
                                        "maxLength": 512
                                    },
                                    "enabled": {
                                        "type": "boolean"
                                    },
                                    "meta": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "required": [
                                    "type",
                                    "value"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/ContactMethod"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, or a plan gate (PlanGateError: code plan_feature_unavailable or plan_limit_reached).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/PlanGateError"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "errors": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "errors"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "contactMethod.destroy",
                "tags": [
                    "ContactMethod"
                ],
                "parameters": [
                    {
                        "name": "contactMethod",
                        "in": "path",
                        "required": true,
                        "description": "The contact method ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "This comes from your profile. Turn it off instead, or change your email or mobile in Profile."
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "profile_contact_method"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/contact-methods/{contactMethod}/verify": {
            "post": {
                "operationId": "contact.verify.send",
                "description": "Preferred way to verify a contact method (#743). Email: the user's own verified account email is verified at once (verified: true); any other address is mailed a 6-digit code. SMS/voice: texts the phone-verification code (allowlisted test numbers work on any plan; read their code with `php artisan contact:test-code`). Push, Slack, Teams and webhooks: 422 code not_verifiable. Same TTL (10 min), attempts (5) and send limits (3 per 10 min, 10 a day) as the phone code. Another user's method: 404.",
                "summary": "POST me/contact-methods/{id}/verify (#743, preferred over me/phone-verification):\nsend a verification code for this method. SMS/voice text the phone code (test\nnumbers work); email mails a code, or verifies the user's own verified account\nemail at once. Same TTL, attempts and rate limits as the phone code",
                "tags": [
                    "ContactMethod"
                ],
                "parameters": [
                    {
                        "name": "contactMethod",
                        "in": "path",
                        "required": true,
                        "description": "The contact method ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "verified": {
                                                    "type": "boolean"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Code sent."
                                                },
                                                "channel": {
                                                    "type": "string",
                                                    "const": "email"
                                                },
                                                "destination": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "verified",
                                                "message",
                                                "channel",
                                                "destination"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "verified": {
                                                    "type": "boolean"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Verified: this is your account email."
                                                }
                                            },
                                            "required": [
                                                "verified",
                                                "message"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "verified": {
                                                    "type": "boolean"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Code sent."
                                                },
                                                "channel": {
                                                    "type": "string",
                                                    "const": "sms"
                                                },
                                                "destination": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "verified",
                                                "message",
                                                "channel",
                                                "destination"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "verified": {
                                                    "type": "boolean"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Already verified."
                                                }
                                            },
                                            "required": [
                                                "verified",
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Could not send the code. Try again shortly."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "const": "Too many verification codes requested. Try again later."
                                                }
                                            },
                                            "required": [
                                                "message"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "anyOf": [
                                                        {
                                                            "type": "null"
                                                        },
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "enum": [
                                                                "Too many verification codes requested. Try again later."
                                                            ]
                                                        }
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "message"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, or a plan gate (PlanGateError: code plan_feature_unavailable or plan_limit_reached).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/PlanGateError"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "errors": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "errors"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/contact-methods/{contactMethod}/verify/confirm": {
            "post": {
                "operationId": "contact.verify.confirm",
                "description": "Confirm the code from POST .../verify; marks this contact method verified (#743). A wrong or expired code is a 422.",
                "summary": "POST me/contact-methods/{id}/verify/confirm {code}: marks this method verified",
                "tags": [
                    "ContactMethod"
                ],
                "parameters": [
                    {
                        "name": "contactMethod",
                        "in": "path",
                        "required": true,
                        "description": "The contact method ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "code": {
                                        "type": "string",
                                        "maxLength": 12
                                    }
                                },
                                "required": [
                                    "code"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "verified": {
                                                    "type": "boolean"
                                                },
                                                "contact_method": {
                                                    "anyOf": [
                                                        {
                                                            "$ref": "#/components/schemas/ContactMethod"
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "verified",
                                                "contact_method"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "verified": {
                                                    "type": "boolean"
                                                },
                                                "contact_method": {
                                                    "$ref": "#/components/schemas/ContactMethod"
                                                }
                                            },
                                            "required": [
                                                "verified",
                                                "contact_method"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/contact-methods/{contactMethod}/test": {
            "post": {
                "operationId": "contact_methods.test",
                "summary": "POST me/contact-methods/{id}/test (#714): send ONE test message to this\ncontact method through the normal provider. Verified methods only; limited\nto 3 tests per 10 minutes per user (shared with rule tests); never metered\nor billed. Returns the notification_logs row it wrote (event \"test\")",
                "tags": [
                    "ContactMethod"
                ],
                "parameters": [
                    {
                        "name": "contactMethod",
                        "in": "path",
                        "required": true,
                        "description": "The contact method ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "502": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Test notification failed."
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "test_failed"
                                        },
                                        "notification_log": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "channel": {
                                                    "type": "string"
                                                },
                                                "event": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "provider": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "error": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sent_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "channel",
                                                "event",
                                                "status",
                                                "provider",
                                                "error",
                                                "sent_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error",
                                        "notification_log"
                                    ]
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Test notification sent."
                                        },
                                        "notification_log": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "channel": {
                                                    "type": "string"
                                                },
                                                "event": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "provider": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "error": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sent_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "channel",
                                                "event",
                                                "status",
                                                "provider",
                                                "error",
                                                "sent_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "notification_log"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "anyOf": [
                                                        {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        {}
                                                    ]
                                                },
                                                "error": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string",
                                                            "const": "test_blocked"
                                                        },
                                                        {}
                                                    ]
                                                },
                                                "notification_log": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "channel": {
                                                            "type": "string"
                                                        },
                                                        "event": {
                                                            "type": "string"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "provider": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "error": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "sent_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "channel",
                                                        "event",
                                                        "status",
                                                        "provider",
                                                        "error",
                                                        "sent_at"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "error",
                                                "notification_log"
                                            ],
                                            "additionalProperties": {}
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "const": "Verify this contact method before sending a test."
                                                },
                                                "error": {
                                                    "type": "string",
                                                    "const": "contact_method_unverified"
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "error"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "test_rate_limited"
                                        },
                                        "retry_after": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error",
                                        "retry_after"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "This organization is closing or closed, so it sends no notifications."
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "organization_alerting_stopped"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/devices": {
            "get": {
                "operationId": "devices.index",
                "tags": [
                    "Device"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Device"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "devices.store",
                "summary": "Idempotent upsert by installation_id when sent, else by push_token. 201 when new, 200 when it already existed",
                "tags": [
                    "Device"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "push_token": {
                                        "type": "string",
                                        "minLength": 20,
                                        "maxLength": 512
                                    },
                                    "platform": {
                                        "type": "string",
                                        "enum": [
                                            "ios",
                                            "android"
                                        ]
                                    },
                                    "app_version": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "installation_id": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "#313: a stable per-install id. Upserts by (user, installation) and keeps\nthe device id and its ack token (a token refresh, not a sign-in).",
                                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                                        "maxLength": 64
                                    }
                                },
                                "required": [
                                    "push_token",
                                    "platform"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/devices/{device}": {
            "delete": {
                "operationId": "devices.destroy",
                "summary": "DELETE me/devices/{id or push token}. Only the caller's own devices",
                "tags": [
                    "Device"
                ],
                "parameters": [
                    {
                        "name": "device",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Device removed."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/escalation-policies": {
            "get": {
                "operationId": "escalationPolicy.index",
                "summary": "The list carries each policy's steps, so the UI can show what it does at a glance",
                "tags": [
                    "EscalationPolicy"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "allOf": [
                                                            {
                                                                "$ref": "#/components/schemas/EscalationPolicy"
                                                            },
                                                            {
                                                                "type": "object",
                                                                "properties": {
                                                                    "steps": {
                                                                        "type": "array",
                                                                        "description": "In order.",
                                                                        "items": {
                                                                            "$ref": "#/components/schemas/EscalationStep"
                                                                        }
                                                                    }
                                                                },
                                                                "required": [
                                                                    "steps"
                                                                ]
                                                            }
                                                        ]
                                                    }
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "escalationPolicy.store",
                "tags": [
                    "EscalationPolicy"
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/escalation-policies/{id}": {
            "get": {
                "operationId": "escalationPolicy.show",
                "tags": [
                    "EscalationPolicy"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "escalationPolicy.update",
                "tags": [
                    "EscalationPolicy"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": [
                                        "object",
                                        "null"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "escalationPolicy.destroy",
                "summary": "Deleting a policy cascades to its escalation_states, which would silently end\nevery live escalation on it (audit #339 P1-8), and nulls routing_rules.\nescalation_policy_id, which would quietly reroute those rules' alerts to the\nfallback (#507). Refuse while either applies and say which, so the admin can\nclose the alerts or repoint the rules first",
                "tags": [
                    "EscalationPolicy"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "escalation_policy_in_use"
                                        },
                                        "live_alert_ids": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "references": {
                                            "type": "array",
                                            "prefixItems": [
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "const": "routing_rule"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "enabled": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "id",
                                                            "name",
                                                            "enabled"
                                                        ]
                                                    }
                                                },
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "const": "team"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "id",
                                                            "name"
                                                        ]
                                                    }
                                                }
                                            ],
                                            "minItems": 2,
                                            "maxItems": 2
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error",
                                        "live_alert_ids",
                                        "references"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/escalation-policies/{id}/steps": {
            "put": {
                "operationId": "escalationPolicy.syncSteps",
                "summary": "Replace the policy's ordered steps in one call",
                "tags": [
                    "EscalationPolicy"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "steps": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "delay_minutes": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 1440
                                                },
                                                "target_type": {
                                                    "type": "string",
                                                    "enum": [
                                                        "user",
                                                        "team",
                                                        "schedule"
                                                    ]
                                                },
                                                "target_id": {
                                                    "type": "integer"
                                                },
                                                "notify_condition": {
                                                    "type": "string",
                                                    "enum": [
                                                        "if_not_acked",
                                                        "always"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "delay_minutes",
                                                "target_type",
                                                "target_id"
                                            ]
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "steps"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, or a plan gate (PlanGateError: code plan_feature_unavailable or plan_limit_reached).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/PlanGateError"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "errors": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "errors"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/health": {
            "get": {
                "operationId": "health",
                "tags": [
                    "Health"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/heartbeats/ping": {
            "get": {
                "operationId": "heartbeats.ping_header",
                "summary": "GET|POST /heartbeats/ping with the token in X-NOCgenie-Token or Authorization: Bearer (#591)",
                "tags": [
                    "Heartbeat"
                ],
                "responses": {
                    "401": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Send the heartbeat token in an X-NOCgenie-Token or Authorization: Bearer header, or use /heartbeats/{token}/ping."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "pong"
                                        },
                                        "next_expected_before": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "next_expected_before"
                                    ]
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string",
                                            "enum": [
                                                "organization_closed",
                                                "organization_alerting_stopped"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Unknown or disabled heartbeat token."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/heartbeats/{token}/ping": {
            "get": {
                "operationId": "heartbeats.ping",
                "tags": [
                    "Heartbeat"
                ],
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "pong"
                                        },
                                        "next_expected_before": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "next_expected_before"
                                    ]
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string",
                                            "enum": [
                                                "organization_closed",
                                                "organization_alerting_stopped"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Unknown or disabled heartbeat token."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/heartbeats": {
            "get": {
                "operationId": "heartbeat.index",
                "tags": [
                    "Heartbeat"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/Heartbeat"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "heartbeat.store",
                "tags": [
                    "Heartbeat"
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/heartbeats/{id}": {
            "get": {
                "operationId": "heartbeat.show",
                "tags": [
                    "Heartbeat"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "heartbeat.update",
                "tags": [
                    "Heartbeat"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": [
                                        "object",
                                        "null"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "heartbeat.destroy",
                "tags": [
                    "Heartbeat"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/impersonation/exchange": {
            "post": {
                "operationId": "auth.impersonation.exchange",
                "summary": "POST auth/impersonation/exchange {code}: trade the staff portal's one-time code for a\ncookie session as the user. Browser sessions only: a bearer/mobile client gets nothing",
                "tags": [
                    "Impersonation"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "code": {
                                        "type": "string",
                                        "maxLength": 128
                                    }
                                },
                                "required": [
                                    "code"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "session": {
                                            "type": "boolean"
                                        },
                                        "user": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "role": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name",
                                                "email",
                                                "role"
                                            ]
                                        },
                                        "impersonation": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "staff": {
                                                    "type": "object",
                                                    "properties": {
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "name"
                                                    ]
                                                },
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name"
                                                    ]
                                                },
                                                "organization": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name"
                                                    ]
                                                },
                                                "expires_at": {
                                                    "type": "string"
                                                },
                                                "return_url": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "staff",
                                                "user",
                                                "organization",
                                                "expires_at",
                                                "return_url"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "session",
                                        "user",
                                        "impersonation"
                                    ]
                                }
                            }
                        },
                        "headers": {
                            "Cache-Control": {
                                "schema": {
                                    "type": "string",
                                    "const": "no-store"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "This support sign-in link has expired or was already used. Start again from the staff portal."
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "impersonation_code_invalid"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Support sessions open in the web app only."
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "impersonation_web_only"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/impersonation/end": {
            "post": {
                "operationId": "auth.impersonation.end",
                "summary": "POST auth/impersonation/end: the banner's \"End session\". Signs this browser out",
                "tags": [
                    "Impersonation"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "ended": {
                                            "type": "boolean"
                                        },
                                        "return_url": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "ended",
                                        "return_url"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "This is not an Athena support session."
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "not_impersonating"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/inbound-failures": {
            "get": {
                "operationId": "inbound_failures.index",
                "tags": [
                    "InboundFailure"
                ],
                "parameters": [
                    {
                        "name": "integration_id",
                        "in": "query",
                        "schema": {
                            "type": [
                                "integer",
                                "null"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/InboundFailure"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/inbound": {
            "post": {
                "operationId": "inbound.store_header",
                "summary": "POST /inbound with the token in X-NOCgenie-Token or Authorization: Bearer (#591)",
                "tags": [
                    "InboundWebhook"
                ],
                "responses": {
                    "401": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Send the integration token in an X-NOCgenie-Token or Authorization: Bearer header, or post to /inbound/{token}."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Unknown or disabled integration token."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/inbound/email": {
            "post": {
                "operationId": "inbound.email",
                "summary": "POST /inbound/email: the one endpoint the inbound mail server (Postal) posts every\nmessage to. The email integration is the one whose email_key is the user part of\nan address in the To header (plus-tags ignored, case-insensitive); the envelope\nrecipient (rcpt_to) is the fallback for mail that reached us by Bcc or a list",
                "tags": [
                    "InboundWebhook"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "No enabled email integration for this address."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Invalid webhook signature."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/inbound/{token}": {
            "post": {
                "operationId": "inbound.store",
                "tags": [
                    "InboundWebhook"
                ],
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Unknown or disabled integration token."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/incidents": {
            "get": {
                "operationId": "incidents.index",
                "tags": [
                    "Incident"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "current_page": {
                                            "type": "integer",
                                            "minimum": 1
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Incident"
                                            }
                                        },
                                        "first_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "from": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ],
                                            "minimum": 1
                                        },
                                        "last_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "last_page": {
                                            "type": "integer",
                                            "minimum": 1
                                        },
                                        "links": {
                                            "type": "array",
                                            "description": "Generated paginator links.",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "url": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "label": {
                                                        "type": "string"
                                                    },
                                                    "active": {
                                                        "type": "boolean"
                                                    }
                                                },
                                                "required": [
                                                    "url",
                                                    "label",
                                                    "active"
                                                ]
                                            }
                                        },
                                        "next_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "path": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "description": "Base path for paginator generated URLs."
                                        },
                                        "per_page": {
                                            "type": "integer",
                                            "description": "Number of items shown per page.",
                                            "minimum": 0
                                        },
                                        "prev_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "to": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ],
                                            "description": "Number of the last item in the slice.",
                                            "minimum": 1
                                        },
                                        "total": {
                                            "type": "integer",
                                            "description": "Total number of items being paginated.",
                                            "minimum": 0
                                        }
                                    },
                                    "required": [
                                        "current_page",
                                        "data",
                                        "first_page_url",
                                        "from",
                                        "last_page_url",
                                        "last_page",
                                        "links",
                                        "next_page_url",
                                        "path",
                                        "per_page",
                                        "prev_page_url",
                                        "to",
                                        "total"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "incidents.store",
                "tags": [
                    "Incident"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10000
                                    },
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "open",
                                            "investigating",
                                            "resolved"
                                        ]
                                    },
                                    "severity": {
                                        "type": "string",
                                        "enum": [
                                            "P1",
                                            "P2",
                                            "P3",
                                            "P4",
                                            "P5"
                                        ]
                                    },
                                    "team_id": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "commander_id": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "stakeholder_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "required": [
                                    "title"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Incident"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/incidents/{incident}": {
            "get": {
                "operationId": "incidents.show",
                "tags": [
                    "Incident"
                ],
                "parameters": [
                    {
                        "name": "incident",
                        "in": "path",
                        "required": true,
                        "description": "The incident ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Incident"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "incidents.update",
                "tags": [
                    "Incident"
                ],
                "parameters": [
                    {
                        "name": "incident",
                        "in": "path",
                        "required": true,
                        "description": "The incident ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10000
                                    },
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "open",
                                            "investigating",
                                            "resolved"
                                        ]
                                    },
                                    "severity": {
                                        "type": "string",
                                        "enum": [
                                            "P1",
                                            "P2",
                                            "P3",
                                            "P4",
                                            "P5"
                                        ]
                                    },
                                    "team_id": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "commander_id": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "stakeholder_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/Incident"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "incidents.destroy",
                "tags": [
                    "Incident"
                ],
                "parameters": [
                    {
                        "name": "incident",
                        "in": "path",
                        "required": true,
                        "description": "The incident ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/incidents/{incident}/updates": {
            "post": {
                "operationId": "incident.addUpdate",
                "summary": "Post a note to the incident timeline (and notify stakeholders)",
                "tags": [
                    "Incident"
                ],
                "parameters": [
                    {
                        "name": "incident",
                        "in": "path",
                        "required": true,
                        "description": "The incident ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "message": {
                                        "type": "string",
                                        "maxLength": 5000
                                    }
                                },
                                "required": [
                                    "message"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Incident"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/incidents/{incident}/alerts": {
            "post": {
                "operationId": "incident.linkAlert",
                "tags": [
                    "Incident"
                ],
                "parameters": [
                    {
                        "name": "incident",
                        "in": "path",
                        "required": true,
                        "description": "The incident ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "alert_id": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "alert_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Incident"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/incidents/{incident}/alerts/{alertId}": {
            "delete": {
                "operationId": "incident.unlinkAlert",
                "tags": [
                    "Incident"
                ],
                "parameters": [
                    {
                        "name": "incident",
                        "in": "path",
                        "required": true,
                        "description": "The incident ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "alertId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Incident"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/incidents/{incident}/services": {
            "put": {
                "operationId": "incident.syncServices",
                "summary": "Set the impacted services for an incident (and optionally each service's status)",
                "tags": [
                    "Incident"
                ],
                "parameters": [
                    {
                        "name": "incident",
                        "in": "path",
                        "required": true,
                        "description": "The incident ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "service_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "operational",
                                            "degraded",
                                            "partial_outage",
                                            "major_outage",
                                            "maintenance"
                                        ]
                                    }
                                },
                                "required": [
                                    "service_ids"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Incident"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/incidents/{incident}/postmortem": {
            "put": {
                "operationId": "incident.postmortem",
                "summary": "Write / publish the incident postmortem",
                "tags": [
                    "Incident"
                ],
                "parameters": [
                    {
                        "name": "incident",
                        "in": "path",
                        "required": true,
                        "description": "The incident ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "summary": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10000
                                    },
                                    "root_cause": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10000
                                    },
                                    "impact": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10000
                                    },
                                    "action_items": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "maxLength": 1000
                                        }
                                    },
                                    "publish": {
                                        "type": "boolean"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/Incident"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/incident-rules": {
            "get": {
                "operationId": "incidentRule.index",
                "tags": [
                    "IncidentRule"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/IncidentRule"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "incidentRule.store",
                "tags": [
                    "IncidentRule"
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/incident-rules/{id}": {
            "get": {
                "operationId": "incidentRule.show",
                "tags": [
                    "IncidentRule"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "incidentRule.update",
                "tags": [
                    "IncidentRule"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": [
                                        "object",
                                        "null"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "incidentRule.destroy",
                "tags": [
                    "IncidentRule"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/integrations": {
            "get": {
                "operationId": "integration.index",
                "tags": [
                    "Integration"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/Integration"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "integration.store",
                "tags": [
                    "Integration"
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/integrations/{id}": {
            "get": {
                "operationId": "integration.show",
                "tags": [
                    "Integration"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "integration.update",
                "tags": [
                    "Integration"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": [
                                        "object",
                                        "null"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "integration.destroy",
                "summary": "Delete an integration (#508). Refused (409) when the delete would quietly\nchange who gets paged:\n - it is enabled and received something in the last 24 h: its sender would\n   start getting 404s and those alerts would never page. Disable it first.\n - a maintenance window is scoped to it: dropping the id could leave that\n   window with an empty scope, which means \"the whole organization\"",
                "tags": [
                    "Integration"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string",
                                            "enum": [
                                                "integration_live",
                                                "integration_in_use"
                                            ]
                                        },
                                        "references": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "type": {
                                                        "type": "string",
                                                        "const": "maintenance_window"
                                                    },
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "state": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "type",
                                                    "id",
                                                    "name",
                                                    "state"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error",
                                        "references"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/integrations/{id}/rotate-token": {
            "post": {
                "operationId": "integration.rotateToken",
                "summary": "Rotate the inbound token (and an email integration's inbound address with it)",
                "tags": [
                    "Integration"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "string"
                                        },
                                        "token": {
                                            "type": "string"
                                        },
                                        "email_address": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "id",
                                        "token",
                                        "email_address"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/maintenance-windows": {
            "get": {
                "operationId": "maintenanceWindow.index",
                "tags": [
                    "MaintenanceWindow"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/MaintenanceWindow"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "maintenanceWindow.store",
                "tags": [
                    "MaintenanceWindow"
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/maintenance-windows/{id}": {
            "get": {
                "operationId": "maintenanceWindow.show",
                "tags": [
                    "MaintenanceWindow"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "maintenanceWindow.update",
                "tags": [
                    "MaintenanceWindow"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": [
                                        "object",
                                        "null"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "maintenanceWindow.destroy",
                "tags": [
                    "MaintenanceWindow"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/timezones": {
            "get": {
                "operationId": "meta.timezones",
                "tags": [
                    "Meta"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/mfa": {
            "get": {
                "operationId": "mfa.show",
                "tags": [
                    "Mfa"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "enabled": {
                                            "type": "boolean"
                                        },
                                        "confirmed_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "required_by_organization": {
                                            "type": "boolean"
                                        },
                                        "recovery_codes_remaining": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "enabled",
                                        "confirmed_at",
                                        "required_by_organization",
                                        "recovery_codes_remaining"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "mfa.destroy",
                "summary": "Turn MFA off: password and a current code (or recovery code). Not allowed when the org requires it",
                "tags": [
                    "Mfa"
                ],
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 16
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "enabled": {
                                            "type": "boolean"
                                        }
                                    },
                                    "required": [
                                        "enabled"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/mfa/setup": {
            "post": {
                "operationId": "mfa.setup",
                "summary": "Start enrolment: needs the current password. Returns the secret and a QR code",
                "tags": [
                    "Mfa"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "secret": {
                                            "type": "string",
                                            "const": ""
                                        },
                                        "otpauth_uri": {
                                            "type": "string"
                                        },
                                        "qr_svg": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "secret",
                                        "otpauth_uri",
                                        "qr_svg"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                "Two-factor authentication is already on. Turn it off first to re-enrol."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/mfa/confirm": {
            "post": {
                "operationId": "mfa.confirm",
                "summary": "Finish enrolment with a code from the app. Returns the recovery codes once",
                "tags": [
                    "Mfa"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "code": {
                                        "type": "string",
                                        "maxLength": 16
                                    }
                                },
                                "required": [
                                    "code"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "enabled": {
                                            "type": "boolean"
                                        },
                                        "recovery_codes": {
                                            "type": [
                                                "array",
                                                "null"
                                            ],
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "enabled",
                                        "recovery_codes"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/mfa/recovery-codes": {
            "post": {
                "operationId": "mfa.recovery_codes",
                "tags": [
                    "Mfa"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "recovery_codes": {
                                            "type": "array",
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "recovery_codes"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                "Two-factor authentication is off."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users/{id}/mfa": {
            "delete": {
                "operationId": "users.mfa.reset",
                "summary": "Admin: clear a locked-out user's MFA so they can enrol again",
                "tags": [
                    "Mfa"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "enabled": {
                                            "type": "boolean"
                                        }
                                    },
                                    "required": [
                                        "enabled"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/opsgenie/pull": {
            "post": {
                "operationId": "migration.pull",
                "summary": "Pull config directly from Opsgenie via the customer's API key, then import",
                "tags": [
                    "Migration"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "api_key": {
                                        "type": "string",
                                        "maxLength": 200
                                    },
                                    "region": {
                                        "type": "string",
                                        "enum": [
                                            "us",
                                            "eu"
                                        ]
                                    }
                                },
                                "required": [
                                    "api_key"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "stats": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "minItems": 0,
                                            "maxItems": 0
                                        },
                                        "skipped": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "minItems": 0,
                                            "maxItems": 0
                                        }
                                    },
                                    "required": [
                                        "stats",
                                        "skipped"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/opsgenie/import": {
            "post": {
                "operationId": "migration.import",
                "summary": "Import an Opsgenie export (users, teams, schedules, escalations, integrations)",
                "tags": [
                    "Migration"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "export": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "export"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "stats": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "minItems": 0,
                                            "maxItems": 0
                                        },
                                        "skipped": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "minItems": 0,
                                            "maxItems": 0
                                        }
                                    },
                                    "required": [
                                        "stats",
                                        "skipped"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, or a plan gate (PlanGateError: code plan_feature_unavailable or plan_limit_reached).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/PlanGateError"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "errors": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "errors"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/migration/opsgenie/diff": {
            "post": {
                "operationId": "migration.diff",
                "summary": "Parallel-run diff: compare NOCgenie routing against Opsgenie's decisions",
                "tags": [
                    "Migration"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "cases": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "alert": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "minItems": 1
                                                },
                                                "opsgenie": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "minItems": 1
                                                }
                                            },
                                            "required": [
                                                "alert",
                                                "opsgenie"
                                            ]
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "cases"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "results": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "alias": {
                                                        "type": "string"
                                                    },
                                                    "match": {
                                                        "type": "string"
                                                    },
                                                    "opsgenie": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "string"
                                                                },
                                                                "minItems": 0,
                                                                "maxItems": 0
                                                            }
                                                        ]
                                                    },
                                                    "nocgenie": {
                                                        "type": "object",
                                                        "properties": {
                                                            "escalation": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "responder": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "required": [
                                                            "escalation",
                                                            "responder"
                                                        ]
                                                    },
                                                    "diffs": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "alias",
                                                    "match",
                                                    "opsgenie",
                                                    "nocgenie",
                                                    "diffs"
                                                ]
                                            }
                                        },
                                        "matches": {
                                            "type": "integer",
                                            "const": 0
                                        },
                                        "total": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "results",
                                        "matches",
                                        "total"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/mobile/login": {
            "post": {
                "operationId": "auth.mobile.login",
                "description": "The token set, or (when the user has two-factor on) a challenge to answer at auth/mfa/verify.",
                "summary": "POST /auth/mobile/login",
                "tags": [
                    "MobileAuth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "password": {
                                        "type": "string"
                                    },
                                    "device": {
                                        "type": "object",
                                        "properties": {
                                            "push_token": {
                                                "type": "string",
                                                "minLength": 20,
                                                "maxLength": 512
                                            },
                                            "platform": {
                                                "type": "string",
                                                "enum": [
                                                    "ios",
                                                    "android"
                                                ]
                                            },
                                            "app_version": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "maxLength": 64
                                            },
                                            "installation_id": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                                                "maxLength": 64
                                            }
                                        },
                                        "required": [
                                            "push_token",
                                            "platform"
                                        ]
                                    }
                                },
                                "required": [
                                    "email",
                                    "password",
                                    "device"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`MobileTokenResponse`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/MobileTokenResponse"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "mfa_required": {
                                                    "type": "boolean"
                                                },
                                                "mfa_token": {
                                                    "type": "string"
                                                },
                                                "methods": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "enum": [
                                                            "totp",
                                                            "recovery_code"
                                                        ]
                                                    }
                                                },
                                                "expires_in": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "mfa_required",
                                                "mfa_token",
                                                "methods",
                                                "expires_in"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/mobile/refresh": {
            "post": {
                "operationId": "auth.mobile.refresh",
                "summary": "POST /auth/mobile/refresh",
                "tags": [
                    "MobileAuth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "refresh_token": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "device": {
                                        "type": "object",
                                        "description": "#409, optional: identify the install so a refresh can adopt (and re-enable) its row.",
                                        "properties": {
                                            "installation_id": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                                                "maxLength": 64
                                            },
                                            "push_token": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "minLength": 20,
                                                "maxLength": 512
                                            },
                                            "platform": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "enum": [
                                                    "ios",
                                                    "android",
                                                    null
                                                ]
                                            },
                                            "app_version": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "maxLength": 64
                                            }
                                        }
                                    }
                                },
                                "required": [
                                    "refresh_token"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "401": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "error": {
                                                    "type": "string",
                                                    "const": "invalid_grant"
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "error"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "const": "Your organization signs in with single sign-on. Sign in again with SSO."
                                                },
                                                "error": {
                                                    "type": "string",
                                                    "const": "sso_required"
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "error"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "const": "This device was replaced or turned off. Sign in again."
                                                },
                                                "error": {
                                                    "type": "string",
                                                    "const": "device_disabled"
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "error"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "`MobileTokenResponse`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/MobileTokenResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/mobile/logout": {
            "post": {
                "operationId": "auth.mobile.logout",
                "summary": "POST /auth/mobile/logout: for when the access token has already expired",
                "tags": [
                    "MobileAuth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "refresh_token": {
                                        "type": "string",
                                        "maxLength": 255
                                    }
                                },
                                "required": [
                                    "refresh_token"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Logged out."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/mobile/discover": {
            "post": {
                "operationId": "auth.mobile.discover",
                "summary": "POST /auth/mobile/discover {email}: the sign-in methods to show.\nSame answer shape for every email; based on the email's domain only",
                "tags": [
                    "MobileSso"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "maxLength": 255
                                    }
                                },
                                "required": [
                                    "email"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "methods": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "enum": [
                                                    "password",
                                                    "sso"
                                                ]
                                            }
                                        },
                                        "sso": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "properties": {
                                                "provider": {
                                                    "type": "string",
                                                    "const": "oidc"
                                                },
                                                "label": {
                                                    "type": "string"
                                                },
                                                "enforced": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "provider",
                                                "label",
                                                "enforced"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "methods",
                                        "sso"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/mobile/sso/start": {
            "get": {
                "operationId": "auth.mobile.sso.start",
                "description": "Redirects (302) to the identity provider. When the redirect_uri is\nallow-listed, EVERY other failure (bad parameters, an unavailable\nmethod, throttling, a server error) is a 302 back to\nredirect_uri?error=&error_description=&state=. Only a missing or\nunlisted redirect_uri gets a small HTML error page (400), and it is\nnever redirected to.",
                "summary": "GET /auth/mobile/sso/start: open in the system browser",
                "tags": [
                    "MobileSso"
                ],
                "parameters": [
                    {
                        "name": "redirect_uri",
                        "in": "query",
                        "required": true,
                        "description": "Exactly one of the allowed app redirect URIs.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "nocgenie://auth/callback",
                                "nocgenie-preview://auth/callback",
                                "nocgenie-dev://auth/callback"
                            ]
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "required": true,
                        "description": "Opaque value the app checks on return; 1-512 printable ASCII.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "code_challenge",
                        "in": "query",
                        "required": true,
                        "description": "PKCE: base64url(SHA-256(code_verifier)), no padding, 43-128 chars.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "code_challenge_method",
                        "in": "query",
                        "required": true,
                        "description": "PKCE method; only S256.",
                        "schema": {
                            "type": "string",
                            "const": "S256"
                        }
                    },
                    {
                        "name": "provider",
                        "in": "query",
                        "description": "Sign-in method. saml answers error=method_unavailable (not built yet).",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "oidc",
                                "saml"
                            ],
                            "default": "oidc"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Optional; sent to the identity provider as login_hint.",
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    }
                ],
                "responses": {
                    "302": {
                        "description": "",
                        "headers": {
                            "Location": {
                                "required": true,
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "",
                        "content": {
                            "text/html; charset=utf-8": {
                                "schema": {
                                    "type": "string",
                                    "const": "<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Sign-in link not valid \u00b7 NOCgenie</title><style>body{font-family:system-ui,sans-serif;margin:0;display:grid;place-items:center;min-height:100vh;background:#f5f6fb;color:#04133c}main{max-width:22rem;padding:1.5rem;text-align:center}h1{font-size:1.15rem}p{color:#4a5470;font-size:.95rem}</style></head><body><main><h1>This sign-in link isn\u2019t valid</h1><p>Close this window and start signing in again from the NOCgenie app.</p><p><small>Error: invalid_redirect_uri</small></p></main></body></html>"
                                }
                            }
                        },
                        "headers": {
                            "Cache-Control": {
                                "schema": {
                                    "type": "string",
                                    "const": "no-store"
                                }
                            },
                            "X-Error-Code": {
                                "schema": {
                                    "type": "string",
                                    "const": "invalid_redirect_uri"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/mobile/sso/exchange": {
            "post": {
                "operationId": "auth.mobile.sso.exchange",
                "summary": "POST /auth/mobile/sso/exchange {code, code_verifier, redirect_uri, device}\nSwaps the one-time code for the same token set as auth/mobile/login",
                "tags": [
                    "MobileSso"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "code": {
                                        "type": "string",
                                        "maxLength": 128
                                    },
                                    "code_verifier": {
                                        "type": "string",
                                        "pattern": "^[A-Za-z0-9._~-]{43,128}$"
                                    },
                                    "redirect_uri": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "device": {
                                        "type": "object",
                                        "properties": {
                                            "push_token": {
                                                "type": "string",
                                                "minLength": 20,
                                                "maxLength": 512
                                            },
                                            "platform": {
                                                "type": "string",
                                                "enum": [
                                                    "ios",
                                                    "android"
                                                ]
                                            },
                                            "app_version": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "maxLength": 64
                                            },
                                            "installation_id": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                                                "maxLength": 64
                                            }
                                        },
                                        "required": [
                                            "push_token",
                                            "platform"
                                        ]
                                    }
                                },
                                "required": [
                                    "code",
                                    "code_verifier",
                                    "redirect_uri",
                                    "device"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`MobileTokenResponse`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/MobileTokenResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "This account can no longer sign in."
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "access_denied"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "This sign-in has expired or was already used. Start again."
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "invalid_grant"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/me/notification-rules": {
            "get": {
                "operationId": "notificationRule.index",
                "tags": [
                    "NotificationRule"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/NotificationRule"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "notificationRule.store",
                "tags": [
                    "NotificationRule"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "contact_method_id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "new_alert",
                                            "acknowledged",
                                            "closed",
                                            "assigned",
                                            "schedule_start",
                                            "schedule_end"
                                        ]
                                    },
                                    "priority": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "P1",
                                            "P2",
                                            "P3",
                                            "P4",
                                            "P5",
                                            null
                                        ]
                                    },
                                    "delay_minutes": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 1440
                                    },
                                    "enabled": {
                                        "type": "boolean"
                                    },
                                    "quiet_hours": {
                                        "description": "Quiet hours (see the QuietHours schema). Send null to clear.",
                                        "anyOf": [
                                            {
                                                "$ref": "#/components/schemas/QuietHours"
                                            },
                                            {
                                                "type": "null"
                                            }
                                        ]
                                    },
                                    "order": {
                                        "type": "integer",
                                        "minimum": 0
                                    }
                                },
                                "required": [
                                    "contact_method_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/NotificationRule"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/notification-rules/{notificationRule}": {
            "put": {
                "operationId": "notificationRule.update",
                "tags": [
                    "NotificationRule"
                ],
                "parameters": [
                    {
                        "name": "notificationRule",
                        "in": "path",
                        "required": true,
                        "description": "The notification rule ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "contact_method_id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "new_alert",
                                            "acknowledged",
                                            "closed",
                                            "assigned",
                                            "schedule_start",
                                            "schedule_end"
                                        ]
                                    },
                                    "priority": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "P1",
                                            "P2",
                                            "P3",
                                            "P4",
                                            "P5",
                                            null
                                        ]
                                    },
                                    "delay_minutes": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 1440
                                    },
                                    "enabled": {
                                        "type": "boolean"
                                    },
                                    "quiet_hours": {
                                        "description": "Quiet hours (see the QuietHours schema). Send null to clear.",
                                        "anyOf": [
                                            {
                                                "$ref": "#/components/schemas/QuietHours"
                                            },
                                            {
                                                "type": "null"
                                            }
                                        ]
                                    },
                                    "order": {
                                        "type": "integer",
                                        "minimum": 0
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/NotificationRule"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "notificationRule.destroy",
                "tags": [
                    "NotificationRule"
                ],
                "parameters": [
                    {
                        "name": "notificationRule",
                        "in": "path",
                        "required": true,
                        "description": "The notification rule ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/notification-rules/{notificationRule}/test": {
            "post": {
                "operationId": "notification_rules.test",
                "summary": "POST me/notification-rules/{id}/test (#714): send ONE test message to the\nrule's contact method. Same checks and limits as a contact method test",
                "tags": [
                    "NotificationRule"
                ],
                "parameters": [
                    {
                        "name": "notificationRule",
                        "in": "path",
                        "required": true,
                        "description": "The notification rule ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "502": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Test notification failed."
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "test_failed"
                                        },
                                        "notification_log": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "channel": {
                                                    "type": "string"
                                                },
                                                "event": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "provider": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "error": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sent_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "channel",
                                                "event",
                                                "status",
                                                "provider",
                                                "error",
                                                "sent_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error",
                                        "notification_log"
                                    ]
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Test notification sent."
                                        },
                                        "notification_log": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "channel": {
                                                    "type": "string"
                                                },
                                                "event": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "provider": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "error": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sent_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "channel",
                                                "event",
                                                "status",
                                                "provider",
                                                "error",
                                                "sent_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "notification_log"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "anyOf": [
                                                        {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        {}
                                                    ]
                                                },
                                                "error": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string",
                                                            "const": "test_blocked"
                                                        },
                                                        {}
                                                    ]
                                                },
                                                "notification_log": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "channel": {
                                                            "type": "string"
                                                        },
                                                        "event": {
                                                            "type": "string"
                                                        },
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "provider": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "error": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "sent_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "channel",
                                                        "event",
                                                        "status",
                                                        "provider",
                                                        "error",
                                                        "sent_at"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "error",
                                                "notification_log"
                                            ],
                                            "additionalProperties": {}
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "const": "Verify this contact method before sending a test."
                                                },
                                                "error": {
                                                    "type": "string",
                                                    "const": "contact_method_unverified"
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "error"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "test_rate_limited"
                                        },
                                        "retry_after": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error",
                                        "retry_after"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "This organization is closing or closed, so it sends no notifications."
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "organization_alerting_stopped"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/onboarding/status": {
            "get": {
                "operationId": "onboarding.status",
                "summary": "Whether the org still needs onboarding (also true-ish if already configured)",
                "tags": [
                    "Onboarding"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "onboarded": {
                                            "type": "boolean"
                                        },
                                        "is_admin": {
                                            "type": "boolean"
                                        },
                                        "integration_options": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "type": {
                                                        "type": "string",
                                                        "enum": [
                                                            "prometheus",
                                                            "grafana",
                                                            "observium",
                                                            "librenms",
                                                            "zabbix",
                                                            "uptime_kuma",
                                                            "argus",
                                                            "mymate",
                                                            "mspreports",
                                                            "generic"
                                                        ]
                                                    },
                                                    "label": {
                                                        "type": "string",
                                                        "enum": [
                                                            "Prometheus / Alertmanager",
                                                            "Grafana",
                                                            "Observium",
                                                            "LibreNMS",
                                                            "Zabbix",
                                                            "Uptime Kuma",
                                                            "Argus",
                                                            "My Mate",
                                                            "MSP Reports",
                                                            "Generic webhook"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "type",
                                                    "label"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "onboarded",
                                        "is_admin",
                                        "integration_options"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/onboarding/complete": {
            "post": {
                "operationId": "onboarding.complete",
                "summary": "Provision from the guided wizard: the admin's contact, a team (+ invited\nteammates), an on-call rotation of the chosen people, a two-step escalation,\nand one inbound webhook per chosen monitoring tool",
                "tags": [
                    "Onboarding"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "team_name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "mobile": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 32
                                    },
                                    "timezone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "notify_sms": {
                                        "type": "boolean"
                                    },
                                    "notify_voice": {
                                        "type": "boolean"
                                    },
                                    "escalate_after": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 120
                                    },
                                    "teammates": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "name": {
                                                    "type": "string",
                                                    "maxLength": 255
                                                },
                                                "email": {
                                                    "type": "string",
                                                    "format": "email",
                                                    "maxLength": 255
                                                },
                                                "mobile": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 32
                                                }
                                            }
                                        },
                                        "maxItems": 50
                                    },
                                    "on_call_emails": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "format": "email",
                                            "description": "who joins the rotation (emails); default = everyone"
                                        }
                                    },
                                    "integrations": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "required": [
                                    "team_name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "onboarded": {
                                            "type": "boolean"
                                        },
                                        "team": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name"
                                            ]
                                        },
                                        "schedule": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name"
                                            ]
                                        },
                                        "escalation": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name"
                                            ]
                                        },
                                        "on_call": {
                                            "type": "string"
                                        },
                                        "integrations": {
                                            "type": "object",
                                            "additionalProperties": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "webhook_url": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "name",
                                                    "type",
                                                    "webhook_url"
                                                ]
                                            }
                                        },
                                        "skipped": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "onboarded",
                                        "team",
                                        "schedule",
                                        "escalation",
                                        "on_call",
                                        "integrations",
                                        "skipped"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, or a plan gate (PlanGateError: code plan_feature_unavailable or plan_limit_reached).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/PlanGateError"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "errors": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "errors"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/onboarding/skip": {
            "post": {
                "operationId": "onboarding.skip",
                "summary": "Skip the wizard (admin chose to configure manually)",
                "tags": [
                    "Onboarding"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "onboarded": {
                                            "type": "boolean"
                                        }
                                    },
                                    "required": [
                                        "onboarded"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/openapi.json": {
            "get": {
                "operationId": "openapi",
                "tags": [
                    "OpenApi"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": [
                                        "string",
                                        "object"
                                    ]
                                }
                            }
                        }
                    },
                    "304": {
                        "description": "",
                        "headers": {
                            "ETag": {
                                "schema": {
                                    "type": "string"
                                }
                            },
                            "Cache-Control": {
                                "schema": {
                                    "type": "string",
                                    "const": "public, max-age=300"
                                }
                            },
                            "Access-Control-Allow-Origin": {
                                "schema": {
                                    "type": "string",
                                    "const": "*"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/ops/status": {
            "get": {
                "operationId": "ops.status",
                "summary": "GET /api/v1/ops/status: whether the caller may open Horizon, and failed jobs in the last 24 h",
                "tags": [
                    "Ops"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "horizon": {
                                            "type": "boolean"
                                        },
                                        "failed_jobs_24h": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ],
                                            "minimum": 0
                                        }
                                    },
                                    "required": [
                                        "horizon",
                                        "failed_jobs_24h"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ops/horizon-link": {
            "post": {
                "operationId": "ops.horizon_link",
                "summary": "POST /api/v1/ops/horizon-link: a 5-minute signed link that opens Horizon",
                "tags": [
                    "Ops"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "url": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "url"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                "Only Athena operations staff can open the queue dashboard."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/organization/closure": {
            "get": {
                "operationId": "organization.closure",
                "summary": "Where closure stands, what closing would do, and whether the caller may",
                "tags": [
                    "OrganizationClosure"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string"
                                        },
                                        "dormant": {
                                            "type": "boolean"
                                        },
                                        "dormant_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "closes_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "closed_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "owner": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name"
                                            ]
                                        },
                                        "transfer_candidates": {
                                            "anyOf": [
                                                {
                                                    "type": "string"
                                                },
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "minItems": 0,
                                                    "maxItems": 0
                                                }
                                            ]
                                        },
                                        "is_owner": {
                                            "type": "boolean"
                                        },
                                        "can_close": {
                                            "type": "boolean"
                                        },
                                        "requires_password": {
                                            "type": "boolean"
                                        },
                                        "requires_mfa": {
                                            "type": "boolean"
                                        },
                                        "closes": {
                                            "type": "string",
                                            "description": "Paid: runs to the period end, no refund. Free: closes at once.",
                                            "enum": [
                                                "period_end",
                                                "immediately"
                                            ]
                                        },
                                        "effective_at": {
                                            "type": "string"
                                        },
                                        "subscription": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "properties": {
                                                "plan": {
                                                    "type": "string"
                                                },
                                                "refund": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "plan",
                                                "refund"
                                            ]
                                        },
                                        "sms_credits_forfeited": {},
                                        "voice_credits_forfeited": {
                                            "description": "Call credit, in cents ex GST."
                                        },
                                        "members": {
                                            "type": "integer",
                                            "minimum": 0
                                        },
                                        "retention_days": {
                                            "type": "integer"
                                        },
                                        "purge_on": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "dormant",
                                        "dormant_at",
                                        "closes_at",
                                        "closed_at",
                                        "owner",
                                        "transfer_candidates",
                                        "is_owner",
                                        "can_close",
                                        "requires_password",
                                        "requires_mfa",
                                        "closes",
                                        "effective_at",
                                        "subscription",
                                        "sms_credits_forfeited",
                                        "voice_credits_forfeited",
                                        "members",
                                        "retention_days",
                                        "purge_on"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/organization/close": {
            "post": {
                "operationId": "organization.close",
                "summary": "Ask to close the org. Body: confirm_name (the org name, typed), password\n(unless an SSO-only account), mfa_code (when MFA is on), stop_alerting\n(bool: go dormant now instead of alerting until the period ends).\nA paid org closes at the end of its paid period; a free one at once",
                "tags": [
                    "OrganizationClosure"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "confirm_name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "password": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "mfa_code": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "stop_alerting": {
                                        "type": "boolean"
                                    }
                                },
                                "required": [
                                    "confirm_name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/organization/close/stop-alerting": {
            "post": {
                "operationId": "organization.close.stop_alerting",
                "summary": "While closing: stop all alerting now (dormant). Owner only",
                "tags": [
                    "OrganizationClosure"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/organization/close/undo": {
            "post": {
                "operationId": "organization.close.undo",
                "summary": "Undo a scheduled closure before the period ends. Owner only",
                "tags": [
                    "OrganizationClosure"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/organization/owner": {
            "post": {
                "operationId": "organization.owner.transfer",
                "summary": "Hand ownership to another active admin of this org. Owner only, with\nre-auth. Body: user_id, password (unless SSO-only), mfa_code (when MFA is on)",
                "tags": [
                    "OrganizationClosure"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_id": {
                                        "type": "integer"
                                    },
                                    "password": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "mfa_code": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    }
                                },
                                "required": [
                                    "user_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/organization/export": {
            "get": {
                "operationId": "organization.export",
                "summary": "Zip of the org's data (JSON + CSV per table). Any admin, until the org closes",
                "tags": [
                    "OrganizationClosure"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/zip": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        },
                        "headers": {
                            "Content-Disposition": {
                                "required": true,
                                "schema": {
                                    "type": "string"
                                },
                                "example": "attachment; filename=.zip"
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/phone-verification": {
            "post": {
                "operationId": "phone.verify.send",
                "description": "Send a code to one of your numbers. Kept for older clients; prefer the id-based POST /me/contact-methods/{contactMethod}/verify.",
                "summary": "Text a 6-digit code to one of the user's own numbers",
                "tags": [
                    "PhoneVerification"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "number": {
                                        "type": "string",
                                        "maxLength": 32
                                    }
                                },
                                "required": [
                                    "number"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Code sent."
                                        },
                                        "number": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "number"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "anyOf": [
                                                {
                                                    "type": "null"
                                                },
                                                {
                                                    "type": "string"
                                                },
                                                {
                                                    "type": "string",
                                                    "enum": [
                                                        "Too many verification codes requested. Try again later."
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, or a plan gate (PlanGateError: code plan_feature_unavailable or plan_limit_reached).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/PlanGateError"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "errors": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "errors"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/phone-verification/confirm": {
            "post": {
                "operationId": "phone.verify.confirm",
                "description": "Confirm a number's code. Kept for older clients; prefer the id-based POST /me/contact-methods/{contactMethod}/verify/confirm.",
                "summary": "Confirm the code; marks every matching number on the profile verified",
                "tags": [
                    "PhoneVerification"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "number": {
                                        "type": "string",
                                        "maxLength": 32
                                    },
                                    "code": {
                                        "type": "string",
                                        "maxLength": 12
                                    }
                                },
                                "required": [
                                    "number",
                                    "code"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "verified": {
                                            "type": "boolean"
                                        },
                                        "number": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "verified",
                                        "number"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/email/confirm/{user}": {
            "get": {
                "operationId": "profile.email.confirm",
                "summary": "Signed confirm link from the new address. The email only switches here, and\nonly if the account still has the address the change was requested from",
                "tags": [
                    "Profile"
                ],
                "parameters": [
                    {
                        "name": "user",
                        "in": "path",
                        "required": true,
                        "description": "The user ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "302": {
                        "description": "",
                        "headers": {
                            "Location": {
                                "required": true,
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/account/delete-request": {
            "post": {
                "operationId": "account.delete.request",
                "description": "Always answers 202 with the same message, whether or not the address has an\naccount (rate-limited per IP and, silently, per address). Needs the Turnstile token\nwhen Turnstile is on.",
                "summary": "Ask for a deletion link",
                "tags": [
                    "PublicAccountDeletion"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "maxLength": 255
                                    },
                                    "turnstile_token": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2048
                                    }
                                },
                                "required": [
                                    "email"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "If that email has a NOCgenie account, we have sent it a link to confirm the deletion. It expires in 60 minutes."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/account/delete-link": {
            "get": {
                "operationId": "account.delete.link",
                "description": "410 `link_invalid` when it has expired, was used, or the account changed. Otherwise\nthe masked address, the organization, and `blocked` ({code: last_owner|sole_member,\nmessage}) when it can't be deleted yet.",
                "summary": "What a deletion link would delete, before confirming",
                "tags": [
                    "PublicAccountDeletion"
                ],
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 128
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "email": {
                                            "type": "string"
                                        },
                                        "organization": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "blocked": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "properties": {
                                                "code": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "enum": [
                                                                "last_owner",
                                                                "sole_member"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                "message": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "email",
                                        "organization",
                                        "blocked"
                                    ]
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "string",
                                            "const": "link_invalid"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "This link has expired or was already used. Ask for a new one."
                                        }
                                    },
                                    "required": [
                                        "code",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            },
            "delete": {
                "operationId": "account.delete.confirm",
                "description": "The same deletion as DELETE /me: 200 {deleted, message, roster_gaps}; 409 last_owner\nor sole_member (the link stays valid until it expires); 410 link_invalid.",
                "summary": "Confirm: delete the account the link is for",
                "tags": [
                    "PublicAccountDeletion"
                ],
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 128
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/reports/overview": {
            "get": {
                "operationId": "report.overview",
                "summary": "Open/ack/closed counts + priority breakdown of currently-active alerts",
                "tags": [
                    "Report"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "open": {
                                            "type": "integer"
                                        },
                                        "acknowledged": {
                                            "type": "integer"
                                        },
                                        "snoozed": {
                                            "type": "integer"
                                        },
                                        "closed": {
                                            "type": "integer"
                                        },
                                        "active_by_priority": {
                                            "type": "array",
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "open",
                                        "acknowledged",
                                        "snoozed",
                                        "closed",
                                        "active_by_priority"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/reports/mtta-mttr": {
            "get": {
                "operationId": "report.mttaMttr",
                "summary": "Mean time to acknowledge / resolve (seconds) over the window",
                "tags": [
                    "Report"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "since": {
                                            "type": "string"
                                        },
                                        "mtta_seconds": {
                                            "type": [
                                                "number",
                                                "null"
                                            ]
                                        },
                                        "mttr_seconds": {
                                            "type": [
                                                "number",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "since",
                                        "mtta_seconds",
                                        "mttr_seconds"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/reports/by-source": {
            "get": {
                "operationId": "report.bySource",
                "summary": "Alert volume grouped by source over the window",
                "tags": [
                    "Report"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Alert"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/reports/on-call-load": {
            "get": {
                "operationId": "report.onCallLoad",
                "summary": "On-call load: notifications delivered per user over the window",
                "tags": [
                    "Report"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/NotificationLog"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/{schedule}/requests": {
            "get": {
                "operationId": "roster_requests.index",
                "summary": "GET schedules/{schedule}/requests?status=",
                "tags": [
                    "RosterRequest"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "roster_requests.store",
                "summary": "POST schedules/{schedule}/requests: the requester is always the caller",
                "tags": [
                    "RosterRequest"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "kind": {
                                        "type": "string",
                                        "enum": [
                                            "cover_offer",
                                            "stand_in_request",
                                            "swap"
                                        ]
                                    },
                                    "target_user_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "shift": {
                                        "type": "object",
                                        "properties": {
                                            "start_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "end_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "via_team_id": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ]
                                            },
                                            "via_group_id": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ]
                                            }
                                        },
                                        "required": [
                                            "start_at",
                                            "end_at"
                                        ]
                                    },
                                    "return_shift": {
                                        "type": [
                                            "object",
                                            "null"
                                        ],
                                        "properties": {
                                            "start_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "end_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "via_team_id": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ]
                                            },
                                            "via_group_id": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ]
                                            }
                                        }
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    }
                                },
                                "required": [
                                    "kind",
                                    "shift"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/requests": {
            "get": {
                "operationId": "roster_requests.mine",
                "summary": "GET me/requests?status=: across every schedule (the app's On call tab badge)",
                "tags": [
                    "RosterRequest"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/{schedule}/requests/{rid}/accept": {
            "post": {
                "operationId": "rosterRequest.accept",
                "tags": [
                    "RosterRequest"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "rid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/{schedule}/requests/{rid}/decline": {
            "post": {
                "operationId": "rosterRequest.decline",
                "tags": [
                    "RosterRequest"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "rid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/{schedule}/requests/{rid}/approve": {
            "post": {
                "operationId": "rosterRequest.approve",
                "tags": [
                    "RosterRequest"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "rid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/{schedule}/requests/{rid}/cancel": {
            "post": {
                "operationId": "rosterRequest.cancel",
                "tags": [
                    "RosterRequest"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "rid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/routing-rules": {
            "get": {
                "operationId": "routingRule.index",
                "summary": "Listed in evaluation order: by team, then `order` (first match wins)",
                "tags": [
                    "RoutingRule"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/RoutingRule"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "routingRule.store",
                "tags": [
                    "RoutingRule"
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/routing-rules/{id}": {
            "get": {
                "operationId": "routingRule.show",
                "tags": [
                    "RoutingRule"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "routingRule.update",
                "tags": [
                    "RoutingRule"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": [
                                        "object",
                                        "null"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "routingRule.destroy",
                "tags": [
                    "RoutingRule"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/saml/metadata": {
            "get": {
                "operationId": "auth.saml.metadata",
                "tags": [
                    "Saml"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/samlmetadata+xml": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/auth/saml/acs": {
            "post": {
                "operationId": "auth.saml.acs",
                "tags": [
                    "Saml"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/saved-searches": {
            "get": {
                "operationId": "saved-searches.index",
                "tags": [
                    "SavedSearch"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/SavedSearch"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "saved-searches.store",
                "tags": [
                    "SavedSearch"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "filters": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "is_shared": {
                                        "type": "boolean"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/SavedSearch"
                                        },
                                        {
                                            "type": "object"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/saved-searches/{savedSearch}": {
            "put": {
                "operationId": "saved-searches.update",
                "tags": [
                    "SavedSearch"
                ],
                "parameters": [
                    {
                        "name": "savedSearch",
                        "in": "path",
                        "required": true,
                        "description": "The saved search ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "filters": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "is_shared": {
                                        "type": "boolean"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SavedSearch"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "saved-searches.destroy",
                "tags": [
                    "SavedSearch"
                ],
                "parameters": [
                    {
                        "name": "savedSearch",
                        "in": "path",
                        "required": true,
                        "description": "The saved search ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/feed/{feedToken}.ics": {
            "get": {
                "operationId": "schedules.ical",
                "summary": "Public iCal feed, authenticated by the schedule's feed token",
                "tags": [
                    "Schedule"
                ],
                "parameters": [
                    {
                        "name": "feedToken",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "text/calendar; charset=utf-8": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        },
                        "headers": {
                            "Content-Disposition": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/schedules": {
            "get": {
                "operationId": "schedules.index",
                "tags": [
                    "Schedule"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/ScheduleDetail"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "schedule.store",
                "tags": [
                    "Schedule"
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Schedule"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/{schedule}": {
            "get": {
                "operationId": "schedules.show",
                "tags": [
                    "Schedule"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScheduleDetail"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "schedule.update",
                "tags": [
                    "Schedule"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Schedule"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "schedule.destroy",
                "summary": "Delete a schedule with its layers, overrides, shift state and iCal feed token\n(all cascade). Refused with 409 while anything still pages from it: an\nescalation step targeting it (no FK, so it would silently resolve to nobody)\nor a routing rule using it as the fallback (its FK would quietly null out).\nThe response lists those references so the admin can repoint them first",
                "tags": [
                    "Schedule"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "schedule_in_use"
                                        },
                                        "references": {
                                            "type": "array",
                                            "prefixItems": [
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "const": "escalation_policy"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "step": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "id",
                                                            "name",
                                                            "step"
                                                        ]
                                                    }
                                                },
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "const": "routing_rule"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "enabled": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "id",
                                                            "name",
                                                            "enabled"
                                                        ]
                                                    }
                                                }
                                            ],
                                            "minItems": 2,
                                            "maxItems": 2
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error",
                                        "references"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/{schedule}/on-call": {
            "get": {
                "operationId": "schedules.oncall",
                "summary": "Who is on call now and who is next",
                "tags": [
                    "Schedule"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OnCall"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/{schedule}/overrides": {
            "get": {
                "operationId": "schedules.overrides",
                "summary": "GET schedules/{id}/overrides (#1006): every override on the schedule, newest start first,\npaged. `from` / `to` (ISO date-times) keep the ones that overlap that range: ending after\n`from` and starting before `to`",
                "tags": [
                    "Schedule"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/Override"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "schedule.addOverride",
                "summary": "Add a one-off override",
                "tags": [
                    "Schedule"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_id": {
                                        "type": "integer"
                                    },
                                    "start_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "end_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "reason": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "rotation_ids": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "description": "null/absent = the whole schedule; else only these rotations' people (Opsgenie parity).",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "minItems": 1,
                                        "uniqueItems": true
                                    }
                                },
                                "required": [
                                    "user_id",
                                    "start_at",
                                    "end_at"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Override"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, or a plan gate (PlanGateError: code plan_feature_unavailable or plan_limit_reached).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/PlanGateError"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "errors": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "errors"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/{schedule}/stand-ins": {
            "get": {
                "operationId": "schedules.stand_ins",
                "summary": "GET schedules/{id}/stand-ins: every stand-in, newest start first, paged; from/to keep overlapping ones",
                "tags": [
                    "Schedule"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "current_page": {
                                            "type": "integer",
                                            "minimum": 1
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ScheduleStandIn"
                                            }
                                        },
                                        "first_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "from": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ],
                                            "minimum": 1
                                        },
                                        "last_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "last_page": {
                                            "type": "integer",
                                            "minimum": 1
                                        },
                                        "links": {
                                            "type": "array",
                                            "description": "Generated paginator links.",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "url": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "label": {
                                                        "type": "string"
                                                    },
                                                    "active": {
                                                        "type": "boolean"
                                                    }
                                                },
                                                "required": [
                                                    "url",
                                                    "label",
                                                    "active"
                                                ]
                                            }
                                        },
                                        "next_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "path": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "description": "Base path for paginator generated URLs."
                                        },
                                        "per_page": {
                                            "type": "integer",
                                            "description": "Number of items shown per page.",
                                            "minimum": 0
                                        },
                                        "prev_page_url": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "to": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ],
                                            "description": "Number of the last item in the slice.",
                                            "minimum": 1
                                        },
                                        "total": {
                                            "type": "integer",
                                            "description": "Total number of items being paginated.",
                                            "minimum": 0
                                        }
                                    },
                                    "required": [
                                        "current_page",
                                        "data",
                                        "first_page_url",
                                        "from",
                                        "last_page_url",
                                        "last_page",
                                        "links",
                                        "next_page_url",
                                        "path",
                                        "per_page",
                                        "prev_page_url",
                                        "to",
                                        "total"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/{schedule}/rotations": {
            "put": {
                "operationId": "schedule.syncRotations",
                "summary": "PUT schedules/{id}/rotations: the schedule's layers (and optionally its groups) as\nfull desired sets, updated in place by id (multi on-call P2). Each rotation takes\n`rotation_slots` (user_id | team_id | schedule_group_id | schedule_group_ref, with id\nor client_ref) or, from older clients, `participants` (user ids; replaced wholesale)",
                "tags": [
                    "Schedule"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "schedule_groups": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "client_ref": {
                                                    "type": "string",
                                                    "maxLength": 64
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "maxLength": 255
                                                },
                                                "members": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "name",
                                                "members"
                                            ]
                                        }
                                    },
                                    "rotations": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "client_ref": {
                                                    "type": "string",
                                                    "maxLength": 64
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "maxLength": 255
                                                },
                                                "type": {
                                                    "type": "string",
                                                    "enum": [
                                                        "daily",
                                                        "weekly",
                                                        "custom"
                                                    ]
                                                },
                                                "length": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "start_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "end_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "handoff_time": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "time_restriction": {
                                                    "type": [
                                                        "array",
                                                        "null"
                                                    ],
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "restrictions": {
                                                    "type": [
                                                        "array",
                                                        "null"
                                                    ],
                                                    "description": "G5: several windows, each optionally in its own zone; any match = active.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "days": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "integer",
                                                                    "description": "No `distinct` here: across nested wildcards Laravel compares every window of every\nrotation. Duplicate days within a window are dropped by ScheduleWriter instead.",
                                                                    "minimum": 1,
                                                                    "maximum": 7
                                                                },
                                                                "minItems": 1,
                                                                "maxItems": 7
                                                            },
                                                            "start": {
                                                                "type": "string"
                                                            },
                                                            "end": {
                                                                "type": "string",
                                                                "description": "end == start = 24 h from start on each listed day (00:00-00:00 = all day)."
                                                            },
                                                            "time_zone": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "days",
                                                            "start",
                                                            "end"
                                                        ]
                                                    },
                                                    "maxItems": 14
                                                },
                                                "participants": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "rotation_slots": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "client_ref": {
                                                                "type": "string",
                                                                "maxLength": 64
                                                            },
                                                            "user_id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "team_id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "schedule_group_id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "schedule_group_ref": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ],
                                                                "maxLength": 64
                                                            }
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "name",
                                                "type",
                                                "start_at"
                                            ]
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "rotations"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScheduleDetail"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, or a plan gate (PlanGateError: code plan_feature_unavailable or plan_limit_reached).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/PlanGateError"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "errors": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "errors"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/{schedule}/overrides/{overrideId}": {
            "put": {
                "operationId": "schedule.updateOverride",
                "summary": "PUT schedules/{id}/overrides/{oid} (#683): edit an override's user, start and\nend in one atomic write. Validated exactly like create (user in this org,\nend after start; like create, overlaps with other overrides are allowed and\nthe newest wins). Scoped to this schedule: another schedule's id is a 404",
                "tags": [
                    "Schedule"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "overrideId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_id": {
                                        "type": "integer"
                                    },
                                    "start_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "end_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "reason": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "rotation_ids": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "description": "null/absent = the whole schedule; else only these rotations' people (Opsgenie parity).",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "minItems": 1,
                                        "uniqueItems": true
                                    }
                                },
                                "required": [
                                    "user_id",
                                    "start_at",
                                    "end_at"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Override"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, or a plan gate (PlanGateError: code plan_feature_unavailable or plan_limit_reached).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/PlanGateError"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "errors": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "errors"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "schedule.deleteOverride",
                "tags": [
                    "Schedule"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "overrideId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/{schedule}/preview": {
            "post": {
                "operationId": "schedules.preview",
                "tags": [
                    "SchedulePreview"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "from": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "to": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "lanes": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "schedule": {
                                            "type": "string"
                                        },
                                        "from": {
                                            "type": "string"
                                        },
                                        "to": {
                                            "type": "string"
                                        },
                                        "version": {
                                            "type": "integer"
                                        },
                                        "stale": {
                                            "type": "boolean"
                                        },
                                        "segments": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "lane_segments": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "warnings": {
                                            "type": "array",
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "schedule",
                                        "from",
                                        "to",
                                        "version",
                                        "stale",
                                        "segments",
                                        "lane_segments",
                                        "warnings"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/{schedule}/publish": {
            "post": {
                "operationId": "schedules.publish",
                "tags": [
                    "SchedulePublish"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "schedule": {
                                            "$ref": "#/components/schemas/Schedule"
                                        },
                                        "ids": {
                                            "type": "object",
                                            "properties": {
                                                "schedule_groups": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "minItems": 0,
                                                    "maxItems": 0
                                                },
                                                "rotations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "minItems": 0,
                                                    "maxItems": 0
                                                },
                                                "rotation_slots": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "minItems": 0,
                                                    "maxItems": 0
                                                }
                                            },
                                            "required": [
                                                "schedule_groups",
                                                "rotations",
                                                "rotation_slots"
                                            ]
                                        },
                                        "warnings": {
                                            "type": "string",
                                            "description": "G3: what the saved roster looks like over the next 28 days. Never blocks a save."
                                        }
                                    },
                                    "required": [
                                        "schedule",
                                        "ids",
                                        "warnings"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "This roster was changed by someone else since you opened it."
                                        },
                                        "code": {
                                            "type": "string",
                                            "const": "schedule_version_conflict"
                                        },
                                        "current_version": {
                                            "type": "string"
                                        },
                                        "schedule": {
                                            "$ref": "#/components/schemas/Schedule"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "code",
                                        "current_version",
                                        "schedule"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/services": {
            "get": {
                "operationId": "service.index",
                "tags": [
                    "Service"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/Service"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "service.store",
                "tags": [
                    "Service"
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/services/{id}": {
            "get": {
                "operationId": "service.show",
                "tags": [
                    "Service"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "service.update",
                "tags": [
                    "Service"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": [
                                        "object",
                                        "null"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "service.destroy",
                "summary": "Refused (409) while a maintenance window is scoped to this service (#508):\ndropping it could leave that window with an empty scope, which means \"the\n     * whole organization\"",
                "tags": [
                    "Service"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "service_in_use"
                                        },
                                        "references": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "type": {
                                                        "type": "string",
                                                        "const": "maintenance_window"
                                                    },
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "state": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "type",
                                                    "id",
                                                    "name",
                                                    "state"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error",
                                        "references"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me/shifts": {
            "get": {
                "operationId": "shifts.mine",
                "summary": "The caller's own segments across every schedule in their organization, each with its schedule",
                "tags": [
                    "Shift"
                ],
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "from": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "to": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "segments": {
                                            "type": "array",
                                            "description": "Sorted by start_at.",
                                            "items": {
                                                "$ref": "#/components/schemas/MyShiftSegment"
                                            }
                                        }
                                    },
                                    "required": [
                                        "from",
                                        "to",
                                        "segments"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/schedules/{schedule}/shifts": {
            "get": {
                "operationId": "schedules.shifts",
                "description": "`from` defaults to now and `to` to from + 7 days; the range is at most 93 days.\nWith `user_id`, only that user's segments (gaps are then left out).",
                "summary": "A schedule's resolved timeline over [from, to)",
                "tags": [
                    "Shift"
                ],
                "parameters": [
                    {
                        "name": "schedule",
                        "in": "path",
                        "required": true,
                        "description": "The schedule ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "schedule": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name",
                                                "timezone"
                                            ]
                                        },
                                        "from": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "to": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "segments": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ShiftSegment"
                                            }
                                        }
                                    },
                                    "required": [
                                        "schedule",
                                        "from",
                                        "to",
                                        "segments"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/slack/oauth/callback": {
            "get": {
                "operationId": "slack.oauth.callback",
                "summary": "OAuth v2 redirect: exchange the code, store the bot token (encrypted) for the state's org",
                "tags": [
                    "Slack"
                ],
                "responses": {
                    "302": {
                        "description": "",
                        "headers": {
                            "Location": {
                                "required": true,
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/slack/events": {
            "post": {
                "operationId": "slack.events",
                "summary": "Events API: URL verification, and app_uninstalled / tokens_revoked",
                "tags": [
                    "Slack"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "ok": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "ok"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "challenge": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "challenge"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                "Bad Slack signature."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/slack/interactivity": {
            "post": {
                "operationId": "slack.interactivity",
                "summary": "Interactivity: Acknowledge/Close buttons. Verified, then handled on the queue (Slack wants a 200 within 3 s)",
                "tags": [
                    "Slack"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    },
                                    "minItems": 0,
                                    "maxItems": 0
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                "Bad Slack signature."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/slack": {
            "get": {
                "operationId": "slack.show",
                "tags": [
                    "Slack"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "configured": {
                                            "type": "boolean"
                                        },
                                        "installation": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "properties": {
                                                "slack_team_id": {
                                                    "type": "string"
                                                },
                                                "slack_team_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "active": {
                                                    "type": "boolean"
                                                },
                                                "revoked_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "installed_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "installed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "default_channel": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name"
                                                    ]
                                                },
                                                "team_channels": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "team_id": {
                                                                "type": "integer"
                                                            },
                                                            "channel_id": {
                                                                "type": "string"
                                                            },
                                                            "channel_name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "team_id",
                                                            "channel_id",
                                                            "channel_name"
                                                        ]
                                                    }
                                                }
                                            },
                                            "required": [
                                                "slack_team_id",
                                                "slack_team_name",
                                                "active",
                                                "revoked_at",
                                                "installed_by",
                                                "installed_at",
                                                "default_channel",
                                                "team_channels"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "configured",
                                        "installation"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "slack.update",
                "tags": [
                    "Slack"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "default_channel": {
                                        "type": [
                                            "object",
                                            "null"
                                        ],
                                        "properties": {
                                            "id": {
                                                "type": "string",
                                                "pattern": "^[CG][A-Z0-9]{2,30}$"
                                            },
                                            "name": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "maxLength": 255
                                            }
                                        }
                                    },
                                    "team_channels": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "team_id": {
                                                    "type": "integer"
                                                },
                                                "channel_id": {
                                                    "type": "string",
                                                    "pattern": "^[CG][A-Z0-9]{2,30}$"
                                                },
                                                "channel_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 255
                                                }
                                            },
                                            "required": [
                                                "team_id",
                                                "channel_id"
                                            ]
                                        },
                                        "maxItems": 500,
                                        "uniqueItems": true
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "configured": {
                                            "type": "boolean"
                                        },
                                        "installation": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "properties": {
                                                "slack_team_id": {
                                                    "type": "string"
                                                },
                                                "slack_team_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "active": {
                                                    "type": "boolean"
                                                },
                                                "revoked_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "installed_by": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "installed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "default_channel": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name"
                                                    ]
                                                },
                                                "team_channels": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "team_id": {
                                                                "type": "integer"
                                                            },
                                                            "channel_id": {
                                                                "type": "string"
                                                            },
                                                            "channel_name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "team_id",
                                                            "channel_id",
                                                            "channel_name"
                                                        ]
                                                    }
                                                }
                                            },
                                            "required": [
                                                "slack_team_id",
                                                "slack_team_name",
                                                "active",
                                                "revoked_at",
                                                "installed_by",
                                                "installed_at",
                                                "default_channel",
                                                "team_channels"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "configured",
                                        "installation"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "slack.destroy",
                "tags": [
                    "Slack"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Disconnected."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/slack/install": {
            "post": {
                "operationId": "slack.install",
                "summary": "Start \"Add to Slack\": a short-lived, single-use state bound to this org and admin",
                "tags": [
                    "Slack"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "url": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "url"
                                    ]
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "An error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                "The Slack app is not configured on this server yet."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/slack/channels": {
            "get": {
                "operationId": "slack.channels",
                "tags": [
                    "Slack"
                ],
                "responses": {
                    "502": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "channels": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "is_private": {
                                                        "type": "boolean"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "name",
                                                    "is_private"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "channels"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/slack/test": {
            "post": {
                "operationId": "slack.test",
                "summary": "Post a test message to the default channel (or one given)",
                "tags": [
                    "Slack"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "channel_id": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "pattern": "^[CG][A-Z0-9]{2,30}$"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Sent."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/sms/inbound/{token}": {
            "get": {
                "operationId": "sms.inbound",
                "tags": [
                    "SmsInbound"
                ],
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "ok": {
                                                    "type": "boolean"
                                                },
                                                "result": {
                                                    "type": "string"
                                                },
                                                "reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "ok",
                                                "result",
                                                "reason"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "ok": {
                                                    "type": "boolean"
                                                },
                                                "duplicate": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "ok",
                                                "duplicate"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "ok": {
                                                    "type": "boolean"
                                                },
                                                "duplicate": {
                                                    "type": "boolean"
                                                },
                                                "result": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "ok",
                                                "duplicate",
                                                "result"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "const": "unauthorized"
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/teams": {
            "get": {
                "operationId": "team.index",
                "tags": [
                    "Team"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "allOf": [
                                                            {
                                                                "$ref": "#/components/schemas/Team"
                                                            },
                                                            {
                                                                "type": "object",
                                                                "properties": {
                                                                    "users_count": {
                                                                        "type": "integer",
                                                                        "description": "Number of members."
                                                                    }
                                                                },
                                                                "required": [
                                                                    "users_count"
                                                                ]
                                                            }
                                                        ]
                                                    }
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "team.store",
                "tags": [
                    "Team"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "slug": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    },
                                    "default_escalation_policy_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/teams/{id}": {
            "get": {
                "operationId": "team.show",
                "summary": "One team with its members and what pages through it (#509 Teams screen)",
                "tags": [
                    "Team"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "team.update",
                "tags": [
                    "Team"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "slug": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    },
                                    "default_escalation_policy_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": [
                                        "object",
                                        "null"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "team.destroy",
                "summary": "Delete a team. Refused with 409 while anything still pages through it (#509):\nintegrations and heartbeats routed to it (their team would be nulled, so new\nalerts would reach nobody), its routing rules (they cascade away) and\nescalation steps that target it (no FK: they would resolve to nobody). The\nresponse lists the references so the admin can repoint them first",
                "tags": [
                    "Team"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "team_in_use"
                                        },
                                        "references": {
                                            "type": "array",
                                            "prefixItems": [
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "const": "escalation_policy"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "step": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "id",
                                                            "name",
                                                            "step"
                                                        ]
                                                    }
                                                },
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "const": "routing_rule"
                                                            },
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "enabled": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "id",
                                                            "name",
                                                            "enabled"
                                                        ]
                                                    }
                                                },
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "const": "integration"
                                                            },
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "enabled": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "id",
                                                            "name",
                                                            "enabled"
                                                        ]
                                                    }
                                                },
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "const": "heartbeat"
                                                            },
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "enabled": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "id",
                                                            "name",
                                                            "enabled"
                                                        ]
                                                    }
                                                }
                                            ],
                                            "minItems": 4,
                                            "maxItems": 4
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error",
                                        "references"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/teams/{id}/members": {
            "post": {
                "operationId": "team.syncMembers",
                "summary": "Sync team membership: [{user_id, role}]",
                "tags": [
                    "Team"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "members": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "user_id": {
                                                    "type": "integer"
                                                },
                                                "role": {
                                                    "type": "string",
                                                    "enum": [
                                                        "admin",
                                                        "responder",
                                                        "observer"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "user_id",
                                                "role"
                                            ]
                                        },
                                        "uniqueItems": true
                                    }
                                },
                                "required": [
                                    "members"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string",
                                            "const": "team_in_use"
                                        },
                                        "references": {
                                            "type": "array",
                                            "prefixItems": [
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "const": "escalation_policy"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "step": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "id",
                                                            "name",
                                                            "step"
                                                        ]
                                                    }
                                                },
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "const": "routing_rule"
                                                            },
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "enabled": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "id",
                                                            "name",
                                                            "enabled"
                                                        ]
                                                    }
                                                },
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "const": "integration"
                                                            },
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "enabled": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "id",
                                                            "name",
                                                            "enabled"
                                                        ]
                                                    }
                                                },
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "const": "heartbeat"
                                                            },
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "enabled": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "id",
                                                            "name",
                                                            "enabled"
                                                        ]
                                                    }
                                                }
                                            ],
                                            "minItems": 4,
                                            "maxItems": 4
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error",
                                        "references"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, or a plan gate (PlanGateError: code plan_feature_unavailable or plan_limit_reached).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/PlanGateError"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "errors": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "errors"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users": {
            "get": {
                "operationId": "user.index",
                "tags": [
                    "User"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/User"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "user.store",
                "summary": "Email the new user a set-password invite link",
                "tags": [
                    "User"
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, or a plan gate (PlanGateError: code plan_feature_unavailable or plan_limit_reached).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/PlanGateError"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "errors": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "errors"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users/{id}": {
            "get": {
                "operationId": "user.show",
                "tags": [
                    "User"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/User"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "user.update",
                "summary": "#395: an admin can't set another user's password (use the reset email) and\nan email change only takes effect when the new address confirms it",
                "tags": [
                    "User"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": [
                                        "object",
                                        "null"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, or a plan gate (PlanGateError: code plan_feature_unavailable or plan_limit_reached).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/PlanGateError"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "message": {
                                                    "type": "string"
                                                },
                                                "errors": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "message",
                                                "errors"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "user.destroy",
                "description": "#797: no longer a hard delete (which nulled history and left escalation steps\nnaming the user). It runs the same AccountDeletion as self-delete: the row is\nanonymised, the user is taken off rotations, overrides, escalation steps and\nteams (renumbered), gaps are audited and emailed to admins, and seats update.",
                "summary": "Remove a member (admin). The owner can't be removed until ownership is transferred",
                "tags": [
                    "User"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Deleted."
                                        },
                                        "roster_gaps": {
                                            "type": "number"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "roster_gaps"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users/{id}/resend-invite": {
            "post": {
                "operationId": "users.resend_invite",
                "summary": "Send a fresh 7-day invite (P1-22). The new link replaces the old one.\nOnce a minute per user at most",
                "tags": [
                    "User"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "ok": {
                                            "type": "boolean"
                                        },
                                        "invited_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "ok",
                                        "invited_at"
                                    ]
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "The invite could not be queued. Try again shortly."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "An invite was just sent. Try again in a minute."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Activate this user before inviting them."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users/{id}/password-reset": {
            "post": {
                "operationId": "users.password_reset",
                "summary": "POST users/{id}/password-reset: email the user a password reset link (admins never set it)",
                "tags": [
                    "User"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "ok": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "ok",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "The email could not be queued. Try again shortly."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "A link was just sent. Try again in a minute."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Activate this user first."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/voice/{token}.mp3": {
            "get": {
                "operationId": "voice.play",
                "tags": [
                    "Voice"
                ],
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        },
                        "headers": {
                            "Transfer-Encoding": {
                                "required": true,
                                "schema": {
                                    "type": "string",
                                    "enum": [
                                        "chunked"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {}
                ]
            }
        },
        "/voices": {
            "get": {
                "operationId": "voices.index",
                "summary": "The voices a user or organization may pick, the defaults, and what applies to you",
                "tags": [
                    "VoiceChoice"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "default": {
                                            "type": "string",
                                            "description": "The voice used when neither the user nor the organization picked one."
                                        },
                                        "organization_voice": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "description": "The organization's default call voice, or null for NOCgenie's default."
                                        },
                                        "user_voice": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "description": "The signed-in user's own choice, or null to use the organization's."
                                        },
                                        "effective": {
                                            "type": "string",
                                            "description": "The voice the signed-in user's alert calls use right now."
                                        },
                                        "voices": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "accent": {
                                                        "type": "string"
                                                    },
                                                    "gender": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "preview_url": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "name",
                                                    "accent",
                                                    "gender",
                                                    "description",
                                                    "preview_url"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "default",
                                        "organization_voice",
                                        "user_voice",
                                        "effective",
                                        "voices"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/voices/{voice}/preview.mp3": {
            "get": {
                "operationId": "voices.preview",
                "summary": "An MP3 sample of one voice (rendered once, then served from disk)",
                "tags": [
                    "VoiceChoice"
                ],
                "parameters": [
                    {
                        "name": "voice",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        },
                        "headers": {
                            "Transfer-Encoding": {
                                "required": true,
                                "schema": {
                                    "type": "string",
                                    "enum": [
                                        "chunked"
                                    ]
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "The voice sample is unavailable right now. Try again shortly."
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "description": "Unauthenticated: the bearer token is missing, expired or revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden: your role or token scope does not allow this.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests: slow down and retry after the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "http": {
                "type": "http",
                "scheme": "bearer"
            }
        },
        "schemas": {
            "AccountDeletionRefusal": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "string",
                        "enum": [
                            "last_owner",
                            "sole_member",
                            "reauth_required",
                            "invalid_password",
                            "invalid_mfa_code"
                        ]
                    },
                    "message": {
                        "type": "string"
                    },
                    "next": {
                        "type": "object",
                        "description": "409 only: what to do first.",
                        "properties": {
                            "action": {
                                "type": "string",
                                "enum": [
                                    "transfer_ownership",
                                    "close_organization"
                                ]
                            },
                            "endpoint": {
                                "type": "string",
                                "examples": [
                                    "POST /api/v1/organization/owner"
                                ]
                            }
                        }
                    },
                    "reauth": {
                        "type": "string",
                        "description": "403 reauth_required only: enter the password, or (SSO users) sign in again.",
                        "enum": [
                            "password",
                            "sign_in"
                        ]
                    }
                },
                "required": [
                    "code",
                    "message"
                ],
                "title": "AccountDeletionRefusal"
            },
            "Alert": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "team_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "integration_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "alias": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "priority": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "entity": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "tags": {
                        "type": "array",
                        "items": {}
                    },
                    "details": {
                        "type": "array",
                        "items": {}
                    },
                    "responders": {
                        "type": "array",
                        "items": {}
                    },
                    "actions": {
                        "type": "array",
                        "items": {}
                    },
                    "count": {
                        "type": "integer"
                    },
                    "owner_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "acknowledged_by": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "closed_by": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "acknowledged_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "closed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "snoozed_until": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "last_occurred_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "correlation_key": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "parent_alert_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "routed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "team_id",
                    "integration_id",
                    "alias",
                    "message",
                    "description",
                    "priority",
                    "status",
                    "source",
                    "entity",
                    "tags",
                    "details",
                    "responders",
                    "actions",
                    "count",
                    "owner_id",
                    "acknowledged_by",
                    "closed_by",
                    "acknowledged_at",
                    "closed_at",
                    "snoozed_until",
                    "last_occurred_at",
                    "created_at",
                    "updated_at",
                    "correlation_key",
                    "parent_alert_id",
                    "routed_at"
                ],
                "title": "Alert"
            },
            "AlertPolicy": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "order": {
                        "type": "integer"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "conditions": {
                        "type": "array",
                        "items": {}
                    },
                    "actions": {
                        "type": "array",
                        "items": {}
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "is_fallback": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "name",
                    "order",
                    "enabled",
                    "conditions",
                    "actions",
                    "created_at",
                    "updated_at",
                    "is_fallback"
                ],
                "title": "AlertPolicy"
            },
            "AlertUserRef": {
                "type": "object",
                "description": "A user of the same organization.",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name"
                ],
                "title": "AlertUserRef"
            },
            "AlertView": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Alert"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "service": {
                                "description": "The push payload's `service`: details.service, else the source.",
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "host": {
                                "description": "The push payload's `host`: the entity, else details.host.",
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "acknowledged_by_user": {
                                "description": "Who acknowledged it. Null if nobody did, it was done by a link, key or chat user without an account, or the user was deleted.",
                                "anyOf": [
                                    {
                                        "$ref": "#/components/schemas/AlertUserRef"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "closed_by_user": {
                                "description": "Who closed it; null as for acknowledged_by_user.",
                                "anyOf": [
                                    {
                                        "$ref": "#/components/schemas/AlertUserRef"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            }
                        },
                        "required": [
                            "service",
                            "host",
                            "acknowledged_by_user",
                            "closed_by_user"
                        ]
                    }
                ],
                "title": "AlertView"
            },
            "AuditLog": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "action": {
                        "type": "string"
                    },
                    "auditable_type": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "auditable_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "changes": {
                        "type": "array",
                        "items": {}
                    },
                    "ip_address": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "actor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "user_id",
                    "action",
                    "auditable_type",
                    "auditable_id",
                    "changes",
                    "ip_address",
                    "created_at",
                    "actor"
                ],
                "title": "AuditLog"
            },
            "ContactMethod": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "user_id": {
                        "type": "integer"
                    },
                    "type": {
                        "type": "string"
                    },
                    "value": {
                        "type": "string"
                    },
                    "is_verified": {
                        "type": "boolean"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "meta": {
                        "type": "array",
                        "items": {}
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "profile": {
                        "type": "boolean"
                    },
                    "value_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `value` was hidden (set to null) because the read_only/integration viewer, not their own."
                    },
                    "meta_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `meta` was hidden (set to null) because the as value."
                    }
                },
                "required": [
                    "id",
                    "user_id",
                    "type",
                    "value",
                    "is_verified",
                    "enabled",
                    "meta",
                    "created_at",
                    "updated_at",
                    "profile"
                ],
                "title": "ContactMethod"
            },
            "Device": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "user_id": {
                        "type": "integer"
                    },
                    "platform": {
                        "type": "string"
                    },
                    "app_version": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "last_seen_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "disabled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "disabled_reason": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "installation_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "user_id",
                    "platform",
                    "app_version",
                    "last_seen_at",
                    "disabled_at",
                    "disabled_reason",
                    "created_at",
                    "updated_at",
                    "installation_id"
                ],
                "title": "Device"
            },
            "EscalationPolicy": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "team_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "name": {
                        "type": "string"
                    },
                    "repeat_count": {
                        "type": "integer"
                    },
                    "repeat_interval": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "team_id",
                    "name",
                    "repeat_count",
                    "repeat_interval",
                    "created_at",
                    "updated_at"
                ],
                "title": "EscalationPolicy"
            },
            "EscalationStep": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "escalation_policy_id": {
                        "type": "integer"
                    },
                    "order": {
                        "type": "integer"
                    },
                    "delay_minutes": {
                        "type": "integer"
                    },
                    "target_type": {
                        "type": "string"
                    },
                    "target_id": {
                        "type": "integer"
                    },
                    "notify_condition": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "escalation_policy_id",
                    "order",
                    "delay_minutes",
                    "target_type",
                    "target_id",
                    "notify_condition",
                    "created_at",
                    "updated_at"
                ],
                "title": "EscalationStep"
            },
            "Heartbeat": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "team_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "name": {
                        "type": "string"
                    },
                    "token": {
                        "type": "string"
                    },
                    "interval_seconds": {
                        "type": "integer"
                    },
                    "alert_priority": {
                        "type": "string"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "expired": {
                        "type": "boolean"
                    },
                    "last_ping_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "expires_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "grace_seconds": {
                        "type": "integer"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "disabled",
                            "down",
                            "waiting",
                            "up"
                        ]
                    },
                    "token_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `token` was hidden (set to null) because the non-admin viewer."
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "team_id",
                    "name",
                    "token",
                    "interval_seconds",
                    "alert_priority",
                    "enabled",
                    "expired",
                    "last_ping_at",
                    "expires_at",
                    "created_at",
                    "updated_at",
                    "grace_seconds",
                    "status"
                ],
                "title": "Heartbeat"
            },
            "InboundFailure": {
                "type": "object",
                "description": "An inbound payload that could not be turned into an alert.",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "integration": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "type": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "id",
                            "name",
                            "type"
                        ]
                    },
                    "error": {
                        "type": "string"
                    },
                    "payload": {
                        "description": "The raw body as received, possibly truncated.",
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "payload_bytes": {
                        "type": "integer"
                    },
                    "payload_truncated": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "anyOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                },
                "required": [
                    "id",
                    "integration",
                    "error",
                    "payload",
                    "payload_bytes",
                    "payload_truncated",
                    "created_at"
                ],
                "title": "InboundFailure"
            },
            "Incident": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "team_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "title": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string"
                    },
                    "severity": {
                        "type": "string"
                    },
                    "resolved_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "stakeholder_ids": {
                        "type": "array",
                        "items": {}
                    },
                    "commander_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "incident_rule_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "postmortem": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "postmortem_published_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "team_id",
                    "title",
                    "description",
                    "status",
                    "severity",
                    "resolved_at",
                    "created_at",
                    "updated_at",
                    "stakeholder_ids",
                    "commander_id",
                    "incident_rule_id",
                    "postmortem",
                    "postmortem_published_at"
                ],
                "title": "Incident"
            },
            "IncidentRule": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "team_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "name": {
                        "type": "string"
                    },
                    "order": {
                        "type": "integer"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "conditions": {
                        "type": "array",
                        "items": {}
                    },
                    "severity": {
                        "type": "string"
                    },
                    "title_template": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "group_window_minutes": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "team_id",
                    "name",
                    "order",
                    "enabled",
                    "conditions",
                    "severity",
                    "title_template",
                    "group_window_minutes",
                    "created_at",
                    "updated_at"
                ],
                "title": "IncidentRule"
            },
            "Integration": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "team_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "name": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string"
                    },
                    "token": {
                        "type": "string"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "config": {
                        "type": "array",
                        "items": {}
                    },
                    "last_received_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "email_key": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "email_address": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "token_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `token` was hidden (set to null) because the non-admin viewer."
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "team_id",
                    "name",
                    "type",
                    "token",
                    "enabled",
                    "config",
                    "last_received_at",
                    "created_at",
                    "updated_at",
                    "email_key",
                    "email_address"
                ],
                "title": "Integration"
            },
            "MaintenanceWindow": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "team_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "name": {
                        "type": "string"
                    },
                    "starts_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "ends_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "filter": {
                        "type": "array",
                        "items": {}
                    },
                    "action": {
                        "type": "string"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "timezone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "state": {
                        "type": "string",
                        "enum": [
                            "disabled",
                            "ended",
                            "scheduled",
                            "active"
                        ]
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "team_id",
                    "name",
                    "starts_at",
                    "ends_at",
                    "filter",
                    "action",
                    "enabled",
                    "created_at",
                    "updated_at",
                    "timezone",
                    "state"
                ],
                "title": "MaintenanceWindow"
            },
            "MobileTokenResponse": {
                "type": "object",
                "properties": {
                    "token_type": {
                        "type": "string",
                        "const": "Bearer"
                    },
                    "access_token": {
                        "type": "string"
                    },
                    "access_expires_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "refresh_token": {
                        "type": "string"
                    },
                    "refresh_expires_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "ack_token": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Lock-screen ack/close token, or null when the role can't acknowledge."
                    },
                    "ack_expires_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "device_id": {
                        "type": "integer"
                    },
                    "installation_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "UUID v4 the app sent, or null for older builds."
                    },
                    "user": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            },
                            "email": {
                                "type": "string"
                            },
                            "role": {
                                "type": "string"
                            },
                            "organization_id": {
                                "type": "integer"
                            }
                        },
                        "required": [
                            "id",
                            "name",
                            "email",
                            "role",
                            "organization_id"
                        ]
                    },
                    "terms_acceptance_required": {
                        "type": "boolean",
                        "description": "When true, show the terms screen and POST auth/accept-terms before anything else."
                    }
                },
                "required": [
                    "token_type",
                    "access_token",
                    "access_expires_at",
                    "refresh_token",
                    "refresh_expires_at",
                    "ack_token",
                    "ack_expires_at",
                    "device_id",
                    "installation_id",
                    "user",
                    "terms_acceptance_required"
                ],
                "title": "MobileTokenResponse"
            },
            "MyShiftSegment": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ShiftSegment"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "schedule": {
                                "type": "object",
                                "description": "The schedule this segment is on.",
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "id",
                                    "name"
                                ]
                            }
                        },
                        "required": [
                            "schedule"
                        ]
                    }
                ],
                "title": "MyShiftSegment"
            },
            "NotificationLog": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "alert_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "channel": {
                        "type": "string"
                    },
                    "contact": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string"
                    },
                    "provider": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "provider_message_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "attempts": {
                        "type": "integer"
                    },
                    "error": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "sent_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "delivered_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "event": {
                        "type": "string"
                    },
                    "response": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "responded_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "region": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "device_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "due_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "dispatch_job": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "swept_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "segments": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "sender": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "sip_code": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "call_outcome": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "duration_seconds": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "duration_source": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "tts_chars": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "tts_cached": {
                        "type": [
                            "boolean",
                            "null"
                        ]
                    },
                    "billed_from": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "cost_aud": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "quiet": {
                        "type": "boolean"
                    },
                    "contact_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `contact` was hidden (set to null) because the read_only/integration viewer and the channel is not email."
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "alert_id",
                    "user_id",
                    "channel",
                    "contact",
                    "status",
                    "provider",
                    "provider_message_id",
                    "attempts",
                    "error",
                    "sent_at",
                    "delivered_at",
                    "created_at",
                    "updated_at",
                    "event",
                    "response",
                    "responded_at",
                    "region",
                    "device_id",
                    "due_at",
                    "dispatch_job",
                    "swept_at",
                    "segments",
                    "sender",
                    "sip_code",
                    "call_outcome",
                    "duration_seconds",
                    "duration_source",
                    "tts_chars",
                    "tts_cached",
                    "billed_from",
                    "cost_aud",
                    "quiet"
                ],
                "title": "NotificationLog"
            },
            "NotificationRule": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "user_id": {
                        "type": "integer"
                    },
                    "contact_method_id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "priority": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "delay_minutes": {
                        "type": "integer"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "quiet_hours": {
                        "description": "This rule's own quiet hours; null inherits the user's.",
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/QuietHours"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "order": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "type": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "user_id",
                    "contact_method_id",
                    "name",
                    "priority",
                    "delay_minutes",
                    "enabled",
                    "quiet_hours",
                    "order",
                    "created_at",
                    "updated_at",
                    "type"
                ],
                "title": "NotificationRule"
            },
            "OnCall": {
                "type": "object",
                "description": "GET schedules/{id}/on-call: who is on call at `at` and the next handoff.",
                "properties": {
                    "schedule_id": {
                        "type": "integer"
                    },
                    "timezone": {
                        "type": "string"
                    },
                    "at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The instant asked about (?at=, default now)."
                    },
                    "on_call": {
                        "description": "The first person on call (see on_call_all). Null when nobody is on call at `at`.",
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/OnCallUser"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "on_call_all": {
                        "type": "array",
                        "description": "Everyone on call at `at`: several layers (layer_mode all) and shift overlaps can put several people on at once. on_call is the first.",
                        "items": {
                            "$ref": "#/components/schemas/OnCallEntry"
                        }
                    },
                    "next": {
                        "description": "The next change of who is on call; null when none is found.",
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/OnCallNext"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                },
                "required": [
                    "schedule_id",
                    "timezone",
                    "at",
                    "on_call",
                    "on_call_all",
                    "next"
                ],
                "title": "OnCall"
            },
            "OnCallEntry": {
                "description": "Someone on call, with how they got there (same keys as ShiftSegment.users[]).",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/OnCallUser"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "source": {
                                "type": "string",
                                "enum": [
                                    "rotation",
                                    "override",
                                    "stand_in"
                                ]
                            },
                            "rotation_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "override_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "outgoing": {
                                "type": "boolean"
                            },
                            "slot": {
                                "anyOf": [
                                    {
                                        "type": "object",
                                        "properties": {
                                            "id": {
                                                "type": "integer"
                                            },
                                            "order": {
                                                "type": "integer"
                                            }
                                        }
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "via_team_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "via_group_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "stand_in_for_user_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "stand_in_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "source",
                            "rotation_id",
                            "override_id",
                            "outgoing",
                            "slot",
                            "via_team_id",
                            "via_group_id",
                            "stand_in_for_user_id",
                            "stand_in_id"
                        ]
                    }
                ],
                "title": "OnCallEntry"
            },
            "OnCallNext": {
                "type": "object",
                "properties": {
                    "at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the next handoff happens."
                    },
                    "id": {
                        "description": "Who takes over (kept for compatibility; same as user.id). Null on a handoff to nobody.",
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "name": {
                        "description": "As id.",
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "user": {
                        "description": "Who takes over; null when nobody is on call after the handoff.",
                        "anyOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "id",
                                    "name"
                                ]
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "contact": {
                        "description": "Null for read_only and integration viewers; set for admin, roster and responder viewers. Also null on a handoff to nobody.",
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UserContact"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "users": {
                        "type": "array",
                        "description": "Everyone on call after the handoff (several people can be on call at once); user is the first.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "id",
                                "name"
                            ]
                        }
                    }
                },
                "required": [
                    "at",
                    "id",
                    "name",
                    "contact",
                    "users"
                ],
                "title": "OnCallNext"
            },
            "OnCallUser": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "email": {
                        "type": "string"
                    },
                    "contact": {
                        "description": "Null for read_only and integration viewers; set for admin, roster and responder viewers.",
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UserContact"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                },
                "required": [
                    "id",
                    "name",
                    "email",
                    "contact"
                ],
                "title": "OnCallUser"
            },
            "Organization": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "settings": {
                        "type": "array",
                        "items": {}
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "plan": {
                        "type": "string"
                    },
                    "stripe_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "pm_type": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "pm_last_four": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "trial_ends_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "payment_issue_since": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "email_verification_pending": {
                        "type": "boolean"
                    },
                    "billing_email": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "abn": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "require_mfa": {
                        "type": "boolean"
                    },
                    "terms_version": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "terms_accepted_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "terms_accepted_by": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string"
                    },
                    "closes_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "dormant_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "closed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "closed_by_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "purge_after": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "owner_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "comp_tier": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "comp_seat_cap": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "intended_plan": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "creation_request_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "auto_top_up_total_cap_cents": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "auto_top_up_total_notified_period": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "cost_breaker_notified_period": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "sso_enforced": {
                        "type": "boolean"
                    },
                    "is_demo": {
                        "type": "boolean"
                    },
                    "call_voice": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "stripe_id_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `stripe_id` was hidden (set to null) because the non-admin viewer."
                    },
                    "pm_type_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `pm_type` was hidden (set to null) because the non-admin viewer."
                    },
                    "pm_last_four_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `pm_last_four` was hidden (set to null) because the non-admin viewer."
                    },
                    "billing_email_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `billing_email` was hidden (set to null) because the non-admin viewer."
                    },
                    "abn_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `abn` was hidden (set to null) because the non-admin viewer."
                    }
                },
                "required": [
                    "id",
                    "name",
                    "slug",
                    "settings",
                    "created_at",
                    "updated_at",
                    "plan",
                    "stripe_id",
                    "pm_type",
                    "pm_last_four",
                    "trial_ends_at",
                    "payment_issue_since",
                    "email_verification_pending",
                    "billing_email",
                    "abn",
                    "require_mfa",
                    "terms_version",
                    "terms_accepted_at",
                    "terms_accepted_by",
                    "status",
                    "closes_at",
                    "dormant_at",
                    "closed_at",
                    "closed_by_user_id",
                    "purge_after",
                    "owner_user_id",
                    "comp_tier",
                    "comp_seat_cap",
                    "intended_plan",
                    "creation_request_id",
                    "auto_top_up_total_cap_cents",
                    "auto_top_up_total_notified_period",
                    "cost_breaker_notified_period",
                    "sso_enforced",
                    "is_demo",
                    "call_voice"
                ],
                "title": "Organization"
            },
            "Override": {
                "type": "object",
                "description": "A one-off override: user_id is on call from start_at to end_at (UTC), above every layer. Overlapping overrides are allowed; the newest wins. `user` is included on GET schedule(s) and PUT; POST returns it without.",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "schedule_id": {
                        "type": "integer"
                    },
                    "user_id": {
                        "type": "integer"
                    },
                    "rotation_ids": {
                        "description": "Null: the whole schedule (replaces everyone on call). Else only these rotations' people are replaced (Opsgenie parity).",
                        "anyOf": [
                            {
                                "type": "array",
                                "items": {
                                    "type": "integer"
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "start_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "end_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "reason": {
                        "description": "Free text, max 255.",
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "anyOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "updated_at": {
                        "anyOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "user": {
                        "$ref": "#/components/schemas/RosterUser"
                    }
                },
                "required": [
                    "id",
                    "schedule_id",
                    "user_id",
                    "start_at",
                    "end_at",
                    "reason"
                ],
                "title": "Override"
            },
            "PageMeta": {
                "type": "object",
                "description": "Laravel page metadata. Pages are `PageMeta` plus `data`, an array of the endpoint's items.",
                "properties": {
                    "current_page": {
                        "type": "integer"
                    },
                    "first_page_url": {
                        "type": "string"
                    },
                    "from": {
                        "description": "1-based index of the first item; null on an empty page.",
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "last_page": {
                        "type": "integer"
                    },
                    "last_page_url": {
                        "type": "string"
                    },
                    "links": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "url": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "label": {
                                    "type": "string"
                                },
                                "page": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "active": {
                                    "type": "boolean"
                                }
                            },
                            "required": [
                                "url",
                                "label",
                                "active"
                            ]
                        }
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "path": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "to": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "total": {
                        "type": "integer"
                    }
                },
                "required": [
                    "current_page",
                    "first_page_url",
                    "from",
                    "last_page",
                    "last_page_url",
                    "links",
                    "next_page_url",
                    "path",
                    "per_page",
                    "prev_page_url",
                    "to",
                    "total"
                ],
                "title": "PageMeta"
            },
            "PlanGateError": {
                "type": "object",
                "description": "A plan gate refused the request (422). Allowlisted test numbers (#712) never hit the SMS/voice gate.",
                "properties": {
                    "message": {
                        "type": "string",
                        "description": "Human-readable, unchanged from before #742."
                    },
                    "code": {
                        "type": "string",
                        "enum": [
                            "plan_feature_unavailable",
                            "plan_limit_reached"
                        ]
                    },
                    "feature": {
                        "type": "string",
                        "description": "What the plan lacks: sms or voice (feature unavailable), or seats (limit reached).",
                        "enum": [
                            "sms",
                            "voice",
                            "seats"
                        ]
                    },
                    "plan": {
                        "description": "The organization's plan key, e.g. free.",
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "limit": {
                        "description": "For plan_limit_reached: the plan's limit.",
                        "type": [
                            "integer",
                            "null"
                        ]
                    }
                },
                "required": [
                    "message",
                    "code",
                    "feature",
                    "plan"
                ],
                "title": "PlanGateError"
            },
            "QuietHours": {
                "type": "object",
                "description": "Quiet hours. Local wall-clock time in `timezone` (null = the user's time zone), DST-safe.\n- `end` <= `start` wraps past midnight (22:00-07:00). `start` == `end` is never quiet: use it on a rule to opt out of the user's quiet hours.\n- `days` lists the weekdays a window starts on (default every day): with 22:00-07:00 and `[\"fri\"]`, Saturday 03:00 is quiet.\n- `override_priorities` are never quiet.\n- A notification rule with its own quiet_hours uses them; null inherits the user's.\n- In quiet hours, rules and the user's SMS/voice flags are skipped (each skip is on the alert timeline). Device pushes are still delivered, but quietly: severity `alerts-quiet`, data.quiet \"1\", Android priority normal, iOS passive with no sound.\n- **P1 fallback:** a P1 is never silent. If nothing else would page the user loudly, their devices get a normal push, and if they have no device the zero-send fallback pages a contact method or the account email.\n- Unknown keys, bad times, time zones, days or priorities are a 422.",
                "properties": {
                    "start": {
                        "type": "string",
                        "description": "Start, HH:MM local.",
                        "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
                        "examples": [
                            "22:00"
                        ]
                    },
                    "end": {
                        "type": "string",
                        "description": "End, HH:MM local, exclusive.",
                        "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
                        "examples": [
                            "22:00"
                        ]
                    },
                    "timezone": {
                        "description": "IANA zone; null = the user's time zone.",
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "days": {
                        "type": "array",
                        "description": "Weekdays a window starts on; default every day.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "mon",
                                "tue",
                                "wed",
                                "thu",
                                "fri",
                                "sat",
                                "sun"
                            ]
                        },
                        "minItems": 1,
                        "maxItems": 7,
                        "uniqueItems": true
                    },
                    "override_priorities": {
                        "type": "array",
                        "description": "Never quiet.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "P1",
                                "P2",
                                "P3",
                                "P4",
                                "P5"
                            ]
                        },
                        "maxItems": 5,
                        "uniqueItems": true
                    }
                },
                "required": [
                    "start",
                    "end"
                ],
                "title": "QuietHours"
            },
            "RosterUser": {
                "type": "object",
                "description": "A person as embedded in roster responses. Other user fields may also be present. Contact PII (mobile, mobile_verified_at) is hidden from read_only and integration viewers, except on their own record.",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "email": {
                        "type": "string"
                    },
                    "timezone": {
                        "type": "string"
                    },
                    "mobile": {
                        "description": "Null when the person has none, or when hidden from the viewer (see mobile_redacted).",
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "mobile_redacted": {
                        "type": "boolean",
                        "description": "Present and true when mobile was hidden from a read_only or integration viewer."
                    }
                },
                "required": [
                    "id",
                    "name",
                    "email",
                    "mobile"
                ],
                "title": "RosterUser"
            },
            "Rotation": {
                "type": "object",
                "description": "A schedule layer.",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "schedule_id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "daily",
                            "weekly",
                            "custom"
                        ]
                    },
                    "length": {
                        "type": "integer",
                        "description": "Shift length in units of `type` (days for daily/custom, weeks for weekly)."
                    },
                    "start_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Rotation anchor (UTC)."
                    },
                    "end_at": {
                        "description": "When the layer stops; null = runs forever.",
                        "anyOf": [
                            {
                                "type": "string",
                                "format": "date-time"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "handoff_time": {
                        "description": "Local time of day (schedule timezone) for the handoff, HH:MM:SS.",
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "time_restriction": {
                        "description": "Deprecated (one release): the single window when restrictions has exactly one without time_zone, else null. Use restrictions.",
                        "anyOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "days": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 7
                                        }
                                    },
                                    "start": {
                                        "type": "string"
                                    },
                                    "end": {
                                        "type": "string"
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "restrictions": {
                        "type": "array",
                        "description": "Time windows (at most 14); the layer is active when any matches. Empty = always.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "days": {
                                    "type": "array",
                                    "description": "ISO weekdays (1 = Monday).",
                                    "items": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 7
                                    }
                                },
                                "start": {
                                    "type": "string",
                                    "description": "HH:MM local."
                                },
                                "end": {
                                    "type": "string",
                                    "description": "HH:MM local. Before start = crosses midnight and belongs to the day it starts."
                                },
                                "time_zone": {
                                    "description": "IANA zone for this window; null = the schedule's.",
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            },
                            "required": [
                                "days",
                                "start",
                                "end"
                            ]
                        }
                    },
                    "order": {
                        "type": "integer",
                        "description": "Layer order (index 0 lowest). Matters under layer_mode top, where the highest layer that yields someone wins."
                    },
                    "participants": {
                        "type": "array",
                        "description": "User slots only, in turn order (older clients). rotation_slots has every slot.",
                        "items": {
                            "allOf": [
                                {
                                    "$ref": "#/components/schemas/RosterUser"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "pivot": {
                                            "type": "object",
                                            "properties": {
                                                "order": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "rotation_slots": {
                        "type": "array",
                        "description": "Every slot, in turn order. Slots take turns; a team or group slot puts all its members on at once.",
                        "items": {
                            "$ref": "#/components/schemas/RotationSlot"
                        }
                    }
                },
                "required": [
                    "id",
                    "schedule_id",
                    "name",
                    "type",
                    "length",
                    "start_at",
                    "end_at",
                    "handoff_time",
                    "time_restriction",
                    "order"
                ],
                "title": "Rotation"
            },
            "RotationSlot": {
                "type": "object",
                "description": "One slot of a rotation: exactly one of a user, a team or a schedule group (multi on-call).",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "rotation_id": {
                        "type": "integer"
                    },
                    "order": {
                        "type": "integer",
                        "description": "Turn order within the rotation."
                    },
                    "user_id": {
                        "description": "Set for a user slot.",
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "team_id": {
                        "description": "Set for a team slot: all its active members are on call together.",
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "schedule_group_id": {
                        "description": "Set for a group slot: all its members are on call together.",
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "user": {
                        "anyOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": "string"
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "team": {
                        "anyOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": "string"
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "group": {
                        "anyOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": "string"
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                },
                "required": [
                    "id",
                    "rotation_id",
                    "order",
                    "user_id",
                    "team_id",
                    "schedule_group_id"
                ],
                "title": "RotationSlot"
            },
            "RoutingRule": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "team_id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "order": {
                        "type": "integer"
                    },
                    "conditions": {
                        "type": "array",
                        "items": {}
                    },
                    "escalation_policy_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "schedule_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "is_default": {
                        "type": "boolean"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "team_id",
                    "name",
                    "order",
                    "conditions",
                    "escalation_policy_id",
                    "schedule_id",
                    "is_default",
                    "enabled",
                    "created_at",
                    "updated_at"
                ],
                "title": "RoutingRule"
            },
            "SavedSearch": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "user_id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "filters": {
                        "type": "array",
                        "items": {}
                    },
                    "is_shared": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "user_id",
                    "name",
                    "filters",
                    "is_shared",
                    "created_at",
                    "updated_at"
                ],
                "title": "SavedSearch"
            },
            "Schedule": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "team_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "name": {
                        "type": "string"
                    },
                    "timezone": {
                        "type": "string"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "feed_token": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "layer_mode": {
                        "type": "string"
                    },
                    "shift_change_mode": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "version": {
                        "type": "integer"
                    },
                    "requests_need_approval": {
                        "type": "boolean"
                    },
                    "feed_token_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `feed_token` was hidden (set to null) because the read_only viewer."
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "team_id",
                    "name",
                    "timezone",
                    "enabled",
                    "created_at",
                    "updated_at",
                    "feed_token",
                    "layer_mode",
                    "shift_change_mode",
                    "version",
                    "requests_need_approval"
                ],
                "title": "Schedule"
            },
            "ScheduleDetail": {
                "type": "object",
                "description": "A schedule with its layers. GET schedule(s) include rotations, overrides and team; PUT rotations includes rotations only.",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "team_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "name": {
                        "type": "string"
                    },
                    "timezone": {
                        "type": "string"
                    },
                    "layer_mode": {
                        "type": "string",
                        "description": "all: everyone on an active layer is on call (Opsgenie, default). top: only the highest active layer.",
                        "enum": [
                            "all",
                            "top"
                        ]
                    },
                    "shift_change_mode": {
                        "description": "handoff: shifts change at handoff_time (Opsgenie). overlap: shifts change at start_at's time and the outgoing participant stays on until handoff_time. Null: the organization default (settings.shift_change_mode, default handoff).",
                        "anyOf": [
                            {
                                "type": "string",
                                "enum": [
                                    "handoff",
                                    "overlap"
                                ]
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "version": {
                        "type": "integer",
                        "description": "Goes up by one on every change to the schedule (fields, groups, rotations, slots, overrides). Publish needs it as base_version; also sent as ETag \"v<version>\" on GET."
                    },
                    "requests_need_approval": {
                        "type": "boolean",
                        "description": "Swap and stand-in requests wait for an admin or roster user."
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "feed_token": {
                        "description": "iCal feed token; null (feed_token_redacted: true) for read_only viewers.",
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "rotations": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Rotation"
                        }
                    },
                    "overrides": {
                        "type": "array",
                        "description": "Overrides that have not ended, plus those that ended in the last 7 days (#1006), by start. Older ones: GET schedules/{schedule}/overrides (paged).",
                        "items": {
                            "$ref": "#/components/schemas/Override"
                        }
                    },
                    "team": {
                        "anyOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": "string"
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "schedule_groups": {
                        "type": "array",
                        "description": "Named sets of users on this schedule that a rotation slot can put on call together.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer"
                                },
                                "schedule_id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": "string"
                                },
                                "members": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "id": {
                                                "type": "integer"
                                            },
                                            "name": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                }
                            },
                            "required": [
                                "id",
                                "schedule_id",
                                "name"
                            ]
                        }
                    },
                    "schedule_stand_ins": {
                        "type": "array",
                        "description": "Stand-ins that have not ended, plus those that ended in the last week. Older: GET schedules/{schedule}/stand-ins (paged).",
                        "items": {
                            "$ref": "#/components/schemas/StandIn"
                        }
                    },
                    "ids": {
                        "type": "object",
                        "description": "PUT rotations only: client_ref => new id, keyed by kind (schedule_groups, rotations, rotation_slots)."
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "team_id",
                    "name",
                    "timezone",
                    "layer_mode",
                    "shift_change_mode",
                    "version",
                    "requests_need_approval",
                    "enabled"
                ],
                "title": "ScheduleDetail"
            },
            "ScheduleOverride": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "schedule_id": {
                        "type": "integer"
                    },
                    "user_id": {
                        "type": "integer"
                    },
                    "start_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "end_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "reason": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "rotation_ids": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "request_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "schedule_id",
                    "user_id",
                    "start_at",
                    "end_at",
                    "reason",
                    "created_at",
                    "updated_at",
                    "rotation_ids",
                    "request_id"
                ],
                "title": "ScheduleOverride"
            },
            "ScheduleStandIn": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "schedule_id": {
                        "type": "integer"
                    },
                    "absent_user_id": {
                        "type": "integer"
                    },
                    "stand_in_user_id": {
                        "type": "integer"
                    },
                    "start_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "end_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "team_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "schedule_group_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "reason": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_by": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "request_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "schedule_id",
                    "absent_user_id",
                    "stand_in_user_id",
                    "start_at",
                    "end_at",
                    "team_id",
                    "schedule_group_id",
                    "reason",
                    "created_by",
                    "request_id",
                    "created_at",
                    "updated_at"
                ],
                "title": "ScheduleStandIn"
            },
            "Service": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "team_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "name": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "team_id",
                    "name",
                    "description",
                    "status",
                    "created_at",
                    "updated_at"
                ],
                "title": "Service"
            },
            "ShiftSegment": {
                "type": "object",
                "description": "One stretch of the resolved roster, from the same resolver as on-call. Segments are contiguous and adjacent ones differ.",
                "properties": {
                    "start_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Start, UTC, inclusive."
                    },
                    "end_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "End, UTC, exclusive: the next segment starts here."
                    },
                    "user": {
                        "description": "Who is on call; null for a gap with nobody on call.",
                        "anyOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "id",
                                    "name"
                                ]
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "source": {
                        "type": "string",
                        "enum": [
                            "rotation",
                            "override",
                            "none"
                        ]
                    },
                    "rotation_id": {
                        "type": "integer",
                        "description": "Only when source is rotation: the layer that put them on call."
                    },
                    "override_id": {
                        "type": "integer",
                        "description": "Only when source is override."
                    },
                    "users": {
                        "type": "array",
                        "description": "Everyone on call in this segment (several people can be on at once); user is the first. Empty for a gap. On /me/shifts and with ?user_id=, just that person.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": "string"
                                },
                                "source": {
                                    "type": "string",
                                    "enum": [
                                        "rotation",
                                        "override"
                                    ]
                                },
                                "rotation_id": {
                                    "description": "Set when source is rotation.",
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "override_id": {
                                    "description": "Set when source is override.",
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "outgoing": {
                                    "type": "boolean",
                                    "description": "True for the previous participant kept on by a shift overlap (shift_change_mode overlap)."
                                },
                                "slot": {
                                    "description": "The rotation slot that put them on; null for an override.",
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "order": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "order"
                                            ]
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "via_team_id": {
                                    "description": "Set when on through a team slot.",
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "via_group_id": {
                                    "description": "Set when on through a schedule group slot.",
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "stand_in_for_user_id": {
                                    "description": "Set when standing in for that person.",
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "stand_in_id": {
                                    "description": "The stand-in that put them on.",
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                }
                            },
                            "required": [
                                "id",
                                "name",
                                "source",
                                "rotation_id",
                                "override_id",
                                "outgoing",
                                "slot",
                                "via_team_id",
                                "via_group_id",
                                "stand_in_for_user_id",
                                "stand_in_id"
                            ]
                        }
                    }
                },
                "required": [
                    "start_at",
                    "end_at",
                    "user",
                    "source",
                    "users"
                ],
                "title": "ShiftSegment"
            },
            "StandIn": {
                "type": "object",
                "description": "Someone standing in for one person on this schedule (multi on-call). Everyone else stays on call.",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "schedule_id": {
                        "type": "integer"
                    },
                    "absent_user_id": {
                        "type": "integer"
                    },
                    "stand_in_user_id": {
                        "type": "integer"
                    },
                    "start_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "end_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Exclusive."
                    },
                    "team_id": {
                        "description": "Scope: only where the absent person is on through this team.",
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "schedule_group_id": {
                        "description": "Scope: only through this group. Both null = the whole schedule.",
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "reason": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_by": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "request_id": {
                        "description": "Set when a roster request applied it.",
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "absent": {
                        "anyOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": "string"
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "stand_in": {
                        "anyOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "name": {
                                        "type": "string"
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                },
                "required": [
                    "id",
                    "schedule_id",
                    "absent_user_id",
                    "stand_in_user_id",
                    "start_at",
                    "end_at",
                    "team_id",
                    "schedule_group_id"
                ],
                "title": "StandIn"
            },
            "Team": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "organization_id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "default_escalation_policy_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "name",
                    "slug",
                    "description",
                    "created_at",
                    "updated_at",
                    "default_escalation_policy_id"
                ],
                "title": "Team"
            },
            "User": {
                "type": "object",
                "description": "A user. Contact PII (mobile, mobile_verified_at) is null for read_only and integration viewers, and sso_issuer/sso_subject for non-admins, except on their own record; see the *_redacted flags.",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "email": {
                        "type": "string"
                    },
                    "email_verified_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "organization_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "role": {
                        "type": "string"
                    },
                    "timezone": {
                        "type": "string"
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "mobile": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "notify_email": {
                        "type": "boolean"
                    },
                    "notify_sms": {
                        "type": "boolean"
                    },
                    "notify_voice": {
                        "type": "boolean"
                    },
                    "on_notification_list": {
                        "type": "boolean"
                    },
                    "mobile_verified_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "sso_issuer": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "sso_subject": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "critical_alerts": {
                        "type": "boolean"
                    },
                    "two_factor_confirmed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "invited_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "terms_accepted_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "terms_version": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "terms_acceptance_source": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "quiet_hours": {
                        "description": "The user's quiet hours; rules without their own inherit them.",
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/QuietHours"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "anonymised_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "call_voice": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "mobile_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `mobile` was hidden (set to null) because the read_only/integration viewer, not their own record."
                    },
                    "mobile_verified_at_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `mobile_verified_at` was hidden (set to null) because the read_only/integration viewer, not their own record."
                    },
                    "sso_issuer_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `sso_issuer` was hidden (set to null) because the viewer is not an admin and not the user."
                    },
                    "sso_subject_redacted": {
                        "type": "boolean",
                        "description": "Present and true when `sso_subject` was hidden (set to null) because the viewer is not an admin and not the user."
                    },
                    "contact_methods": {
                        "type": "array",
                        "description": "On GET users/{id} only. Empty (with contact_methods_redacted) for read_only/integration viewers, except on their own record.",
                        "items": {
                            "$ref": "#/components/schemas/ContactMethod"
                        }
                    },
                    "contact_methods_redacted": {
                        "type": "boolean",
                        "description": "Present and true when contact_methods was emptied for the viewer."
                    }
                },
                "required": [
                    "id",
                    "name",
                    "email",
                    "email_verified_at",
                    "created_at",
                    "updated_at",
                    "organization_id",
                    "role",
                    "timezone",
                    "is_active",
                    "mobile",
                    "notify_email",
                    "notify_sms",
                    "notify_voice",
                    "on_notification_list",
                    "mobile_verified_at",
                    "sso_issuer",
                    "sso_subject",
                    "critical_alerts",
                    "two_factor_confirmed_at",
                    "invited_at",
                    "terms_accepted_at",
                    "terms_version",
                    "terms_acceptance_source",
                    "quiet_hours",
                    "anonymised_at",
                    "call_voice"
                ],
                "title": "User"
            },
            "UserContact": {
                "type": "object",
                "description": "How to reach an on-call person. Null for read_only and integration viewers; set for admin, roster and responder viewers.",
                "properties": {
                    "mobile": {
                        "description": "E.164 mobile number, if the person has one.",
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "email": {
                        "type": "string"
                    }
                },
                "required": [
                    "mobile",
                    "email"
                ],
                "title": "UserContact"
            }
        },
        "responses": {
            "ValidationException": {
                "description": "Validation error",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Errors overview."
                                },
                                "errors": {
                                    "type": "object",
                                    "description": "A detailed description of each field that failed validation.",
                                    "additionalProperties": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "required": [
                                "message",
                                "errors"
                            ]
                        }
                    }
                }
            },
            "ModelNotFoundException": {
                "description": "Not found",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            }
        }
    }
}